Is it possible to get a full configuration from a namespace

11/2/2019

I am looking for keeping some kind of baseline for everything applied to kubernetes(or just a namespace).

Like versioning microservices in a list and then check that in to github, in case of the need to roll something back.

-- Chris G.
kubernetes

2 Answers

11/2/2019

You can write and deploy an application that Watch the resources you are interested in, e.g. all Deployment, Service and Ingress... including all changes, and then store the changes as you want. I can recommend client-go for this kind of service.

However

Like versioning microservices in a list and then check that in to github, in case of the need to roll something back.

It is more common, and recommended to work the other way around, first save your intended desired state in Git, have an CICD service to apply your changes in the cluster or clusters. This way of working is called Infrastructure as Code. The new edition of the book Kubernetes Up&Running have a new chapter (18) that describes how to work in this way.

-- Jonas
Source: StackOverflow

11/2/2019

Check out Velero, it is a backup tool for kubernetes. I don’t think it can use git as a backend, but you could add that (or use s3 or similar).

-- coderanger
Source: StackOverflow