How to move Kubernetes master node from one server to another?

*爱你&永不变心* 提交于 2021-01-29 11:27:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!