1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- apiVersion: batch/v1
- kind: CronJob
- metadata:
- name: mariadb-backup
- spec:
- schedule: "@daily"
- jobTemplate:
- spec:
- template:
- spec:
- affinity:
- nodeAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- nodeSelectorTerms:
- - matchExpressions:
- - key: "kubernetes.io/arch"
- operator: In
- values:
- - amd64
- containers:
- - name: mariadb-backup
- image: qdii/mysql-ssh:latest
- env:
- - name: SQL_USERNAME
- value: "root"
- - name: SQL_HOSTNAME
- value: "mariadb.mariadb"
- - name: SQL_PASSWORD
- valueFrom:
- secretKeyRef:
- name: mariadb-root
- key: mariadb-root
- - name: BCK_USERNAME
- value: "uab10c1ba4bc"
- - name: BCK_HOSTNAME
- value: "bck.dodges.it"
- - name: BCK_FOLDER
- value: "/home/uab10c1ba4bc/data/vol0/mariadb"
- volumeMounts:
- - name: mariadb-config
- mountPath: "/root/backup.sh"
- subPath: backup.sh
- readOnly: true
- - name: backup
- mountPath: "/root/.ssh/id_rsa"
- subPath: ssh_private_key
- readOnly: true
- - name: backup
- mountPath: "/root/.ssh/id_rsa.pub"
- subPath: ssh_public_key
- readOnly: true
- command: ["/root/backup.sh"]
- restartPolicy: Never
- volumes:
- - name: mariadb-config
- configMap:
- name: mariadb
- defaultMode: 0500
- - name: backup
- secret:
- secretName: backup
- defaultMode: 0400
|