kubeadm init: recommended value for clusterDND IP

4/14/2020

When using the following settings in the kubeadm config file:

apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
clusterDNS:
- fd10::4:5

I see the following warning when initializing my cluster:

[root@k8s-ansible-2 ansible]# kubeadm init --config /home/ansible/kubeadm-config-new.yaml
W0414 05:52:56.598882    1454 defaults.go:186] The recommended value for "clusterDNS" in "KubeletConfiguration" is: [fd10::4:a]; the provided value is: [fd10::4:5]

and kubeadm actually does configure the recommended value:

[ansible@k8s-ansible-2 ~]$ kubectl get service kube-dns -n kube-system -o yaml | grep clusterIP
  clusterIP: fd10::4:a

The Kubelet systemd config file is the following:

[root@k8s-ansible-3 ~]# more /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/sysconfig/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
ExecStartPre=/bin/sleep 15

In my environment, I need to control which ClusterIP is assigned to which service so my questions are:

  • Is it a bug or known limitation ?. I was not able to find anything related to that specific behavior.
  • It seems kubeadm assigns the 10th address from serviceCIDR to coredns service. Could someone confirm if this is the default implementation and it is not a random address from the serviceCIDR pool ?.

Thanks for your support.

-- laaubert
coredns
kubeadm
kubernetes

0 Answers