1

Iam running the microk8s in ubuntu in no high availability i.e. there is a single node onto the same machine where it is installed. I updated the certificates and then i issue following command:

sudo microk8s leave

as it was advised that after upgrading the certificates nodes have to leave and rejoin.

It give following messages:

Generating new cluster certificates.
Waiting for node to start. 

and then i stopped microk8s and then started again, the node appeared however all of my pods / namespaces are gone, how to recover?

1 Answers1

0

I experienced the same situation and the following solution worked for me:-

  1. Check the /snap/microk8s directory - ls -lart /snap/microk8s
  2. There must be more than one directory with a numerical name like 6236 etc which is the microk8s process pid.
  3. The result of the command ls -lart /snap/microk8s must show a symlink pointing to one of these directories.
  4. Stop the microk8s instance using microk8s stop and remove the current symlink.
  5. Create a new symlink to the other directory using cd /snap/microk8s && ln -s <other-dir-name> current

This should restore the original cluster given that it's data is still available in the /snap/microk8s/common directory.

yash
  • 101