I would like to resolve the kube-dns names from outside of the Kubernetes cluster by adding a stub zone to my DNS servers. This requires changing the cluster.local domain to something that fits into my DNS namespace.
The cluster DNS is working fine with cluster.local. To change the domain I have modified the line with KUBELET_DNS_ARGS on /etc/systemd/system/kubelet.service.d/10-kubeadm.conf to read:
Environment="KUBELET_DNS_ARGS=--cluster-dns=x.y.z --cluster-domain=cluster.mydomain.local --resolv-conf=/etc/resolv.conf.kubernetes"
After restarting kubelet external names are resolvable but kubernetes name resolution failed.
I can see that kube-dns is still running with:
/kube-dns --domain=cluster.local. --dns-port=10053 --config-dir=/kube-dns-config --v=2
The only place I was able to find cluster.local was within the pods yaml configuration which reads:
containers:
- args:
- --domain=cluster.local.
- --dns-port=10053
- --config-dir=/kube-dns-config
- --v=2
After modifying the yaml and recreating the pod using
kubectl replace --force -f kube-dns.yaml
I still see kube-dns gettings started with --domain=cluster.local.
What am I missing?