github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/apecloud-mysql/templates/actionset.yaml (about)

     1  apiVersion: dataprotection.kubeblocks.io/v1alpha1
     2  kind: ActionSet
     3  metadata:
     4    name: xtrabackup-for-apecloud-mysql
     5    labels:
     6      clusterdefinition.kubeblocks.io/name: apecloud-mysql
     7  spec:
     8    backupType: Full
     9    env:
    10      - name: DATA_DIR
    11        value: {{ .Values.mysqlConfigs.dataDir }}
    12      - name: LOG_BIN
    13        value: {{ .Values.mysqlConfigs.logBin }}
    14      - name: DP_DB_PORT
    15        value: "3306"
    16      - name: DATA_MOUNT_DIR
    17        value: {{ .Values.mysqlConfigs.dataMountPath }}
    18      - name: SIGNAL_FILE
    19        value: .xtrabackup_restore_new_cluster
    20    backup:
    21      preBackup: []
    22      postBackup: []
    23      backupData:
    24        image: {{ include "apecloud-mysql.bakcupToolImage" . }}
    25        runOnTargetPodNode: true
    26        command:
    27        - sh
    28        - -c
    29        - |
    30          {{- .Files.Get "dataprotection/backup.sh" | nindent 8 }}
    31        syncProgress:
    32          enabled: true
    33          intervalSeconds: 5
    34    restore:
    35      prepareData:
    36        image: {{ include "apecloud-mysql.bakcupToolImage" . }}
    37        command:
    38        - sh
    39        - -c
    40        - |
    41          {{- .Files.Get "dataprotection/restore.sh" | nindent 8 }}
    42      postReady: []
    43  ---
    44  apiVersion: dataprotection.kubeblocks.io/v1alpha1
    45  kind: ActionSet
    46  metadata:
    47    name: volumesnapshot-for-apecloud-mysql
    48    labels:
    49      clusterdefinition.kubeblocks.io/name: apecloud-mysql
    50  spec:
    51    backupType: Full
    52    env:
    53    - name: DATA_DIR
    54      value: {{ .Values.mysqlConfigs.dataDir }}
    55    - name: DATA_MOUNT_DIR
    56      value: {{ .Values.mysqlConfigs.dataMountPath }}
    57    - name: SIGNAL_FILE
    58      value: .restore_new_cluster
    59    backup: {}
    60    restore:
    61      prepareData:
    62        image: {{ include "apecloud-mysql.bakcupToolImage" . }}
    63        command:
    64        - sh
    65        - -c
    66        - |
    67          touch ${DATA_DIR}/${SIGNAL_FILE};
    68          # compatible with binlog of 0.6/0.5
    69          binlog_dir=${DATA_MOUNT_DIR}/binlog
    70          mkdir $binlog_dir
    71          cp ${DATA_DIR}/mysql-bin.* ${binlog_dir}
    72          sync
    73      postReady: []