Yes, your container infrastructure needs some type of backup. Kubernetes and Docker will not magically build themselves after a disaster. As discussed in a separate article, you don’t need to back up the running state of each container, but you will need to back up the configuration used to run and manage your containers.
Here’s a quick reminder of what you’ll need to back up.
Configuration and desired-state information
- The Dockerfiles used to build your images and all versions of those files
- The images created from the Dockerfile and used to run each container
- Kubernetes etcd & other - K8s databases that info on cluster state
- Deployments - YAML files describing each deployment
Persistent data created or changed by containers
- Persistent volumes
Docker containers are run from images, and images are built from Dockerfiles. A proper Docker configuration would first use some kind of repository such as GitHub as a version-control system for all Dockerfiles. Do not create ad hoc containers using ad hoc images built from ad hoc Dockerfiles. All Dockerfiles should be stored in a repository that allows you to pull historical versions of that Dockerfile should there be a problem with the current build.
Thanks to W. Curtis Preston (see source)