-
-
Save davoult/9aefaa3e2a165aaced5fed58bf76309f to your computer and use it in GitHub Desktop.
OpenShift Cron job to backup etcd database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: etcd-backup | |
namespace: openshift-etcd | |
spec: | |
schedule: '@daily' | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: etcd-backup | |
image: registry.redhat.io/rhel7/rhel-tools:latest | |
imagePullPolicy: Always | |
args: | |
- /bin/sh | |
- '-c' | |
- chroot /host /usr/local/bin/cluster-backup.sh /home/core/assets/backup | |
securityContext: | |
privileged: true | |
runAsUser: 0 | |
volumeMounts: | |
- mountPath: /host | |
name: host | |
restartPolicy: OnFailure | |
dnsPolicy: ClusterFirst | |
enableServiceLinks: true | |
hostNetwork: true | |
hostPID: true | |
securityContext: {} | |
serviceAccount: default | |
serviceAccountName: default | |
tolerations: | |
- operator: Exists | |
nodeSelector: | |
node-role.kubernetes.io/master: '' | |
volumes: | |
- hostPath: | |
path: / | |
type: Directory | |
name: host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment