Which approach preserves cloud-init DNS settings across reboots in k3os?
27K reputation · 15 Jun 2022, 14:21 UTC
The goal is to keep custom DNS servers supplied via cloud-init after a k3os node reboots.
During early boot, cloud-init writes the nameservers to /etc/resolv.conf, but k3os later runs a DNS reconciliation loop that regenerates /etc/resolv.conf from static files in /etc/rancher/k3os/dns, overwriting the cloud-init values unless those files are also updated.
It is unclear whether modifying the dns directory through cloud-init or disabling the reconciliation loop is a supported, version‑stable approach, and how this behavior differs between releases before and after v0.20.0.
Can cloud-init be directed to write to /etc/rancher/k3os/dns instead of /etc/resolv.conf?
Is it safe to disable the DNS reconciliation loop in k3os to retain cloud‑init DNS settings?