Is there a way to backup/restore/upgrade the stateless part of a Minikube cluster?

8/15/2021

I want to take a snapshot of all stateless components inside a Minikube cluster without the persistent data and then restore it in another Minikube cluster.

Is there a way to dump all kube spec + docker images and then restore it?

-- jack2684
docker-registry
kubernetes
minikube

1 Answer

8/16/2021

There is no really specific tool only for minikube cluster. Even on their Github page you can find information from August 11 2021 that they are not ready with it yet.

However, there are few solutions to backup the Kubernetes cluster in general. Maybe you will find it useful.

The first one is a tool called velero. It has pretty good and solid documentation. Here you can find a brief tutorial how to setup and run it on the Kubernetes cluster setup on minikube.

To not backup specific resources you can use resource-filtering. For example, you can setup velero not to backup persistent volumes and persistent volumes claims.

velero backup create <backup-name> --exclude-resources persistentvolumes,persistentvolumeclaims 

You can also use a tool called k8up. To get started with it you can follow tutorial from their website. The tutorial explains how to backup Kubernetes cluster setup on minkube.

To not to backup specific resources you can use k8up.syn.tools/backup annotation. This tutorial has an example with usage of this annotation (3.3.1 paragraph).

For docker images, I would recommend just setting up and using registry in the cloud, for example Docker hub or some cloud provider solution, like Google Container Registry or Amazon Elastic Container Registry. You can setup them as private so your images will be safe.

-- Mikolaj S.
Source: StackOverflow