0

I need to change the advertise address of my Kubernetes master node.

I can do this with a kubeadm reset, but I don't want to lose my (rook-ceph) persistent volumes on the master node.

Is it safe to do a kubeadm reset or do I need to backup my PVs first?

Is there another safe way to change the advertise address?

1

To not lose the data you need to backup PV and then execute kubeadm reset command.

kubeadm reset is responsible for cleaning up a node local file system from files that were created using the kubeadm init or kubeadm join commands. For control-plane nodes reset also removes the local stacked etcd member of this node from the etcd cluster and also removes this node's information from the kubeadm ClusterStatus object. ClusterStatus is a kubeadm managed Kubernetes API object that holds a list of kube-apiserver endpoints.

kubeadm reset phase can be used to execute the separate phases of the above workflow. To skip a list of phases you can use the --skip-phases flag, which works in a similar way to the kubeadm join and kubeadm init phase runners.

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.

Take a look: kubeadm-reset.

While normal usage of cluster to not lose the PV make sure that it has Retain Reclaim Policy. Otherwise execute kubectl patch pv <your-pv-name> -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}". PVs then will not be automatically deleted when a user deletes claim.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.