【云原生】配置Kubernetes CronJob自动备份Clickhouse数据库(单机版)

【云原生】配置Kubernetes CronJob自动备份MySQL数据库

Clickhouse

测试、开发环境:每天0点40分执行全库备份操作,备份文件通过StorageClass SFS存储类存放云产品 sfs卷中
在db命名空间创建pvc类型的资源:

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类型的资源:

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

你可能感兴趣的:(云原生,云原生,kubernetes,clickhouse)