Closed mreiche closed 1 month ago
Hi @mreiche
Yes, it's possible to pass the --resolv-conf
flag using the k3s_server
and k3s_agent
group/host variables.
https://github.com/PyratLabs/ansible-role-k3s?tab=readme-ov-file#grouphost-variables
@mreiche
Alternatively, I saw in the post you linked that somebody was creating a coredns-custom
configmap. If you needed to configure this, I think you could use the k3s_server_manifests_templates
variable:
# Relative to your playbook
# templates/coredns-custom.yml
---
kind: ConfigMap
apiVersion: v1
metadata:
name: coredns-custom
namespace: kube-system
data:
forward.override: |-
forward . /etc/resolv.conf {
policy sequential
}
Then, configure your k3s_server_manifests_templates
variable to apply this configmap to the cluster:
# ...
k3s_server_manifests_templates:
- coredns-custom.yml
Hi @dbrennand. k3s coredns reads the coredns-custom
ConfigMap already. My problem is, that I can't override the default forward like described here: https://github.com/k3s-io/k3s/issues/10951
In reference to https://github.com/k3s-io/k3s/issues/4087 and https://github.com/k3s-io/k3s/discussions/7822: It looks like that coredns's
/etc/resolv.conf
differs from the host. Is it possible to configure the forward DNS or set up a different resolv.conf?