备份
备份端配置
备份到NFS
apiVersion: v1
kind: ConfigMap
metadata:
labels:
backend-storage-type: NFS
name: nfs-target
namespace: default
data:
nfs.config: '{"nfsServer":"10.6.234.2","nfsExportPath":"/nfs","nfsBackupRootDir":"/backup"}'
备份到S3
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
uds.dce.daocloud.io/backup-target-config: '{"s3ConfName":"dce-uds-backup-remote-s3","s3BackupBucket":"uds-backup"}'
name: s3-target
namespace: default
data:
rclone.conf: |-
[dce-uds-backup-remote-s3]
type = s3
provider = Minio
env_auth = false
access_key_id = Access KEY
secret_access_key = Secret KEY
endpoint = 10.7.209.49:9000
location-constraint = us-east-1
acl = private
创建自动备份policy
apiVersion: uds.dce.daocloud.io/v1alpha1
kind: BackupPolicy
metadata:
name: backup01
namespace: default
spec:
backupTargetType: S3
backupType: full
configMapName: s3-target
configMapNamespace: default
retain: 10
schedule: 0 36 14 * * 5
status:
phase: Running
PVC绑定Policy
kubectl annotate pvc <your-pvc-name> uds.dce.daocloud.io/policy-pvc='{"backupPolicies":{"backup01":null}}'