-
-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] coredns looses customization after cluster or docker restart #1112
Comments
Any way to implement in k3d the official "coredns-custom" cm, to be created when in config.yaml you define custom hosts or other coredns related mods, instead of the actual method that patches directly the default cm? This would solve the issue, probably... https://docs.digitalocean.com/products/kubernetes/how-to/customize-coredns/ |
@fragolinux see #816 |
Defining a custom DNS config would not fix my problem. I am trying to manage one k3d cluster from another k3d cluster. For this, I needed to add the server from the managed k3d cluster to the network of the cluster running argocd. After starting up the clusters using However, after restarting docker, the config map is reset as mentioned above. Is there a way to prevent k3d from resetting the coredns configmap upon startup? |
@fragolinux Unfortunately this is expected behavior with regard to Rancher K3s and is not a k3d issue per se. Rancher K3s rewrites the manifest files whenever it is started and the documentation states that they shouldn't be altered:
When k3d creates a cluster ( A workaround for this issue is to run It is possible to disable the Rancher K3s CoreDNS manifests and replace with your own but, unfortunately, k3d doesn't have an option for injecting the NodeHosts entries into a different manifest file (e.g., |
Solved 2 years ago 😅 |
Host entries to the CoreDNS config are now managed via the coredns-custom configmap as per #1453 so they survive restarts of the cluster and host system. This is released in https://github.com/k3d-io/k3d/releases/tag/v5.7.0 |
What did you do
How was the cluster created?
k3d cluster create --config cluster.yaml
once created the cluster, i checked the coredns configmap, and it's ok, it contains:
i then restarted docker (desktop, on mac), container started but the configmap was completely emptied, it now contains just this:
What did you expect to happen
configmap survives a simple docker restart... i confirm this happens even on k3s container stop and restart...
Screenshots or terminal output
Which OS & Architecture
Which version of
k3d
PLEASE note that even the k3s version is wrong, as the cluster config has this ENV...
K3SVERSION=v1.21.14-k3s1
export IMAGE=k3s:"${K3SVERSION}"
Which version of docker
The text was updated successfully, but these errors were encountered: