0

I built kubernetes cluster using kubeadm init, on bare-metal server. I have master node - it's pretty simple one-node cluster, I just have to test something. But now I have to change the interface on which kubernetes is listening on (with this option: --api-advertise-addresses, it is using during kubeadm init). So my question is how to rebuild this cluster in order to change this IP, or how to delete cluster in order to build it once again?

Skyeee
  • 69
  • 1
  • 7
  • Hello, as you've told about the cluster deletion to build it once again, you could try to run ` `$ kubeadm reset` on each machine. You can find more about it here: https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-reset/ . Have you tried like that? – Dawid Kruk Mar 04 '21 at 16:05
  • Yeah, I did it, it turned out that kubeadm reset is the easiest option – Skyeee Mar 05 '21 at 20:08

1 Answers1

0

Posting this answer as a community wiki as one of the possible solutions/workarounds was posted in the comments. Feel free to expand it.

The easiest solution/workaround to change the interface which Kubernetes created with kubeadm is listening on is with:

  • $ kubeadm reset

Performs a best effort revert of changes made to this host by kubeadm init or kubeadm join

The "reset" command executes the following phases:

  • preflight Run reset pre-flight checks
  • update-cluster-status Remove this node from the ClusterStatus object.
  • remove-etcd-member Remove a local etcd member.
  • cleanup-node Run cleanup node.

Kubernetes.io: Docs: Reference: Setup tools: kubeadm: kubeadm reset

After the reset is complete you can run your $ kubeadm init PARAMETERS with following parameter:

  • --apiserver-advertise-address string

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

You will need include the IP address of your secondary (desired) interface that your API server will be listening on (for example: --apiserver-advertise-address 10.0.0.10) .


Additional resources:

Dawid Kruk
  • 8,982
  • 2
  • 22
  • 45