【云原生】配置Kubernetes CronJob自动备份MySQL数据库
Clickhouse
测试、开发环境:每天0点40分执行全库备份操作,备份文件通过StorageClass SFS存储类存放云产品 sfs卷中
在db命名空间创建pvc类型的资源:文章来源:https://uudwc.com/A/AAXoO
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cronjob-clickhouse-backup
namespace: db
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 200Gi
storageClassName: sc-dysk-efs-clickhouse #指定storageclass
在db命名空间创建cronjob类型的资源:文章来源地址https://uudwc.com/A/AAXoO
apiVersion: batch/v1
kind: CronJob
metadata:
name: db-clickhouse-backup
namespace: db
spec:
concurrencyPolicy: Allow
failedJobsHistoryLimit: 3
jobTemplate:
metadata:
creationTimestamp: null
namespace: db
spec:
backoffLimi