K3S Rancher - Debian based docker images not resolving dns properly K3S Rancher - Debian based docker images not resolving dns properly kubernetes kubernetes

K3S Rancher - Debian based docker images not resolving dns properly


I faced similar issues with k3s (v.v1.19.3+k3s3) on centos 8 (not quite sure it has anything to do with the images' OS, though). k3s is a bit less plug and play that other distro like microk8s.

Use local DNS parameter

On each node, you could say that you want to use the host's resolv parameters. If k3s is managed as systemd service (which is probably the case), you could just edit /etc/systemd/system/k3s.service.env to add you system's resolv.conf

K3S_RESOLV_CONF=/etc/resolv.conf

and then restart the service

sudo systemctl status k3s
  • plus: the easiest solution, easily scriptable
  • cons: you'll need to do it on each of your nodes (from what I understand). Different resolv.conf on different systems involves that the very same deployment might not act the same way depending on the nodes used by kube

relevant documentation

Use Global DNS

Haven't tried but here is the doc