Kubernetes scheduled service for PVC EBS backed snapshots
1.4K
After being seeded with a variable namespace and app name (set as environment variables), this script will navigate through the Kubernetes api, and locate any underlying Persistent Volumes and create a snapshot of each of these volumes.
Presently, only AWS is supported.
~/.aws/credentials and ~/.kube/config respectively.config and credentials file to /root/.aws For this, a secret will have to already of been created. One method of creating this secret would be via Kubectl:kubectl create secret --namespace=dev generic aws-key-secret --from-file=config=$HOME/.aws/config --from-file=credentials=$HOME/.aws/credentials
$HOME/.aws/ & $HOME/.kube/ store the appropriate credentials to your environment.export $K8_NAMESPACE=<<your namespace>>export $K8_APP_NAME=<<the application name>>pip install -r ./requirements.txtpython -m kubernetes-pvc-snapshotdocker run -e K8_NAMESPACE="your-namespace" -e K8_APP_NAME="your-app-name" -v $HOME/.kube:/root/.kube/ -v $HOME/.aws:/root/.aws boysherman/kubernetes-snapshots
helm package kubernetes-pvc-snapshothelm install kubernetes-pvc-snapshotTo create a standard Kubernetes 'job':
K8_NAMESPACE & K8_APP_NAME in ./templates/k8/kubernetes-volume-snapshot.ymlkubectl --namespace dev create -f ./templates/k8/job--cassandra-backup.yml
Content type
Image
Digest
Size
211 MB
Last updated
about 9 years ago
docker pull osodevops/kubernetes-volume-snapshots