问题
I have Kubernetes cluster with two nodes. One's role is Master.
I want to move master node to another physical server.
The possible way I see is to add another node and change its role to master.
How can I do that? Is there any kind of instructions? Is this the only way?
回答1:
Might be a duplicate of Migration of Kubernetes Master
In fact, you just need to
- clone data from the disk
- change identity of the new server (IP address/DNS name)
Update
If you want to change master IP address in kubeadm config, check following references:
- replacing the IP address in all config files in /etc/kubernetes
- backing up /etc/kubernetes/pki
- identifying certs in /etc/kubernetes/pki that have the old IP address as an alt name
- deleting both the cert and key for each of them (for me it was just apiserver and etcd/peer)
- regenerating the certs using kubeadm alpha phase certs2
- identifying configmap in the kube-system namespace that referenced the old IP
- manually editing those configmaps restarting kubelet and docker (to force all containers to be recreated)
Or take a look at this step-by-step instruction
来源:https://stackoverflow.com/questions/57163698/how-to-move-kubernetes-master-node-from-one-server-to-another