I have a bare metal server that houses a master Kubernetes node. I would need to move the master node to a fresh bare metal server. How can we move or migrate it?
I've done my research but most of them are related to GCP cluster where we move 4 directories from old node to new node, and also change the IP and that question was asked 5 years ago which is outdated now.
/var/etcd
/srv/kubernetes
/srv/sshproxy
/srv/salt-overlay
Whats the proper way to move it assuming we are using the most recent k8s version of 1.17
Best Answer
Following github issue mentioned in the comments and IP address changes in Kubernetes Master Node:
1. Verify your
etcd data directory
looking intoetcd pod in kube-system namespace
:(default values using k8s v1.17.0 created with kubeadm),
2. Preparation:
/etc/kubernetes/pki
from Master1 to the new Master2:pki directory to /etc/kubernetes
3. On Master1 create etcd snapshot:
Verify your
API version
:4. Copy created snapshot from Master1 to Master2 backup directory:
5. Prepare Kubeadm config in order to reflect Master1 configuration:
6. Restore snapshot:
etcd:3.4.3-0
docker image:etcdctl
binaries:7. Initialize Master2: