- A 🐳 Docker image used to backup database to minio file system
HOST: hostname of minio server BUCKET: minio bucket name
create the service account:
echo '{"apiVersion":"v1","kind":"ServiceAccount","metadata":{"name":"openshift-minio-backup"}}' | oc create -f -
Add the permission:
oc policy add-cluster-role-to-user backup-to-minio system:serviceaccount:`oc project -q`:openshift-minio-backup
Get the API Token associated with the service account:
SA_TOKEN=$(oc get sa/openshift-minio-backup --template='{{range .secrets}}{{printf "%s\n" .name}}{{end}}' | grep openshift-minio-backup-token | tail -n 1)
API_TOKEN=$(oc get secrets ${SA_TOKEN} --template '{{.data.token}}' | base64 -d)
Echo the value for the configuration file or environment variable:
echo $API_TOKEN
- Build the image using docker
$ docker build -t openshift-minio-backup .
File issues in GitHub to report bugs or issue a pull request to contribute.
Dockerfile based on https://github.com/e-bits/openshift-client work