Score:0

kubeadm tool fail to initialize cluster when --advertise ip address is DNS Entry instead of actual IP address

sd flag

I'm initializing the cluster using kube-adm tool and its failing.The reason is when kube-api server comes up , it looks for configuration and in configuration we have set "--advertise-address" flag as DNS entry instead of actual IP.

Cluster gets initilized when we change this to IP address but use case is that we need to have DNS entry there. Any way out?

ubuntu@ac1poc-20210407164708-dbvault-master1:~$ sudo docker ps -a
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                     PORTS               NAMES
6dadb094ef45        4d217480042e             "kube-apiserver --ad…"   8 seconds ago       Exited (1) 7 seconds ago                       k8s_kube-apiserver_kube-apiserver-ac1poc-20210407164708-dbvault-master1_kube-system_d178ca26dd6ecb571ee1d795bf05d13c_0
9800cd1306ca        k8s.gcr.io/pause:3.4.1   "/pause"                 8 seconds ago       Up 7 seconds                                   k8s_POD_kube-apiserver-ac1poc-20210407164708-dbvault-master1_kube-system_d178ca26dd6ecb571ee1d795bf05d13c_0
447ca3b7c4e5        0369cf4303ff             "etcd --advertise-cl…"   18 seconds ago      Up 17 seconds                                  k8s_etcd_etcd-ac1poc-20210407164708-dbvault-master1_kube-system_aeecb86186a97a57d7b33389c398d994_0
f10dee583a73        k8s.gcr.io/pause:3.4.1   "/pause"                 18 seconds ago      Up 17 seconds                                  k8s_POD_etcd-ac1poc-20210407164708-dbvault-master1_kube-system_aeecb86186a97a57d7b33389c398d994_0
ff24fb98ffc4        62ad3129eca8             "kube-scheduler --au…"   28 seconds ago      Up 27 seconds                                  k8s_kube-scheduler_kube-scheduler-ac1poc-20210407164708-dbvault-master1_kube-system_043da16f3c9ebc5b6dc6a04761c2f844_0
3fb783c0d8c7        k8s.gcr.io/pause:3.4.1   "/pause"                 28 seconds ago      Up 27 seconds                                  k8s_POD_kube-scheduler-ac1poc-20210407164708-dbvault-master1_kube-system_043da16f3c9ebc5b6dc6a04761c2f844_0
ubuntu@ac1poc-20210407164708-dbvault-master1:~$ sudo docker logs 6dadb094ef45
Error: invalid argument "ac1poc-20210407164708-kube-api-f5082ea18c7584ad.elb.us-east-1.amazonaws.com" for "--advertise-address" flag: failed to parse IP: "ac1poc-20210407164708-kube-api-f5082ea18c7584ad.elb.us-east-1.amazonaws.com"
Score:0
us flag

It is not possible to use DNS address in --apiserver-advertise-address.
Official documentation states:

The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.

At one point it seemed like such functionality would be added[apiserver #33][kubernetes #59288], but it was ultimately scrapped, and PR #56956 was merged to ensure only IPv4 and IPv6 can be used.


The workaround would be to use ControlPlaneEndpoint, but API server will not start if IP changes, so it's suboptimal solution.

Jatinder Singh avatar
sd flag
Thanks for detailed explanation
p10l avatar
us flag
Hi @JatinderSingh, I'm glad I could help. Please consider [accepting](https://serverfault.com/help/someone-answers) an answer, and maybe upvoting it, so this question won't stay as unanswered.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.