diff --git a/addons/apecloud-mysql/templates/backuppolicytemplate.yaml b/addons/apecloud-mysql/templates/backuppolicytemplate.yaml index 7a8f4d652..ea95f8dcc 100644 --- a/addons/apecloud-mysql/templates/backuppolicytemplate.yaml +++ b/addons/apecloud-mysql/templates/backuppolicytemplate.yaml @@ -1,22 +1,18 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: {{ include "apecloud-mysql.backupPolicyTemplateName" . }} labels: - clusterdefinition.kubeblocks.io/name: apecloud-mysql - service-kind/mysql: "true" {{- include "apecloud-mysql.labels" . | nindent 4 }} - annotations: - dataprotection.kubeblocks.io/is-default-policy-template: "true" spec: - backupPolicies: - - componentDefs: - - {{ include "apecloud-mysql.componentDefName" . }} - target: - role: follower - fallbackRole: leader - account: root - backupMethods: + serviceKind: ApeCloudMySQL + compDefs: + - {{ include "apecloud-mysql.componentDefName" . }} + target: + role: follower + fallbackRole: leader + account: root + backupMethods: - name: xtrabackup snapshotVolumes: false actionSetName: {{ include "apecloud-mysql.xtrabackupActionSetName" . }} @@ -33,7 +29,7 @@ spec: volumeMounts: - name: data mountPath: {{ .Values.mysqlConfigs.dataMountPath }} - schedules: + schedules: - backupMethod: xtrabackup enabled: false cronExpression: "0 18 * * *" diff --git a/addons/apecloud-mysql/templates/backuppolicytemplateforhscale.yaml b/addons/apecloud-mysql/templates/backuppolicytemplateforhscale.yaml index 4c37313ef..77fc02bfd 100644 --- a/addons/apecloud-mysql/templates/backuppolicytemplateforhscale.yaml +++ b/addons/apecloud-mysql/templates/backuppolicytemplateforhscale.yaml @@ -1,21 +1,18 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: {{ include "apecloud-mysql.hscaleBackupPolicyTemplateName" . }} labels: - clusterdefinition.kubeblocks.io/name: apecloud-mysql - service-kind/mysql: "true" {{- include "apecloud-mysql.labels" . | nindent 4 }} spec: - identifier: hscale - backupPolicies: - - componentDefs: - - {{ include "apecloud-mysql.componentDefName" . }} - target: - role: follower - fallbackRole: leader - account: root - backupMethods: + serviceKind: ApeCloudMySQL + compDefs: + - {{ include "apecloud-mysql.componentDefName" . }} + target: + role: follower + fallbackRole: leader + account: root + backupMethods: - name: volume-snapshot snapshotVolumes: true actionSetName: {{ include "apecloud-mysql.vsActionSetName" . }} diff --git a/addons/elasticsearch/templates/backuppolicytemplate.yaml b/addons/elasticsearch/templates/backuppolicytemplate.yaml index e7768b135..ea1f32e2f 100644 --- a/addons/elasticsearch/templates/backuppolicytemplate.yaml +++ b/addons/elasticsearch/templates/backuppolicytemplate.yaml @@ -1,15 +1,14 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: elasticsearch-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: elasticsearch {{- include "elasticsearch.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: + serviceKind: Elasticsearch + compDefs: - elasticsearch - backupMethods: + backupMethods: - name: full-backup target: role: "" @@ -26,7 +25,7 @@ spec: volumeMounts: - name: data mountPath: /usr/share/elasticsearch/data - schedules: + schedules: - backupMethod: full-backup enabled: false cronExpression: "0 18 * * *" diff --git a/addons/etcd/templates/backuppolicytemplate.yaml b/addons/etcd/templates/backuppolicytemplate.yaml index 535c52ae4..4edc6b296 100644 --- a/addons/etcd/templates/backuppolicytemplate.yaml +++ b/addons/etcd/templates/backuppolicytemplate.yaml @@ -1,31 +1,30 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: etcd-backup-policy-template labels: {{- include "etcd.labels" . | nindent 4 }} - clusterdefinition.kubeblocks.io/name: etcd spec: - backupPolicies: - - componentDefs: - - etcd - target: - role: leader - backupMethods: - - name: {{ include "etcd.backupActionSetName" .}} - snapshotVolumes: false - actionSetName: {{ include "etcd.backupActionSetName" .}} - targetVolumes: - volumes: - - tls - - data - volumeMounts: - - name: tls - mountPath: {{ .Values.tlsMountPath }} - - name: data - mountPath: {{ .Values.dataMountPath }} - schedules: - - backupMethod: {{ include "etcd.backupActionSetName" .}} - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + serviceKind: ETCD + compDefs: + - etcd + target: + role: leader + backupMethods: + - name: {{ include "etcd.backupActionSetName" .}} + snapshotVolumes: false + actionSetName: {{ include "etcd.backupActionSetName" .}} + targetVolumes: + volumes: + - tls + - data + volumeMounts: + - name: tls + mountPath: {{ .Values.tlsMountPath }} + - name: data + mountPath: {{ .Values.dataMountPath }} + schedules: + - backupMethod: {{ include "etcd.backupActionSetName" .}} + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/mariadb/templates/actionset.yaml b/addons/mariadb/templates/actionset.yaml index 5e802c561..326bb4266 100644 --- a/addons/mariadb/templates/actionset.yaml +++ b/addons/mariadb/templates/actionset.yaml @@ -3,8 +3,6 @@ kind: ActionSet metadata: name: mariadb-physical-backup labels: - clusterdefinition.kubeblocks.io/name: mariadb - dataprotection.kubeblocks.io/is-default-policy-template: "true" {{- include "mariadb.labels" . | nindent 4 }} spec: env: diff --git a/addons/mariadb/templates/backuppolicytemplate.yaml b/addons/mariadb/templates/backuppolicytemplate.yaml index 8bdf3549e..5427b7d5e 100644 --- a/addons/mariadb/templates/backuppolicytemplate.yaml +++ b/addons/mariadb/templates/backuppolicytemplate.yaml @@ -1,23 +1,22 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: mariadb-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: mariadb {{- include "mariadb.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: - - mariadb-{{ .Chart.Version }} - backupMethods: - - name: mariadb-backup - snapshotVolumes: false - actionSetName: mariadb-physical-backup - targetVolumes: - volumeMounts: - - name: data - mountPath: /var/lib/mysql - schedules: - - backupMethod: mariadb-backup - enabled: false - cronExpression: "0 18 * * *" \ No newline at end of file + serviceKind: Mariadb + compDefs: + - mariadb + backupMethods: + - name: mariadb-backup + snapshotVolumes: false + actionSetName: mariadb-physical-backup + targetVolumes: + volumeMounts: + - name: data + mountPath: /var/lib/mysql + schedules: + - backupMethod: mariadb-backup + enabled: false + cronExpression: "0 18 * * *" \ No newline at end of file diff --git a/addons/milvus/templates/backuppolicytemplate.yaml b/addons/milvus/templates/backuppolicytemplate.yaml index 47ff60054..c56f1965d 100644 --- a/addons/milvus/templates/backuppolicytemplate.yaml +++ b/addons/milvus/templates/backuppolicytemplate.yaml @@ -1,22 +1,21 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: milvus-{{ .Chart.Version }} labels: - clusterdefinition.kubeblocks.io/name: milvus-{{ .Chart.Version }} {{- include "milvus.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: - - milvus-standalone - backupMethods: - - name: volume-snapshot - snapshotVolumes: true - targetVolumes: - volumes: - - data - schedules: - - backupMethod: volume-snapshot - enabled: false - retentionPeriod: 7d - cronExpression: "0 18 * * 0" \ No newline at end of file + serviceKind: Milvus + compDefs: + - milvus-standalone + backupMethods: + - name: volume-snapshot + snapshotVolumes: true + targetVolumes: + volumes: + - data + schedules: + - backupMethod: volume-snapshot + enabled: false + retentionPeriod: 7d + cronExpression: "0 18 * * 0" \ No newline at end of file diff --git a/addons/mogdb/templates/backuppolicytemplate.yaml b/addons/mogdb/templates/backuppolicytemplate.yaml index e57e05761..bb56a50d6 100644 --- a/addons/mogdb/templates/backuppolicytemplate.yaml +++ b/addons/mogdb/templates/backuppolicytemplate.yaml @@ -1,26 +1,27 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: mogdb-backup-policy-template labels: {{- include "mogdb.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: [mogdb-5] - target: - role: secondary - fallbackRole: primary - account: root - backupMethods: + serviceKind: MogDB + compDefs: [mogdb-5] + target: + role: secondary + fallbackRole: primary + account: root + backupMethods: - name: mogdb-basebackup actionSetName: mogdb-basebackup snapshotVolumes: false - envMapping: - - key: IMAGE_TAG + env: + - name: IMAGE_TAG valueFrom: - componentDef: - - names: [mogdb-5] - mappingValue: "5.0.5" + versionMapping: + - serviceVersions: + - "5" + mappedValue: "5.0.5" targetVolumes: volumeMounts: - name: data @@ -35,7 +36,7 @@ spec: mountPath: {{ .Values.dataMountPath }} volumes: - data - schedules: + schedules: - backupMethod: mogdb-basebackup enabled: false cronExpression: "0 18 * * *" diff --git a/addons/mongodb/templates/backuppolicytemplate.yaml b/addons/mongodb/templates/backuppolicytemplate.yaml index 415c6a1b2..7107d5931 100644 --- a/addons/mongodb/templates/backuppolicytemplate.yaml +++ b/addons/mongodb/templates/backuppolicytemplate.yaml @@ -1,48 +1,46 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: mongodb-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: mongodb - service-kind/mongodb: "true" {{- include "mongodb.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: [mongodb] - target: - role: secondary - fallbackRole: primary - account: root - backupMethods: - - name: dump - snapshotVolumes: false - actionSetName: mongodb-dump - - name: datafile - snapshotVolumes: false - actionSetName: mongodb-physical-backup - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: volume-snapshot - snapshotVolumes: true - actionSetName: mongodb-volumesnapshot - targetVolumes: - volumes: - - data - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - schedules: - - backupMethod: dump - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - backupMethod: datafile - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - backupMethod: volume-snapshot - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d \ No newline at end of file + serviceKind: MongoDB + compDefs: [mongodb] + target: + role: secondary + fallbackRole: primary + account: root + backupMethods: + - name: dump + snapshotVolumes: false + actionSetName: mongodb-dump + - name: datafile + snapshotVolumes: false + actionSetName: mongodb-physical-backup + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: volume-snapshot + snapshotVolumes: true + actionSetName: mongodb-volumesnapshot + targetVolumes: + volumes: + - data + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + schedules: + - backupMethod: dump + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d + - backupMethod: datafile + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d + - backupMethod: volume-snapshot + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/mysql/templates/backuppolicytemplate.yaml b/addons/mysql/templates/backuppolicytemplate.yaml index ff25da9d4..e9425e7f4 100644 --- a/addons/mysql/templates/backuppolicytemplate.yaml +++ b/addons/mysql/templates/backuppolicytemplate.yaml @@ -1,54 +1,54 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: mysql-backup-policy-template labels: {{- include "mysql.labels" . | nindent 4 }} - service-kind/mysql: "true" - annotations: - dataprotection.kubeblocks.io/is-default-policy-template: "true" spec: - backupPolicies: - - componentDefs: [mysql-5.7.44-orc, mysql-5.7.44, mysql-8.0.33-orc, mysql-8.0.33, mysql-8.4.2] + serviceKind: MySQL + compDefs: [^mysql-\d+.*$] + target: + role: secondary + fallbackRole: primary + account: root + backupMethods: + - name: xtrabackup + snapshotVolumes: false + actionSetName: mysql-xtrabackup + env: + - name: IMAGE_TAG + valueFrom: + versionMapping: + - serviceVersions: + - "8.4" + mappedValue: "8.4.0-1" + - serviceVersions: + - "8.0" + mappedValue: "8.0.33-28" + - serviceVersions: + - "5.7" + mappedValue: "2.4" + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: volume-snapshot + snapshotVolumes: true + actionSetName: mysql-volumesnapshot target: - role: secondary - fallbackRole: primary - account: root - backupMethods: - - name: xtrabackup - snapshotVolumes: false - actionSetName: mysql-xtrabackup - envMapping: - - key: IMAGE_TAG - valueFrom: - componentDef: - - names: [mysql-8.4.2] - mappingValue: "8.4.0-1" - - names: [mysql-8.0.33, mysql-8.0.33-orc ] - mappingValue: "8.0.33-28" - - names: [ mysql-5.7.44, mysql-5.7.44-orc] - mappingValue: "2.4" - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: volume-snapshot - snapshotVolumes: true - actionSetName: mysql-volumesnapshot - target: - role: primary - targetVolumes: - volumes: - - data - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - schedules: - - backupMethod: xtrabackup - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d - - backupMethod: volume-snapshot - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + role: primary + targetVolumes: + volumes: + - data + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + schedules: + - backupMethod: xtrabackup + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d + - backupMethod: volume-snapshot + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/mysql/templates/backuppolicytemplateforhscale.yaml b/addons/mysql/templates/backuppolicytemplateforhscale.yaml index 6b8ed17e0..1eb50f158 100644 --- a/addons/mysql/templates/backuppolicytemplateforhscale.yaml +++ b/addons/mysql/templates/backuppolicytemplateforhscale.yaml @@ -1,34 +1,35 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: mysql-hscale-backup-policy-template labels: {{- include "mysql.labels" . | nindent 4 }} - service-kind/mysql: "true" spec: - identifier: hscale - backupPolicies: - - componentDefs: [mysql-5.7.44-orc, mysql-5.7.44, mysql-8.0.33-orc, mysql-8.0.33] - target: - role: secondary - fallbackRole: primary - backupMethods: + serviceKind: MySQL + compDefs: [^mysql-\d+.*$] + target: + role: secondary + fallbackRole: primary + backupMethods: - name: xtrabackup snapshotVolumes: false actionSetName: mysql-xtrabackup - envMapping: - - key: IMAGE_TAG + env: + - name: IMAGE_TAG valueFrom: - componentDef: - - names: [ mysql-8.0.33, mysql-8.0.33-orc ] - mappingValue: "8.0.33-28" - - names: [ mysql-5.7.44, mysql-5.7.44-orc] - mappingValue: "2.4" - - key: BACKUP_FOR_STANDBY + versionMapping: + - serviceVersions: + - "8.4" + mappedValue: "8.4.0-1" + - serviceVersions: [ "8.0" ] + mappedValue: "8.0.33-28" + - serviceVersions: [ "5.7" ] + mappedValue: "2.4" + - name: BACKUP_FOR_STANDBY valueFrom: - componentDef: - - names: [ mysql-5.7.44, mysql-5.7.44-orc] - mappingValue: "true" + versionMapping: + - serviceVersions: [ "5.7" ] + mappedValue: "true" targetVolumes: volumeMounts: - name: data diff --git a/addons/oceanbase-ce/templates/backuppolicytemplate.yaml b/addons/oceanbase-ce/templates/backuppolicytemplate.yaml index 99f0f31ee..4c673a1ce 100644 --- a/addons/oceanbase-ce/templates/backuppolicytemplate.yaml +++ b/addons/oceanbase-ce/templates/backuppolicytemplate.yaml @@ -1,32 +1,22 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: - name: {{ printf "%s-backup-policy-template" (include "oceanbase-release.name" .) }} - labels: - clusterdefinition.kubeblocks.io/name: {{ include "oceanbase-release.name" . }} - service-kind/oceanbase: "true" - annotations: - dataprotection.kubeblocks.io/is-default-policy-template: "true" + name: {{ printf "%s-backup-policy-template" (include "oceanbase-release.name" .) }}\ spec: - backupPolicies: - - componentDefs: + serviceKind: Oceanbase + compDefs: - {{ include "oceanbase-release.name" . }} - backoffLimit: 0 - backupMethods: &backupMethods - - name: full - snapshotVolumes: false - actionSetName: {{ printf "%s-physical-backup" (include "oceanbase-release.name" .) }} - targetVolumes: - volumeMounts: - - name: workdir - mountPath: /home/admin/workdir - schedules: &backupschedules - - backupMethod: full - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - componentDefs: - - {{ printf "%s-repl" (include "oceanbase-release.name" .) }} - backoffLimit: 0 - backupMethods: *backupMethods - schedules: *backupschedules \ No newline at end of file + backoffLimit: 0 + backupMethods: + - name: full + snapshotVolumes: false + actionSetName: {{ printf "%s-physical-backup" (include "oceanbase-release.name" .) }} + targetVolumes: + volumeMounts: + - name: workdir + mountPath: /home/admin/workdir + schedules: + - backupMethod: full + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/postgresql/templates/backuppolicytemplate.yaml b/addons/postgresql/templates/backuppolicytemplate.yaml index 6dc7d0300..312f4cf89 100644 --- a/addons/postgresql/templates/backuppolicytemplate.yaml +++ b/addons/postgresql/templates/backuppolicytemplate.yaml @@ -1,10 +1,8 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: postgresql-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: postgresql - service-kind/postgresql: "true" {{- include "postgresql.labels" . | nindent 4 }} annotations: dataprotection.kubeblocks.io/reconfigure-ref: | @@ -19,91 +17,88 @@ metadata: } } spec: - backupPolicies: - - componentDefs: - - {{ include "postgresql12.compDefName" . }} - - {{ include "postgresql14.compDefName" . }} - - {{ include "postgresql15.compDefName" . }} - - {{ include "postgresql16.compDefName" . }} - target: - role: secondary - fallbackRole: primary - account: postgres - backupMethods: - - name: pg-basebackup - snapshotVolumes: false - actionSetName: postgres-basebackup - envMapping: &compDefEnvMapping - - key: IMAGE_TAG - valueFrom: - componentDef: - - names: - - {{ include "postgresql12.compDefName" . }} - mappingValue: "12.15.0-pgvector-v0.6.1" - - names: - - {{ include "postgresql14.compDefName" . }} - mappingValue: "14.8.0-pgvector-v0.6.1" - - names: - - {{ include "postgresql15.compDefName" . }} - mappingValue: "15.7.0" - - names: - - {{ include "postgresql16.compDefName" . }} - mappingValue: "16.4.0" - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: volume-snapshot - snapshotVolumes: true - targetVolumes: - volumes: - - data - - name: config-wal-g - target: - role: "" - strategy: All - actionSetName: postgres-config-wal-g - snapshotVolumes: false - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: wal-g - target: - role: secondary - fallbackRole: primary - account: postgres - actionSetName: postgres-wal-g - snapshotVolumes: false - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: archive-wal - target: - role: primary - account: postgres - actionSetName: postgresql-pitr - snapshotVolumes: false - envMapping: *compDefEnvMapping - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - schedules: - - backupMethod: pg-basebackup - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - backupMethod: volume-snapshot - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - backupMethod: wal-g - enabled: false - cronExpression: "0 18 * * *" - retentionPeriod: 7d - - backupMethod: archive-wal - enabled: false - cronExpression: "*/5 * * * *" - retentionPeriod: 8d \ No newline at end of file + serviceKind: PostgreSQL + compDefs: + - postgresql-\d+ + target: + role: secondary + fallbackRole: primary + account: postgres + backupMethods: + - name: pg-basebackup + snapshotVolumes: false + actionSetName: postgres-basebackup + env: &compDefEnvMapping + - name: IMAGE_TAG + valueFrom: + versionMapping: + - serviceVersions: + - "12" + mappedValue: "12.15.0-pgvector-v0.6.1" + - serviceVersions: + - "14" + mappedValue: "14.8.0-pgvector-v0.6.1" + - serviceVersions: + - "15" + mappedValue: "15.7.0" + - serviceVersions: + - "16" + mappedValue: "16.4.0" + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: volume-snapshot + snapshotVolumes: true + targetVolumes: + volumes: + - data + - name: config-wal-g + target: + role: "" + strategy: All + actionSetName: postgres-config-wal-g + snapshotVolumes: false + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: wal-g + target: + role: secondary + fallbackRole: primary + account: postgres + actionSetName: postgres-wal-g + snapshotVolumes: false + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: archive-wal + target: + role: primary + account: postgres + actionSetName: postgresql-pitr + snapshotVolumes: false + env: *compDefEnvMapping + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + schedules: + - backupMethod: pg-basebackup + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d + - backupMethod: volume-snapshot + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d + - backupMethod: wal-g + enabled: false + cronExpression: "0 18 * * *" + retentionPeriod: 7d + - backupMethod: archive-wal + enabled: false + cronExpression: "*/5 * * * *" + retentionPeriod: 8d \ No newline at end of file diff --git a/addons/qdrant/templates/backuppolicytemplate.yaml b/addons/qdrant/templates/backuppolicytemplate.yaml index 1b36765d8..1435da12a 100644 --- a/addons/qdrant/templates/backuppolicytemplate.yaml +++ b/addons/qdrant/templates/backuppolicytemplate.yaml @@ -1,28 +1,26 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: qdrant-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: qdrant - service-kind/qdrant: "true" {{- include "qdrant.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: + serviceKind: Qdrant + compDefs: - qdrant - target: - role: "" - strategy: All - backupMethods: - - name: datafile - snapshotVolumes: false - actionSetName: qdrant-snapshot - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - schedules: - - backupMethod: datafile - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + target: + role: "" + strategy: All + backupMethods: + - name: datafile + snapshotVolumes: false + actionSetName: qdrant-snapshot + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + schedules: + - backupMethod: datafile + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/redis/templates/backuppolicytemplate.yaml b/addons/redis/templates/backuppolicytemplate.yaml index 788c3aa86..f7b1c8e1d 100644 --- a/addons/redis/templates/backuppolicytemplate.yaml +++ b/addons/redis/templates/backuppolicytemplate.yaml @@ -1,75 +1,47 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: redis-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: redis - service-kind/redis: "true" - service-kind/redis-cluster: "true" {{- include "redis.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: - - {{ include "redis7.cmpdName" . }} - target: - role: secondary - fallbackRole: primary - account: default - backupMethods: - - name: datafile - snapshotVolumes: false - actionSetName: redis-physical-backup - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: aof - snapshotVolumes: false - actionSetName: redis-pitr-backup - targetVolumes: - volumeMounts: - - name: data - mountPath: {{ .Values.dataMountPath }} - - name: volume-snapshot - snapshotVolumes: true - targetVolumes: - volumes: - - data - schedules: - - backupMethod: datafile - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d - - backupMethod: aof - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d - - backupMethod: volume-snapshot - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d - - componentDefs: - - {{ include "redisCluster7.cmpdName" . }} - target: - role: secondary - fallbackRole: primary - account: default - backupMethods: + serviceKind: Redis + compDefs: + - ^redis-\d+.*$ + target: + role: secondary + fallbackRole: primary + account: default + backupMethods: - name: datafile snapshotVolumes: false - actionSetName: redis-cluster-backup + actionSetName: redis-physical-backup targetVolumes: volumeMounts: - name: data mountPath: {{ .Values.dataMountPath }} - # TODO: support it when kb support to input the specified component name for sharding cluster. - # - name: volume-snapshot - # snapshotVolumes: true - # targetVolumes: - # volumes: - # - data - schedules: - - backupMethod: datafile - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + - name: aof + snapshotVolumes: false + actionSetName: redis-pitr-backup + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + - name: volume-snapshot + snapshotVolumes: true + targetVolumes: + volumes: + - data + schedules: + - backupMethod: datafile + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d + - backupMethod: aof + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d + - backupMethod: volume-snapshot + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/redis/templates/backuppolicytemplateforcluster.yaml b/addons/redis/templates/backuppolicytemplateforcluster.yaml new file mode 100644 index 000000000..0c8b99b36 --- /dev/null +++ b/addons/redis/templates/backuppolicytemplateforcluster.yaml @@ -0,0 +1,33 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: BackupPolicyTemplate +metadata: + name: redis-cluster-backup-policy-template + labels: + {{- include "redis.labels" . | nindent 4 }} +spec: + serviceKind: Redis + compDefs: + - redis-cluster + target: + role: secondary + fallbackRole: primary + account: default + backupMethods: + - name: datafile + snapshotVolumes: false + actionSetName: redis-cluster-backup + targetVolumes: + volumeMounts: + - name: data + mountPath: {{ .Values.dataMountPath }} + # TODO: support it when kb support to input the specified component name for sharding cluster. + # - name: volume-snapshot + # snapshotVolumes: true + # targetVolumes: + # volumes: + # - data + schedules: + - backupMethod: datafile + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/tidb/templates/backuppolicytemplate.yaml b/addons/tidb/templates/backuppolicytemplate.yaml index c075f82aa..bd9553930 100644 --- a/addons/tidb/templates/backuppolicytemplate.yaml +++ b/addons/tidb/templates/backuppolicytemplate.yaml @@ -1,15 +1,14 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: tidb-backup-policy-template labels: {{- include "tidb.labels" . | nindent 4 }} - clusterdefinition.kubeblocks.io/name: tidb spec: - backupPolicies: - - componentDefs: - - tidb-pd-7 - backupMethods: - - name: br - snapshotVolumes: false - actionSetName: tidb-actionset + serviceKind: Tidb + compDefs: + - tidb-pd-7 + backupMethods: + - name: br + snapshotVolumes: false + actionSetName: tidb-actionset diff --git a/addons/weaviate/templates/backuppolicytemplate.yaml b/addons/weaviate/templates/backuppolicytemplate.yaml index 6e3ca5031..dac0f585e 100644 --- a/addons/weaviate/templates/backuppolicytemplate.yaml +++ b/addons/weaviate/templates/backuppolicytemplate.yaml @@ -1,22 +1,21 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: weaviate-backup-policy-template labels: - clusterdefinition.kubeblocks.io/name: weaviate {{- include "weaviate.labels" . | nindent 4 }} spec: - backupPolicies: - - componentDefs: - - {{ include "weaviate.componentDefName" . }} - backupMethods: - - name: volume-snapshot - snapshotVolumes: true - targetVolumes: - volumes: - - data - schedules: - - backupMethod: volume-snapshot - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + serviceKind: Weaviate + compDefs: + - {{ include "weaviate.componentDefName" . }} + backupMethods: + - name: volume-snapshot + snapshotVolumes: true + targetVolumes: + volumes: + - data + schedules: + - backupMethod: volume-snapshot + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file diff --git a/addons/zookeeper/templates/backuppolicytemplate.yaml b/addons/zookeeper/templates/backuppolicytemplate.yaml index 297ae464f..844af2ab8 100644 --- a/addons/zookeeper/templates/backuppolicytemplate.yaml +++ b/addons/zookeeper/templates/backuppolicytemplate.yaml @@ -1,30 +1,27 @@ -apiVersion: apps.kubeblocks.io/v1alpha1 +apiVersion: dataprotection.kubeblocks.io/v1alpha1 kind: BackupPolicyTemplate metadata: name: zookeeper-backup-policy-template labels: {{- include "zookeeper.labels" . | nindent 4 }} - service-kind/zookeeper: "true" - annotations: - dataprotection.kubeblocks.io/is-default-policy-template: "true" spec: - backupPolicies: - - componentDefs: [zookeeper] - target: - role: follower - fallbackRole: leader - backupMethods: - - name: zoocreeper - snapshotVolumes: false - actionSetName: zookeeper-backup-zoocreeper - targetVolumes: - volumeMounts: - - name: data - mountPath: /bitnami/zookeeper/data - - name: snapshot-log - mountPath: /bitnami/zookeeper/log - schedules: - - backupMethod: zoocreeper - enabled: false - cronExpression: "0 18 * * 0" - retentionPeriod: 7d \ No newline at end of file + serviceKind: Zookeeper + compDefs: [zookeeper] + target: + role: follower + fallbackRole: leader + backupMethods: + - name: zoocreeper + snapshotVolumes: false + actionSetName: zookeeper-backup-zoocreeper + targetVolumes: + volumeMounts: + - name: data + mountPath: /bitnami/zookeeper/data + - name: snapshot-log + mountPath: /bitnami/zookeeper/log + schedules: + - backupMethod: zoocreeper + enabled: false + cronExpression: "0 18 * * 0" + retentionPeriod: 7d \ No newline at end of file