How to Restore Cluster from ETCD Backup on New Master Nodes in Case of Loss of All Existing Master Nodes

Problem

How to restore etcd backup on new master nodes in case of loss of all existing master nodes in the cluster?

Environment

  • Platform9 Managed Kubernetes - All Versions
  • Docker or Containerd
  • ETCD

Procedure

Make sure to have access to the etcd backup file. For working cluster the default path for the backup storage path is /etc/pf9/etcd-backup. Also the worker nodes should be not affected and should be in running state.

  1. Use Force Remove in the Management Plane UI to deauthorize and remove the old master nodes from Management Plane. Note: For PMK v5.3 and below please contact Platform9 Support to Force Remove the nodes from Management Plane.
  2. Create new master nodes with the same IP address and hostname as that of the removed master nodes.
  3. Onboard the nodes to Management Plane using either the Platform9 CLI or through downloading and installing the Platform9 HostAgent manually.
  4. Once nodes comes online, first add the same active master(leader) to the cluster using below API.

Get TOKEN, PROJECT_ID by following steps mentioned in Keystone Identity. And the NODE_UUID and CLUSTER_ID can be found from the Management Plane UI by enabling UUID in columns.

API
Copy
Example
Copy
  1. Once the master node is attached, the cluster looks healthy with a single master node.
Example v1.19
Copy
Example v1.20
Copy
  1. Copy the etcd backup to the Master node and copy etcdctl binary.
Docker
Copy
  1. Stop the PMK stack and move the current etcd directory to some other path on the Master node.
Command
Copy
  1. Perform etcd DB restore from the master node.
Docker
Containerd
Copy
Example
Copy
  1. Once restore is complete, start PMK stack.
Command
Copy
  1. Check the etcd cluster health status post-restoration.
  • For cluster running pf9-kube v1.19
Docker
Copy
Sample
Copy
  • For cluster running pf9-kube v1.20
Docker
Containerd
Copy
Example
Copy
  1. Delete the stale master nodes which are in NotReady state using kubectl.
Example
Copy
  1. Scale the master nodes one by one from the Management Plane UI and verify the etcd cluster health using Step 10.

Restoring from the etcd backup is a complicated process, if not familiar with it we recommend involving Platform9 Support for any assistance before initiating the restore operation.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard