[Cloud Native] Configure Kubernetes CronJob to automatically back up the Clickhouse database (stand-alone version)

[Cloud Native] Configure Kubernetes CronJob to automatically back up the MySQL database

Clickhouse

Testing and development environment: Perform a full database backup operation at 0:40 every day. The backup files are stored in the cloud product sfs volume through the StorageClass SFS storage class.
Create a pvc type resource in the db namespace:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cronjob-clickhouse-backup
  namespace: db
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 200Gi
  storageClassName: sc-dysk-efs-clickhouse      #指定storageclass

Create a cronjob type resource in the db namespace:

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

Guess you like

Origin blog.csdn.net/zhanremo3062/article/details/133378706