-
-
Save thikade/c9c3094760314869c8e5797ff9ceeb42 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 | |
spec: | |
schedule: "0 0 * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: etcd-backup | |
#image: quay.io/danclark/etcd-backup:latest | |
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