-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Description
- create a simple Cluster
- create a customized BackupPolicy with env and targetVolume
- create a Backup
- create a Restore
the BackupPolicy is likely below:
......
spec:
backoffLimit: 2
backupMethods:
- actionSetName: hosted-secret
env:
- name: IMAGE_TAG
value: "2.4"
- name: FOO
value: BAR
name: hosted-secret
snapshotVolumes: false
targetVolumes:
volumeMounts:
- mountPath: /var/lib/mysql
name: data
- mountPath: /etc/hosted-secret
name: hosted-secret
......
Backup pod is properly respect env and targetVolumes.
But Restore pod does not. Restore pod's yaml is likely below.
spec:
containers:
- command:
- bash
- -c
- |
set -x
echo 'hello world'
env:
- name: DP_BACKUP_NAME
value: myvipbackup-gfs-bcmzq
- name: DP_TARGET_RELATIVE_PATH
- name: DP_BACKUP_ROOT_PATH
value: /default/mysql-cluster-d380d839-bda4-4cb1-89b4-cfe833cbe794/mysql
- name: DP_BACKUP_BASE_PATH
value: /default/mysql-cluster-d380d839-bda4-4cb1-89b4-cfe833cbe794/mysql/mybackup-bcmzq
- name: DP_BACKUP_STOP_TIME
value: "2025-03-07T12:33:20Z"
- name: DATA_DIR
value: /var/lib/mysql/data
- name: MYSQL_DIR
value: /var/lib/mysql
- name: IMAGE_TAG
value: "2.4"
- name: DATASAFED_LOCAL_BACKEND_PATH
value: /backupdata
- name: DP_DATASAFED_BIN_PATH
value: /bin/datasafed
image: docker.io/apecloud/percona-xtrabackup:8.0
imagePullPolicy: IfNotPresent
name: restore
resources:
limits:
cpu: "0"
memory: "0"
requests:
cpu: "0"
memory: "0"
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/mysql
name: dp-claim-tpl-data-vip-mysql-cluster-mysql-3
- mountPath: /backupdata
name: dp-backup-data
- mountPath: /bin/datasafed
name: dp-datasafed-bin
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-kxbdg
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
initContainers:
- command:
- /bin/sh
- -c
- /scripts/install-datasafed.sh /bin/datasafed
image: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/datasafed:0.2.0
......