+
Skip to content

amimof/kubebck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubebck

Build Status

Kubernetes resource backup and exporter. kubbck relies on kubectl to export kubernetes resources from one or more clusters. The exported resources are stored as yaml files on the filesystem.

How to run

The easiest and best way of running kubebck is by using Docker. You need to provide a kubeconfig file to the container as well as a storage area for the exported data. We can use a volume mount for this.

docker run \
  -d --privileged \
  -v /var/lib/kubebck/data/:/kubebck \
  -v /var/lib/kubebck/config:/config \
  amimof/kubebck:latest

This example will connect to the Kubernetes clusters using the contexts defined in the provided kubeconfig file and store exported data to /var/lib/kubebck/data on the container host. After the kubebck container is finished backing up all clusters, the container will terminate and the content of the output directory will look something like this.

├── minikube
|   ├── 2019-03-21
|   |   ├── clusterrolebindings.yaml 
|   |   ├── clusterroles.yaml
        ...
|   |   ├── groups.yaml
|   |   ├── namespaces                                                             
|   |   │   ├── default
|   |   |   |   ├── configmaps.yaml
|   |   |   |   ├── deployments.yaml
|   |   |   |   ├── pods.yaml
                ...
|   |   |   |   └── statefulsets.yaml      
|   |   |   ├── kube-public
|   |   │   └── kube-system
|   |   ├── namespaces.yaml
|   |   ├── nodes.yaml
        ...
|   |   └── persistentvolumes.yaml
|   ├── 2019-04-09
     ...
├── minishift
|   ├── 2019-03-21
    ...

Options

There are a few options you may set using environment variables if the default values do not apply for you.

Name Default Description
KUBEBCK_OUTPUT_DIR /kubebck A path to the root directory in which the exported data will be stored.
KUBEBCK_OUTOUT_FORMAT yaml Output format of the exported files. Can be either yaml or json.
KUBEBCK_ARCHIVE false If set tot true, exported data will be added to a tar archive and the original exported data will be remove.

Contribute

All help in any form is highly appreciated and your are welcome participate in developing together. To contribute submit a Pull Request. If you want to provide feedback, open up a Github Issue or contact me personally.

About

Kubernetes resource backup and exporter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载