k43D/mysqlbackup/job.yml
2024-01-27 09:43:50 +01:00

40 lines
969 B
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: mysql-backup-test
spec:
template:
spec:
containers:
- name: mysql-backup
image: mariadb:latest
command: [ "/bin/sh" ]
args: [ "-c", "sleep 3600" ]
env:
- name: MYSQL_HOST
value: galera-mariadb-galera
- name: MYSQL_USER
value: backupuser
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: backupscrets
key: backupsecret
volumeMounts:
- name: backup-volume
mountPath: /backup
- name: backup-script
mountPath: /backup-script.sh
subPath: backup-script.sh
readOnly: true
restartPolicy: OnFailure
volumes:
- name: backup-volume
persistentVolumeClaim:
claimName: nfs-mysqlbacup-claim
- name: backup-script
configMap:
name: backup-script
backoffLimit: 1