kubernetes/kubeadm

how to create kubeadm init with only hostname/DNS name so if we dont have to worry to change ip later

YZPAWE opened this issue · 2 comments

There is a requirement to use hostname to create the k8s cluster so that you don't need to worry about not being able to connect to the k8s cluster after the ip change

I tried to use hostname to configure kubeadm init, but it got an error

image

k8s api server does not allow dns names and only allowes ips. in general if you want to setup your k8s control plane nodes they must use fixed ips. changing the ips is very difficult and unsupported by k8s components without manual interactions.

you can however ensure worker nodes always connect to the control plane by using a dns name and a load balancer.

see
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#considerations-about-apiserver-advertise-address-and-controlplaneendpoint
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/ha-topology/
https://github.com/kubernetes/kubeadm/blob/main/docs/ha-considerations.md

/kind support

k8s api server does not allow dns names and only allowes ips. in general if you want to setup your k8s control plane nodes they must use fixed ips. changing the ips is very difficult and unsupported by k8s components without manual interactions.

you can however ensure worker nodes always connect to the control plane by using a dns name and a load balancer.

see https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#considerations-about-apiserver-advertise-address-and-controlplaneendpoint https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/ha-topology/ https://github.com/kubernetes/kubeadm/blob/main/docs/ha-considerations.md

/kind support

thanks your reply