How to get all Kubernetes Objects details

8/15/2019

I am implementing a snapshot solution for my K8s cluster. I already have a way of getting a consistent snapshot of all the services (persistent volumes) that are running. So I don't need to snapshot persistent volumes for that matter. But I am looking for a way to get all K8s config at the time of taking the snapshot. What would be the best way to get all K8s config details including all yamls of services, configmaps, secrets?

I read about Velero, but Velero is more of a disaster recovery solution. I would like to take a snapshot of the cluster when the cluster is still running. Can Velero be used to just get the above mentioned config from K8s.

The interesting part is that this snapshot solution that I have is again going to be a service running on Kubernetes. So that means, I am looking for a solution that works from within a pod. Any help is greatly appeciated

-- UnderWood
backup
disaster-recovery
kubernetes
microservices
snapshot

2 Answers

8/15/2019

Yes, Valero can be used to get the only the required object from k8s.

I strongly suggest checking this video.

-- FL3SH
Source: StackOverflow

8/19/2019

Kubed is also very interesting solution, which allows you to protect your Kubernetes cluster by taking snapshots of it or even keep ConfigMaps and Secrets synchronized across Namespaces. Kubed uses Kubernetes discovery api to find all available resources in a cluster and stores them in a file matching the selfLink URL for an object.

Here you can find installation guide and also what you have asked, Kubed works within pods.

-- muscat
Source: StackOverflow