k43D/postgres_backup/job.yml

42 lines
997 B
YAML
Raw Normal View History

2023-09-17 09:10:08 +00:00
apiVersion: batch/v1
kind: Job
metadata:
name: mysql-backup
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
subPath: mysql
- name: backup-script
mountPath: /backup-script.sh
subPath: backup-script.sh
readOnly: true
restartPolicy: OnFailure
volumes:
- name: backup-volume
nfs:
server: 192.168.86.86
path: /volume1/backupk8s
- name: backup-script
configMap:
name: backup-script
backoffLimit: 1