Migrate the Kubernetes Cluster DNS Domain from cluster.local to iximiuz.cluster
Scenario
You are a Kubernetes administrator setting up a cluster for the iximiuz
platform. The default Kubernetes DNS domain cluster.local must be changed to
iximiuz.cluster to match the platform's internal service discovery naming
convention.
All services in the cluster should be reachable using the new domain. For
example, the nginx service in the domain namespace must resolve at:
http://nginx.domain.svc.iximiuz.cluster
The nginx deployment with 4 replicas is already running in the domain
namespace and is ready to serve traffic. Your job is to reconfigure the cluster
DNS domain so that service discovery works under the new iximiuz.cluster zone.
Task
Three components control the cluster DNS domain and all must be updated together. Missing any one of them will either break DNS resolution immediately or cause failures when new nodes join the cluster in the future.
CoreDNS is the cluster DNS server. Its configuration lives in the coredns ConfigMap in kube-system.
Every cluster.local reference inside the Corefile must be changed to iximiuz.cluster: the zone argument on the kubernetes plugin line, and the two disable lines inside the cache block. After editing, restart CoreDNS to apply the change.
Hint 1 - Update the CoreDNS ConfigMap
CoreDNS reads its configuration from the coredns ConfigMap in kube-system.
Edit it and replace every occurrence of cluster.local with iximiuz.cluster:
kubectl edit configmap coredns -n kube-system
There are three separate lines inside the Corefile that mention
cluster.local, not just one. All three need to change, or the ConfigMap
check will keep failing even after you fix the others:
- The zone argument on the
kubernetesplugin line:kubernetes cluster.local in-addr.arpa ip6.arpa { - Two lines inside the
cacheblock:cache 30 { disable success cluster.local disable denial cluster.local }
After saving, restart CoreDNS to pick up the new config:
kubectl rollout restart deployment/coredns -n kube-system
kubectl rollout status deployment/coredns -n kube-system
Documentation