2

How do you change ip address of the master or any worker node

I have experimented with:

kubeadm init --control-plane-endpoint=cluster-endpoint --apiserver-advertise-address=<x.x.x.x>

And then I guess I need the new config with the right certificate:

sudo cp -i /etc/kubernetes/admin.conf ~/.kube/config

I tried the following suggested from Hajed.Kh:

Changed ip address in:

etcd.yaml (contained ip)
kube-apiserver.yaml (contained ip)
kube-controller-manager.yaml (not this one?
kube-scheduler.yaml (not this one?)

But I still get the same ip address in:

sudo cp -i /etc/kubernetes/admin.conf ~/.kube/config
Chris G.
  • 23,930
  • 48
  • 177
  • 302

1 Answers1

3

The apiserver-advertise-address flag is located in the api-server manifest file and all Kubernetes components manifests are located here /etc/kubernetes/manifest/.Those are realtime updated files so change and save and it will be redeployed instantally :

etcd.yaml
kube-apiserver.yaml
kube-controller-manager.yaml
kube-scheduler.yaml 

For the worker I think it will automatically update changes while the kubelet is connected to the api-server.

Hajed.Kh
  • 408
  • 3
  • 11
  • But some parameters are only configurable during cluster bootstrapping. https://stackoverflow.com/questions/65995056/kubernetes-api-server-bind-address-vs-advertise-address – LubieCiastka Oct 22 '21 at 14:29