From fd4f496a1195669ce59f401835ba526903a8959c Mon Sep 17 00:00:00 2001 From: WangLe1321 Date: Tue, 16 May 2023 11:43:17 +0800 Subject: [PATCH] This is an automated cherry-pick of #4999 Signed-off-by: ti-chi-bot --- cmd/backup-manager/app/backup/backup.go | 45 +- cmd/backup-manager/app/backup/manager.go | 125 +- cmd/backup-manager/app/cmd/backup.go | 1 + cmd/backup-manager/app/util/generic.go | 1 + docs/api-references/docs.md | 72 + manifests/crd.yaml | 5044 ++++++++-------- manifests/crd/v1/pingcap.com_backups.yaml | 2 + .../crd/v1/pingcap.com_backupschedules.yaml | 4 + manifests/crd/v1/pingcap.com_restores.yaml | 2 + .../crd/v1beta1/pingcap.com_backups.yaml | 2 + .../v1beta1/pingcap.com_backupschedules.yaml | 4 + .../crd/v1beta1/pingcap.com_restores.yaml | 2 + manifests/crd_v1beta1.yaml | 5056 +++++++++-------- pkg/apis/pingcap/v1alpha1/backup.go | 32 + .../pingcap/v1alpha1/openapi_generated.go | 14 + pkg/apis/pingcap/v1alpha1/types.go | 40 + pkg/backup/backup/backup_manager.go | 191 +- pkg/backup/util/util.go | 11 +- pkg/backup/util/utils_test.go | 2 +- pkg/controller/backup/backup_controller.go | 6 + 20 files changed, 5582 insertions(+), 5074 deletions(-) diff --git a/cmd/backup-manager/app/backup/backup.go b/cmd/backup-manager/app/backup/backup.go index 4245d2e106..55280e720a 100644 --- a/cmd/backup-manager/app/backup/backup.go +++ b/cmd/backup-manager/app/backup/backup.go @@ -62,7 +62,7 @@ func (bo *Options) backupData( var logCallback func(line string) // Add extra args for volume snapshot backup. - if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot { + if bo.Mode == string(v1alpha1.BackupModeVolumeSnapshot) && !bo.Initialize { var ( progressFile = "progress.txt" progressStep = "Full Backup" @@ -112,7 +112,7 @@ func (bo *Options) backupData( go bo.updateProgressFromFile(progressCtx.Done(), backup, progressFile, progressStep, statusUpdater) } - fullArgs, err := bo.backupCommandTemplate(backup, specificArgs) + fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false) if err != nil { return err } @@ -155,7 +155,7 @@ func (bo *Options) doStartLogBackup(ctx context.Context, backup *v1alpha1.Backup if bo.CommitTS != "" && bo.CommitTS != "0" { specificArgs = append(specificArgs, fmt.Sprintf("--start-ts=%s", bo.CommitTS)) } - fullArgs, err := bo.backupCommandTemplate(backup, specificArgs) + fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false) if err != nil { return err } @@ -169,15 +169,15 @@ func (bo *Options) doStopLogBackup(ctx context.Context, backup *v1alpha1.Backup) "stop", fmt.Sprintf("--task-name=%s", backup.Name), } - fullArgs, err := bo.backupCommandTemplate(backup, specificArgs) + fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false) if err != nil { return err } return bo.brCommandRun(ctx, fullArgs) } -// doTruncatelogBackup generates br args about log backup truncate and runs br binary to do the real backup work. -func (bo *Options) doTruncatelogBackup(ctx context.Context, backup *v1alpha1.Backup) error { +// doTruncateLogBackup generates br args about log backup truncate and runs br binary to do the real backup work. +func (bo *Options) doTruncateLogBackup(ctx context.Context, backup *v1alpha1.Backup) error { specificArgs := []string{ "log", "truncate", @@ -187,15 +187,39 @@ func (bo *Options) doTruncatelogBackup(ctx context.Context, backup *v1alpha1.Bac } else { return fmt.Errorf("log backup truncate until %s is invalid", bo.TruncateUntil) } - fullArgs, err := bo.backupCommandTemplate(backup, specificArgs) + fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, false) if err != nil { return err } return bo.brCommandRun(ctx, fullArgs) } +// doInitializeVolumeBackup generates br args to stop GC and PD schedules +// and update backup status to VolumeBackupInitialized when watches corresponding logs +func (bo *Options) doInitializeVolumeBackup( + ctx context.Context, + backup *v1alpha1.Backup, + statusUpdater controller.BackupConditionUpdaterInterface, +) error { + specificArgs := []string{ + "operator", + "pause-gc-and-schedulers", + } + fullArgs, err := bo.backupCommandTemplate(backup, specificArgs, true) + if err != nil { + return err + } + + backupInitializeMgr := &VolumeBackupInitializeManager{ + backup: backup, + statusUpdater: statusUpdater, + } + logCallback := backupInitializeMgr.UpdateBackupStatus + return bo.brCommandRunWithLogCallback(ctx, fullArgs, logCallback) +} + // logBackupCommandTemplate is the template to generate br args. -func (bo *Options) backupCommandTemplate(backup *v1alpha1.Backup, specificArgs []string) ([]string, error) { +func (bo *Options) backupCommandTemplate(backup *v1alpha1.Backup, specificArgs []string, skipBackupArgs bool) ([]string, error) { if len(specificArgs) == 0 { return nil, fmt.Errorf("backup command is invalid, Args: %v", specificArgs) } @@ -211,6 +235,11 @@ func (bo *Options) backupCommandTemplate(backup *v1alpha1.Backup, specificArgs [ args = append(args, fmt.Sprintf("--cert=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSCertKey))) args = append(args, fmt.Sprintf("--key=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSPrivateKeyKey))) } + + if skipBackupArgs { + return append(specificArgs, args...), nil + } + // `options` in spec are put to the last because we want them to have higher priority than generated arguments dataArgs, err := constructOptions(backup) if err != nil { diff --git a/cmd/backup-manager/app/backup/manager.go b/cmd/backup-manager/app/backup/manager.go index 0fdd6bc8fd..a19421fc24 100644 --- a/cmd/backup-manager/app/backup/manager.go +++ b/cmd/backup-manager/app/backup/manager.go @@ -18,6 +18,7 @@ import ( "database/sql" "fmt" "strconv" + "strings" "time" "github.com/Masterminds/semver" @@ -38,6 +39,11 @@ import ( "k8s.io/klog/v2" ) +const ( + gcPausedKeyword = "GC is paused" + pdSchedulesPausedKeyword = "Schedulers are paused" +) + // Manager mainly used to manage backup related work type Manager struct { backupLister listers.BackupLister @@ -117,6 +123,10 @@ func (bm *Manager) ProcessBackup() error { return bm.performLogBackup(ctx, backup.DeepCopy()) } + if bm.Mode == string(v1alpha1.BackupModeVolumeSnapshot) && bm.Initialize { + return bm.performVolumeBackupInitialize(ctx, backup.DeepCopy()) + } + if backup.Spec.From == nil { // skip the DB initialization if spec.from is not specified return bm.performBackup(ctx, backup.DeepCopy(), nil) @@ -333,8 +343,16 @@ func (bm *Manager) performBackup(ctx context.Context, backup *v1alpha1.Backup, d if backupErr != nil { errs = append(errs, backupErr) klog.Errorf("backup cluster %s data failed, err: %s", bm, backupErr) + failedCondition := v1alpha1.BackupFailed + if bm.Mode == string(v1alpha1.BackupModeVolumeSnapshot) { + if bm.Initialize { + failedCondition = v1alpha1.VolumeBackupInitializeFailed + } else { + failedCondition = v1alpha1.VolumeBackupFailed + } + } uerr := bm.StatusUpdater.Update(backup, &v1alpha1.BackupCondition{ - Type: v1alpha1.BackupFailed, + Type: failedCondition, Status: corev1.ConditionTrue, Reason: "BackupDataToRemoteFailed", Message: backupErr.Error(), @@ -345,23 +363,27 @@ func (bm *Manager) performBackup(ctx context.Context, backup *v1alpha1.Backup, d klog.Infof("backup cluster %s data to %s success", bm, backupFullPath) var updateStatus *controller.BackupUpdateStatus + completeCondition := v1alpha1.BackupComplete switch bm.Mode { case string(v1alpha1.BackupModeVolumeSnapshot): - // In volume snapshot mode, commitTS have been updated according to the - // br command output, so we don't need to update it here. - backupSize, err := util.CalcVolSnapBackupSize(ctx, backup.Spec.StorageProvider) + if !bm.Initialize { + completeCondition = v1alpha1.VolumeBackupComplete + // In volume snapshot mode, commitTS have been updated according to the + // br command output, so we don't need to update it here. + backupSize, err := util.CalcVolSnapBackupSize(ctx, backup.Spec.StorageProvider) - if err != nil { - klog.Warningf("Failed to calc volume snapshot backup size %d bytes, %v", backupSize, err) - } + if err != nil { + klog.Warningf("Failed to calc volume snapshot backup size %d bytes, %v", backupSize, err) + } - backupSizeReadable := humanize.Bytes(uint64(backupSize)) + backupSizeReadable := humanize.Bytes(uint64(backupSize)) - updateStatus = &controller.BackupUpdateStatus{ - TimeStarted: &metav1.Time{Time: started}, - TimeCompleted: &metav1.Time{Time: time.Now()}, - BackupSize: &backupSize, - BackupSizeReadable: &backupSizeReadable, + updateStatus = &controller.BackupUpdateStatus{ + TimeStarted: &metav1.Time{Time: started}, + TimeCompleted: &metav1.Time{Time: time.Now()}, + BackupSize: &backupSize, + BackupSizeReadable: &backupSizeReadable, + } } default: backupMeta, err := util.GetBRMetaData(ctx, backup.Spec.StorageProvider) @@ -392,8 +414,9 @@ func (bm *Manager) performBackup(ctx context.Context, backup *v1alpha1.Backup, d CommitTs: &ts, } } + return bm.StatusUpdater.Update(backup, &v1alpha1.BackupCondition{ - Type: v1alpha1.BackupComplete, + Type: completeCondition, Status: corev1.ConditionTrue, }, updateStatus) } @@ -546,7 +569,7 @@ func (bm *Manager) truncateLogBackup(ctx context.Context, backup *v1alpha1.Backu } // run br binary to do the real job - backupErr := bm.doTruncatelogBackup(ctx, backup) + backupErr := bm.doTruncateLogBackup(ctx, backup) if backupErr != nil { klog.Errorf("Truncate log backup of cluster %s failed, err: %s", bm, backupErr) @@ -564,6 +587,35 @@ func (bm *Manager) truncateLogBackup(ctx context.Context, backup *v1alpha1.Backu return updateStatus, "", nil } +// performVolumeBackupInitialize execute br to stop GC and PD schedules +// it will keep running until the process is killed +func (bm *Manager) performVolumeBackupInitialize(ctx context.Context, backup *v1alpha1.Backup) error { + err := bm.StatusUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupRunning, + Status: corev1.ConditionTrue, + }, nil) + if err != nil { + return err + } + + if err = bm.doInitializeVolumeBackup(ctx, backup, bm.StatusUpdater); err != nil { + errs := make([]error, 0, 2) + errs = append(errs, err) + updateErr := bm.StatusUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.VolumeBackupInitializeFailed, + Status: corev1.ConditionTrue, + Reason: "InitializeVolumeBackupFailed", + Message: err.Error(), + }, nil) + if updateErr != nil { + errs = append(errs, updateErr) + } + return errorutils.NewAggregate(errs) + } + + return nil +} + func (bm *Manager) cleanSnapshotBackupEnv(ctx context.Context, backup *v1alpha1.Backup) error { if backup.Spec.Mode != v1alpha1.BackupModeSnapshot { return nil @@ -582,3 +634,46 @@ func (bm *Manager) isBRCanContinueRunByCheckpoint() bool { lessThanV651, _ := semver.NewConstraint(" +federalVolumeBackupPhase
+ + +FederalVolumeBackupPhase + + + + +(Optional) +

FederalVolumeBackupPhase indicates which phase to execute in federal volume backup

+ + + + dumpling
@@ -1264,6 +1278,20 @@ string +federalVolumeRestorePhase
+ +
+FederalVolumeRestorePhase + + + + +(Optional) +

FederalVolumeRestorePhase indicates which phase to execute in federal volume restore

+ + + + tikvGCLifeTime
string @@ -3995,6 +4023,20 @@ bool +federalVolumeBackupPhase
+ + +FederalVolumeBackupPhase + + + + +(Optional) +

FederalVolumeBackupPhase indicates which phase to execute in federal volume backup

+ + + + dumpling
@@ -6940,6 +6982,22 @@ it takes effect only when set spec.recoverFailover=false

+

FederalVolumeBackupPhase

+

+(Appears on: +BackupSpec) +

+

+

FederalVolumeBackupPhase represents a phase to execute in federal volume backup

+

+

FederalVolumeRestorePhase

+

+(Appears on: +RestoreSpec) +

+

+

FederalVolumeRestorePhase represents a phase to execute in federal volume restore

+

FileLogConfig

(Appears on: @@ -13635,6 +13693,20 @@ string +federalVolumeRestorePhase
+ + +FederalVolumeRestorePhase + + + + +(Optional) +

FederalVolumeRestorePhase indicates which phase to execute in federal volume restore

+ + + + tikvGCLifeTime
string diff --git a/manifests/crd.yaml b/manifests/crd.yaml index 1205d48205..8009dd89aa 100644 --- a/manifests/crd.yaml +++ b/manifests/crd.yaml @@ -6,35 +6,56 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.6.2 creationTimestamp: null - name: backupschedules.pingcap.com + name: backups.pingcap.com spec: group: pingcap.com names: - kind: BackupSchedule - listKind: BackupScheduleList - plural: backupschedules + kind: Backup + listKind: BackupList + plural: backups shortNames: - - bks - singular: backupschedule + - bk + singular: backup scope: Namespaced versions: - additionalPrinterColumns: - - description: The cron format string used for backup scheduling - jsonPath: .spec.schedule - name: Schedule + - description: the type of backup, such as full, db, table. Only used when Mode + = snapshot. + jsonPath: .spec.backupType + name: Type type: string - - description: The max number of backups we want to keep - jsonPath: .spec.maxBackups - name: MaxBackups - type: integer - - description: The last backup CR name - jsonPath: .status.lastBackup - name: LastBackup - priority: 1 + - description: the mode of backup, such as snapshot, log. + jsonPath: .spec.backupMode + name: Mode type: string - - description: The last time the backup was successfully created - jsonPath: .status.lastBackupTime - name: LastBackupTime + - description: The current status of the backup + jsonPath: .status.phase + name: Status + type: string + - description: The full path of backup data + jsonPath: .status.backupPath + name: BackupPath + type: string + - description: The data size of the backup + jsonPath: .status.backupSizeReadable + name: BackupSize + type: string + - description: The commit ts of the backup + jsonPath: .status.commitTs + name: CommitTS + type: string + - description: The log backup truncate until ts + jsonPath: .status.logSuccessTruncateUntil + name: LogTruncateUntil + type: string + - description: The time at which the backup was started + jsonPath: .status.timeStarted + name: Started + priority: 1 + type: date + - description: The time at which the backup was completed + jsonPath: .status.timeCompleted + name: Completed priority: 1 type: date - jsonPath: .metadata.creationTimestamp @@ -52,16 +73,107 @@ spec: type: object spec: properties: - backupTemplate: + affinity: properties: - affinity: + nodeAffinity: properties: - nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: properties: - preferredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: items: properties: - preference: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: properties: matchExpressions: items: @@ -79,125 +191,73 @@ spec: - operator type: object type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - weight: - format: int32 - type: integer + namespaces: + items: + type: string + type: array + topologyKey: + type: string required: - - preference - - weight + - topologyKey type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: properties: matchExpressions: items: @@ -229,1151 +289,1297 @@ spec: required: - topologyKey type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: + matchExpressions: + items: + properties: + key: type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + operator: type: string - type: object - type: object - namespaces: - items: - type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object type: array - topologyKey: - type: string - required: - - topologyKey + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - azblob: - properties: - accessTier: - type: string - container: - type: string - path: - type: string - prefix: - type: string - secretName: - type: string - type: object - backoffRetryPolicy: - properties: - maxRetryTimes: - default: 2 - type: integer - minRetryDuration: - default: 300s - type: string - retryTimeout: - default: 30m - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array type: object - backupMode: - default: snapshot + type: object + azblob: + properties: + accessTier: type: string - backupType: + container: type: string - br: - properties: - checkRequirements: - type: boolean - checksum: - type: boolean - cluster: - type: string - clusterNamespace: - type: string - concurrency: - format: int32 - type: integer - db: - type: string - logLevel: - type: string - onLine: - type: boolean - options: - items: - type: string - type: array - rateLimit: - type: integer - sendCredToTikv: - type: boolean - statusAddr: - type: string - table: - type: string - timeAgo: - type: string - required: - - cluster - type: object - cleanOption: - properties: - backoffEnabled: - type: boolean - batchConcurrency: - format: int32 - type: integer - disableBatchConcurrency: - type: boolean - pageSize: - format: int64 - type: integer - retryCount: - default: 5 - type: integer - routineConcurrency: - format: int32 - type: integer - type: object - cleanPolicy: + path: type: string - commitTs: + prefix: type: string - dumpling: - properties: - options: - items: - type: string - type: array - tableFilter: - items: - type: string - type: array - type: object - env: + secretName: + type: string + type: object + backoffRetryPolicy: + properties: + maxRetryTimes: + default: 2 + type: integer + minRetryDuration: + default: 300s + type: string + retryTimeout: + default: 30m + type: string + type: object + backupMode: + default: snapshot + type: string + backupType: + type: string + br: + properties: + checkRequirements: + type: boolean + checksum: + type: boolean + cluster: + type: string + clusterNamespace: + type: string + concurrency: + format: int32 + type: integer + db: + type: string + logLevel: + type: string + onLine: + type: boolean + options: + items: + type: string + type: array + rateLimit: + type: integer + sendCredToTikv: + type: boolean + statusAddr: + type: string + table: + type: string + timeAgo: + type: string + required: + - cluster + type: object + cleanOption: + properties: + backoffEnabled: + type: boolean + batchConcurrency: + format: int32 + type: integer + disableBatchConcurrency: + type: boolean + pageSize: + format: int64 + type: integer + retryCount: + default: 5 + type: integer + routineConcurrency: + format: int32 + type: integer + type: object + cleanPolicy: + type: string + commitTs: + type: string + dumpling: + properties: + options: items: + type: string + type: array + tableFilter: + items: + type: string + type: array + type: object + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: properties: - name: - type: string - value: - type: string - valueFrom: + configMapKeyRef: properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key type: object - required: - - name type: object - type: array - from: - properties: - host: - type: string - port: - format: int32 - type: integer - secretName: - type: string - tlsClientSecretName: - type: string - user: - type: string - required: - - host - - secretName - type: object - gcs: - properties: - bucket: - type: string - bucketAcl: - type: string - location: - type: string - objectAcl: - type: string - path: - type: string - prefix: - type: string - projectId: - type: string - secretName: - type: string - storageClass: - type: string - required: - - projectId - type: object - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - local: + required: + - name + type: object + type: array + federalVolumeBackupPhase: + type: string + from: + properties: + host: + type: string + port: + format: int32 + type: integer + secretName: + type: string + tlsClientSecretName: + type: string + user: + type: string + required: + - host + - secretName + type: object + gcs: + properties: + bucket: + type: string + bucketAcl: + type: string + location: + type: string + objectAcl: + type: string + path: + type: string + prefix: + type: string + projectId: + type: string + secretName: + type: string + storageClass: + type: string + required: + - projectId + type: object + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + local: + properties: + prefix: + type: string + volume: properties: - prefix: - type: string - volume: + awsElasticBlockStore: properties: - awsElasticBlockStore: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: + name: type: string - required: - - volumeID type: object - azureDisk: + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: + name: type: string - readOnly: - type: boolean - required: - - diskName - - diskURI type: object - azureFile: + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: properties: - readOnly: - type: boolean - secretName: - type: string - shareName: + name: type: string - required: - - secretName - - shareName type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: + mode: + format: int32 + type: integer + path: type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + resourceFieldRef: properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + containerName: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + readOnly: + type: boolean + volumeClaimTemplate: + properties: + metadata: + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: anyOf: - type: integer - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - readOnly: - type: boolean - volumeClaimTemplate: - properties: - metadata: + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object type: object - spec: + selector: properties: - accessModes: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name + matchLabels: + additionalProperties: + type: string type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: + storageClassName: + type: string + volumeMode: + type: string + volumeName: type: string type: object required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName + - spec type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string type: object - glusterfs: + readOnly: + type: boolean + secretRef: properties: - endpoints: - type: string - path: + name: type: string - readOnly: - type: boolean - required: - - endpoints - - path type: object - hostPath: + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: properties: - path: - type: string - type: + name: type: string - required: - - path type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: + targetPortal: type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: properties: - configMap: - properties: - items: - items: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: properties: - key: - type: string - mode: - format: int32 - type: integer - path: + apiVersion: type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + fieldPath: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object required: - - path + - fieldPath type: object - type: array - type: object - secret: - properties: - items: - items: + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: properties: - key: + containerName: type: string - mode: - format: int32 - type: integer - path: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string required: - - key - - path + - resource type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object + required: + - path + type: object + type: array type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + secret: properties: - key: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: type: string - mode: - format: int32 + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 type: integer path: type: string required: - - key - path type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name + type: object + type: array type: object - volumeMount: + quobyte: properties: - mountPath: - type: string - mountPropagation: - type: string - name: + group: type: string readOnly: type: boolean - subPath: + registry: type: string - subPathExpr: + tenant: + type: string + user: + type: string + volume: type: string required: - - mountPath - - name + - registry + - volume type: object - required: - - volume - - volumeMount - type: object - logStop: - type: boolean - logTruncateUntil: - type: string - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: + rbd: properties: - level: - type: string - role: + fsType: type: string - type: + image: type: string - user: + keyring: type: string - type: object - seccompProfile: - properties: - localhostProfile: + monitors: + items: + type: string + type: array + pool: type: string - type: + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: type: string required: - - type + - image + - monitors type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: + scaleIO: properties: - gmsaCredentialSpec: + fsType: type: string - gmsaCredentialSpecName: + gateway: type: string - runAsUserName: + protectionDomain: type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system type: object - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath type: object + required: + - name type: object - s3: + volumeMount: properties: - acl: + mountPath: type: string - bucket: + mountPropagation: type: string - endpoint: + name: type: string - options: - items: - type: string - type: array - path: + readOnly: + type: boolean + subPath: type: string - prefix: + subPathExpr: type: string - provider: + required: + - mountPath + - name + type: object + required: + - volume + - volumeMount + type: object + logStop: + type: boolean + logTruncateUntil: + type: string + podSecurityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: type: string - region: + role: type: string - secretName: + type: type: string - sse: + user: type: string - storageClass: + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: type: string required: - - provider + - type type: object - serviceAccount: - type: string - storageClassName: - type: string - storageSize: - type: string - tableFilter: + supplementalGroups: items: - type: string + format: int64 + type: integer type: array - tikvGCLifeTime: - type: string - tolerations: + sysctls: items: properties: - effect: - type: string - key: - type: string - operator: + name: type: string - tolerationSeconds: - format: int64 - type: integer value: type: string + required: + - name + - value type: object type: array - toolImage: + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + runAsUserName: + type: string + type: object + type: object + priorityClassName: + type: string + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + s3: + properties: + acl: type: string - useKMS: - type: boolean + bucket: + type: string + endpoint: + type: string + options: + items: + type: string + type: array + path: + type: string + prefix: + type: string + provider: + type: string + region: + type: string + secretName: + type: string + sse: + type: string + storageClass: + type: string + required: + - provider type: object - imagePullSecrets: + serviceAccount: + type: string + storageClassName: + type: string + storageSize: + type: string + tableFilter: items: - properties: - name: - type: string - type: object + type: string type: array - logBackupTemplate: + tikvGCLifeTime: + type: string + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + toolImage: + type: string + useKMS: + type: boolean + type: object + status: + properties: + backoffRetryStatus: + items: + properties: + detectFailedAt: + format: date-time + type: string + expectedRetryAt: + format: date-time + type: string + originalReason: + type: string + realRetryAt: + format: date-time + type: string + retryNum: + type: integer + retryReason: + type: string + type: object + type: array + backupPath: + type: string + backupSize: + format: int64 + type: integer + backupSizeReadable: + type: string + commitTs: + type: string + conditions: + items: + properties: + command: + type: string + lastTransitionTime: + format: date-time + nullable: true + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + nullable: true + type: array + logCheckpointTs: + type: string + logSubCommandStatuses: + additionalProperties: + properties: + command: + type: string + conditions: + items: + properties: + command: + type: string + lastTransitionTime: + format: date-time + nullable: true + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + nullable: true + type: array + logTruncatingUntil: + type: string + phase: + type: string + timeCompleted: + format: date-time + nullable: true + type: string + timeStarted: + format: date-time + nullable: true + type: string + type: object + type: object + logSuccessTruncateUntil: + type: string + phase: + type: string + progresses: + items: + properties: + lastTransitionTime: + format: date-time + nullable: true + type: string + progress: + type: number + step: + type: string + type: object + nullable: true + type: array + timeCompleted: + format: date-time + nullable: true + type: string + timeStarted: + format: date-time + nullable: true + type: string + type: object + required: + - metadata + - spec + type: object + served: true + storage: true + subresources: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.2 + creationTimestamp: null + name: backupschedules.pingcap.com +spec: + group: pingcap.com + names: + kind: BackupSchedule + listKind: BackupScheduleList + plural: backupschedules + shortNames: + - bks + singular: backupschedule + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The cron format string used for backup scheduling + jsonPath: .spec.schedule + name: Schedule + type: string + - description: The max number of backups we want to keep + jsonPath: .spec.maxBackups + name: MaxBackups + type: integer + - description: The last backup CR name + jsonPath: .status.lastBackup + name: LastBackup + priority: 1 + type: string + - description: The last time the backup was successfully created + jsonPath: .status.lastBackupTime + name: LastBackupTime + priority: 1 + type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + backupTemplate: properties: affinity: properties: @@ -1797,6 +2003,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: @@ -2687,225 +2895,23 @@ spec: useKMS: type: boolean type: object - maxBackups: - format: int32 - type: integer - maxReservedTime: - type: string - pause: - type: boolean - schedule: - type: string - storageClassName: - type: string - storageSize: - type: string - required: - - logBackupTemplate - - schedule - type: object - status: - properties: - allBackupCleanTime: - format: date-time - type: string - lastBackup: - type: string - lastBackupTime: - format: date-time - type: string - logBackup: - type: string - type: object - required: - - metadata - - spec - type: object - served: true - storage: true - subresources: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.6.2 - creationTimestamp: null - name: backups.pingcap.com -spec: - group: pingcap.com - names: - kind: Backup - listKind: BackupList - plural: backups - shortNames: - - bk - singular: backup - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: the type of backup, such as full, db, table. Only used when Mode - = snapshot. - jsonPath: .spec.backupType - name: Type - type: string - - description: the mode of backup, such as snapshot, log. - jsonPath: .spec.backupMode - name: Mode - type: string - - description: The current status of the backup - jsonPath: .status.phase - name: Status - type: string - - description: The full path of backup data - jsonPath: .status.backupPath - name: BackupPath - type: string - - description: The data size of the backup - jsonPath: .status.backupSizeReadable - name: BackupSize - type: string - - description: The commit ts of the backup - jsonPath: .status.commitTs - name: CommitTS - type: string - - description: The log backup truncate until ts - jsonPath: .status.logSuccessTruncateUntil - name: LogTruncateUntil - type: string - - description: The time at which the backup was started - jsonPath: .status.timeStarted - name: Started - priority: 1 - type: date - - description: The time at which the backup was completed - jsonPath: .status.timeCompleted - name: Completed - priority: 1 - type: date - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - affinity: + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + logBackupTemplate: properties: - nodeAffinity: + affinity: properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: + nodeAffinity: properties: - nodeSelectorTerms: + preferredDuringSchedulingIgnoredDuringExecution: items: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: + preference: properties: matchExpressions: items: @@ -2923,71 +2929,123 @@ spec: - operator type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string + weight: + format: int32 + type: integer required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + - preference + - weight type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: properties: labelSelector: properties: @@ -3021,1225 +3079,1173 @@ spec: required: - topologyKey type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - matchExpressions: - items: - properties: - key: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: type: string - operator: + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string + type: object type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array + type: array + type: object type: object - type: object - azblob: - properties: - accessTier: - type: string - container: - type: string - path: - type: string - prefix: - type: string - secretName: - type: string - type: object - backoffRetryPolicy: - properties: - maxRetryTimes: - default: 2 - type: integer - minRetryDuration: - default: 300s - type: string - retryTimeout: - default: 30m - type: string - type: object - backupMode: - default: snapshot - type: string - backupType: - type: string - br: - properties: - checkRequirements: - type: boolean - checksum: - type: boolean - cluster: - type: string - clusterNamespace: - type: string - concurrency: - format: int32 - type: integer - db: - type: string - logLevel: + azblob: + properties: + accessTier: + type: string + container: + type: string + path: + type: string + prefix: + type: string + secretName: + type: string + type: object + backoffRetryPolicy: + properties: + maxRetryTimes: + default: 2 + type: integer + minRetryDuration: + default: 300s + type: string + retryTimeout: + default: 30m + type: string + type: object + backupMode: + default: snapshot type: string - onLine: - type: boolean - options: - items: - type: string - type: array - rateLimit: - type: integer - sendCredToTikv: - type: boolean - statusAddr: + backupType: type: string - table: + br: + properties: + checkRequirements: + type: boolean + checksum: + type: boolean + cluster: + type: string + clusterNamespace: + type: string + concurrency: + format: int32 + type: integer + db: + type: string + logLevel: + type: string + onLine: + type: boolean + options: + items: + type: string + type: array + rateLimit: + type: integer + sendCredToTikv: + type: boolean + statusAddr: + type: string + table: + type: string + timeAgo: + type: string + required: + - cluster + type: object + cleanOption: + properties: + backoffEnabled: + type: boolean + batchConcurrency: + format: int32 + type: integer + disableBatchConcurrency: + type: boolean + pageSize: + format: int64 + type: integer + retryCount: + default: 5 + type: integer + routineConcurrency: + format: int32 + type: integer + type: object + cleanPolicy: type: string - timeAgo: + commitTs: type: string - required: - - cluster - type: object - cleanOption: - properties: - backoffEnabled: - type: boolean - batchConcurrency: - format: int32 - type: integer - disableBatchConcurrency: - type: boolean - pageSize: - format: int64 - type: integer - retryCount: - default: 5 - type: integer - routineConcurrency: - format: int32 - type: integer - type: object - cleanPolicy: - type: string - commitTs: - type: string - dumpling: - properties: - options: - items: - type: string - type: array - tableFilter: + dumpling: + properties: + options: + items: + type: string + type: array + tableFilter: + items: + type: string + type: array + type: object + env: items: - type: string - type: array - type: object - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: + name: + type: string + value: + type: string + valueFrom: properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object type: object + required: + - name type: object - required: - - name - type: object - type: array - from: - properties: - host: - type: string - port: - format: int32 - type: integer - secretName: - type: string - tlsClientSecretName: - type: string - user: - type: string - required: - - host - - secretName - type: object - gcs: - properties: - bucket: - type: string - bucketAcl: - type: string - location: - type: string - objectAcl: - type: string - path: - type: string - prefix: - type: string - projectId: - type: string - secretName: - type: string - storageClass: - type: string - required: - - projectId - type: object - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - local: - properties: - prefix: + type: array + federalVolumeBackupPhase: type: string - volume: + from: properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: + host: + type: string + port: + format: int32 + type: integer + secretName: + type: string + tlsClientSecretName: + type: string + user: + type: string + required: + - host + - secretName + type: object + gcs: + properties: + bucket: + type: string + bucketAcl: + type: string + location: + type: string + objectAcl: + type: string + path: + type: string + prefix: + type: string + projectId: + type: string + secretName: + type: string + storageClass: + type: string + required: + - projectId + type: object + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + local: + properties: + prefix: + type: string + volume: + properties: + awsElasticBlockStore: properties: - name: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: type: string + required: + - volumeID type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: + azureDisk: properties: - name: + cachingMode: + type: string + diskName: type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: + azureFile: properties: - name: + readOnly: + type: boolean + secretName: type: string + shareName: + type: string + required: + - secretName + - shareName type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + cephfs: + properties: + monitors: + items: type: string - resourceFieldRef: + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - containerName: + key: type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: + mode: + format: int32 + type: integer + path: type: string required: - - resource + - key + - path type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - readOnly: - type: boolean - volumeClaimTemplate: + type: array + name: + type: string + optional: + type: boolean + type: object + csi: properties: - metadata: - type: object - spec: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: anyOf: - type: integer - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - type: object + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + readOnly: + type: boolean + volumeClaimTemplate: + properties: + metadata: type: object - selector: + spec: properties: - matchExpressions: + accessModes: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string type: object - storageClassName: - type: string - volumeMode: + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: type: string - volumeName: + type: object + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: type: string type: object + targetPortal: + type: string required: - - spec + - iqn + - lun + - targetPortal type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: + name: type: string - options: - additionalProperties: - type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server type: object - readOnly: - type: boolean - secretRef: + persistentVolumeClaim: properties: - name: + claimName: type: string + readOnly: + type: boolean + required: + - claimName type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: + photonPersistentDisk: properties: - name: + fsType: + type: string + pdID: type: string + required: + - pdID type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: properties: - items: - items: - properties: - fieldRef: + configMap: + properties: + items: + items: properties: - apiVersion: + key: type: string - fieldPath: + mode: + format: int32 + type: integer + path: type: string required: - - fieldPath + - key + - path type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: properties: - containerName: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + mode: + format: int32 + type: integer + path: type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: type: string required: - - resource + - key + - path type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object type: object - serviceAccountToken: + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: + key: type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: properties: - name: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: type: string type: object - user: - type: string + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object required: - - image - - monitors + - name type: object - scaleIO: + volumeMount: properties: - fsType: + mountPath: type: string - gateway: + mountPropagation: type: string - protectionDomain: + name: type: string readOnly: type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: + subPath: type: string - volumeName: + subPathExpr: type: string required: - - gateway - - secretRef - - system + - mountPath + - name type: object - secret: + required: + - volume + - volumeMount + type: object + logStop: + type: boolean + logTruncateUntil: + type: string + podSecurityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: + level: type: string - type: object - storageos: - properties: - fsType: + role: type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: + type: type: string - volumeNamespace: + user: type: string type: object - vsphereVolume: + seccompProfile: properties: - fsType: + localhostProfile: type: string - storagePolicyID: + type: type: string - storagePolicyName: + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: type: string - volumePath: + gmsaCredentialSpecName: + type: string + runAsUserName: type: string - required: - - volumePath type: object - required: - - name type: object - volumeMount: + priorityClassName: + type: string + resources: properties: - mountPath: - type: string - mountPropagation: - type: string - name: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + s3: + properties: + acl: type: string - readOnly: - type: boolean - subPath: + bucket: type: string - subPathExpr: + endpoint: type: string - required: - - mountPath - - name - type: object - required: - - volume - - volumeMount - type: object - logStop: - type: boolean - logTruncateUntil: - type: string - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: + options: + items: + type: string + type: array + path: type: string - role: + prefix: type: string - type: + provider: type: string - user: + region: type: string - type: object - seccompProfile: - properties: - localhostProfile: + secretName: type: string - type: + sse: + type: string + storageClass: type: string required: - - type + - provider type: object - supplementalGroups: + serviceAccount: + type: string + storageClassName: + type: string + storageSize: + type: string + tableFilter: items: - format: int64 - type: integer + type: string type: array - sysctls: + tikvGCLifeTime: + type: string + tolerations: items: properties: - name: + effect: type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer value: type: string - required: - - name - - value type: object type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - s3: - properties: - acl: - type: string - bucket: - type: string - endpoint: - type: string - options: - items: - type: string - type: array - path: - type: string - prefix: - type: string - provider: - type: string - region: - type: string - secretName: - type: string - sse: - type: string - storageClass: + toolImage: type: string - required: - - provider + useKMS: + type: boolean type: object - serviceAccount: + maxBackups: + format: int32 + type: integer + maxReservedTime: + type: string + pause: + type: boolean + schedule: type: string storageClassName: type: string storageSize: type: string - tableFilter: - items: - type: string - type: array - tikvGCLifeTime: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - toolImage: - type: string - useKMS: - type: boolean + required: + - logBackupTemplate + - schedule type: object status: properties: - backoffRetryStatus: - items: - properties: - detectFailedAt: - format: date-time - type: string - expectedRetryAt: - format: date-time - type: string - originalReason: - type: string - realRetryAt: - format: date-time - type: string - retryNum: - type: integer - retryReason: - type: string - type: object - type: array - backupPath: - type: string - backupSize: - format: int64 - type: integer - backupSizeReadable: - type: string - commitTs: - type: string - conditions: - items: - properties: - command: - type: string - lastTransitionTime: - format: date-time - nullable: true - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - nullable: true - type: array - logCheckpointTs: - type: string - logSubCommandStatuses: - additionalProperties: - properties: - command: - type: string - conditions: - items: - properties: - command: - type: string - lastTransitionTime: - format: date-time - nullable: true - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - nullable: true - type: array - logTruncatingUntil: - type: string - phase: - type: string - timeCompleted: - format: date-time - nullable: true - type: string - timeStarted: - format: date-time - nullable: true - type: string - type: object - type: object - logSuccessTruncateUntil: + allBackupCleanTime: + format: date-time type: string - phase: + lastBackup: type: string - progresses: - items: - properties: - lastTransitionTime: - format: date-time - nullable: true - type: string - progress: - type: number - step: - type: string - type: object - nullable: true - type: array - timeCompleted: + lastBackupTime: format: date-time - nullable: true type: string - timeStarted: - format: date-time - nullable: true + logBackup: type: string type: object required: @@ -12641,6 +12647,8 @@ spec: - name type: object type: array + federalVolumeRestorePhase: + type: string gcs: properties: bucket: diff --git a/manifests/crd/v1/pingcap.com_backups.yaml b/manifests/crd/v1/pingcap.com_backups.yaml index 5cc074a587..6e6e52a1aa 100644 --- a/manifests/crd/v1/pingcap.com_backups.yaml +++ b/manifests/crd/v1/pingcap.com_backups.yaml @@ -495,6 +495,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: diff --git a/manifests/crd/v1/pingcap.com_backupschedules.yaml b/manifests/crd/v1/pingcap.com_backupschedules.yaml index 3904720fe4..43175cd21e 100644 --- a/manifests/crd/v1/pingcap.com_backupschedules.yaml +++ b/manifests/crd/v1/pingcap.com_backupschedules.yaml @@ -476,6 +476,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: @@ -1797,6 +1799,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: diff --git a/manifests/crd/v1/pingcap.com_restores.yaml b/manifests/crd/v1/pingcap.com_restores.yaml index eaf8a7cdac..24f5df90fc 100644 --- a/manifests/crd/v1/pingcap.com_restores.yaml +++ b/manifests/crd/v1/pingcap.com_restores.yaml @@ -425,6 +425,8 @@ spec: - name type: object type: array + federalVolumeRestorePhase: + type: string gcs: properties: bucket: diff --git a/manifests/crd/v1beta1/pingcap.com_backups.yaml b/manifests/crd/v1beta1/pingcap.com_backups.yaml index 80cfaa8d9b..ef5edc77e0 100644 --- a/manifests/crd/v1beta1/pingcap.com_backups.yaml +++ b/manifests/crd/v1beta1/pingcap.com_backups.yaml @@ -490,6 +490,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: diff --git a/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml b/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml index 7be729f6b5..e865a48de3 100644 --- a/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml +++ b/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml @@ -471,6 +471,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: @@ -1787,6 +1789,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: diff --git a/manifests/crd/v1beta1/pingcap.com_restores.yaml b/manifests/crd/v1beta1/pingcap.com_restores.yaml index 33d269a2fe..38c0d87cc6 100644 --- a/manifests/crd/v1beta1/pingcap.com_restores.yaml +++ b/manifests/crd/v1beta1/pingcap.com_restores.yaml @@ -425,6 +425,8 @@ spec: - name type: object type: array + federalVolumeRestorePhase: + type: string gcs: properties: bucket: diff --git a/manifests/crd_v1beta1.yaml b/manifests/crd_v1beta1.yaml index fd0f7eff1c..53f60c79aa 100644 --- a/manifests/crd_v1beta1.yaml +++ b/manifests/crd_v1beta1.yaml @@ -6,25 +6,46 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.6.2 creationTimestamp: null - name: backupschedules.pingcap.com + name: backups.pingcap.com spec: additionalPrinterColumns: - - JSONPath: .spec.schedule - description: The cron format string used for backup scheduling - name: Schedule + - JSONPath: .spec.backupType + description: the type of backup, such as full, db, table. Only used when Mode + = snapshot. + name: Type type: string - - JSONPath: .spec.maxBackups - description: The max number of backups we want to keep - name: MaxBackups - type: integer - - JSONPath: .status.lastBackup - description: The last backup CR name - name: LastBackup - priority: 1 + - JSONPath: .spec.backupMode + description: the mode of backup, such as snapshot, log. + name: Mode type: string - - JSONPath: .status.lastBackupTime - description: The last time the backup was successfully created - name: LastBackupTime + - JSONPath: .status.phase + description: The current status of the backup + name: Status + type: string + - JSONPath: .status.backupPath + description: The full path of backup data + name: BackupPath + type: string + - JSONPath: .status.backupSizeReadable + description: The data size of the backup + name: BackupSize + type: string + - JSONPath: .status.commitTs + description: The commit ts of the backup + name: CommitTS + type: string + - JSONPath: .status.logSuccessTruncateUntil + description: The log backup truncate until ts + name: LogTruncateUntil + type: string + - JSONPath: .status.timeStarted + description: The time at which the backup was started + name: Started + priority: 1 + type: date + - JSONPath: .status.timeCompleted + description: The time at which the backup was completed + name: Completed priority: 1 type: date - JSONPath: .metadata.creationTimestamp @@ -32,12 +53,12 @@ spec: type: date group: pingcap.com names: - kind: BackupSchedule - listKind: BackupScheduleList - plural: backupschedules + kind: Backup + listKind: BackupList + plural: backups shortNames: - - bks - singular: backupschedule + - bk + singular: backup preserveUnknownFields: false scope: Namespaced subresources: {} @@ -52,16 +73,107 @@ spec: type: object spec: properties: - backupTemplate: + affinity: properties: - affinity: + nodeAffinity: properties: - nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: properties: - preferredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: items: properties: - preference: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: properties: matchExpressions: items: @@ -79,125 +191,73 @@ spec: - operator type: object type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - weight: - format: int32 - type: integer + namespaces: + items: + type: string + type: array + topologyKey: + type: string required: - - preference - - weight + - topologyKey type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: properties: matchExpressions: items: @@ -229,1146 +289,1294 @@ spec: required: - topologyKey type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: + matchExpressions: + items: + properties: + key: type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + operator: type: string - type: object - type: object - namespaces: - items: - type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object type: array - topologyKey: - type: string - required: - - topologyKey + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - azblob: - properties: - accessTier: - type: string - container: - type: string - path: - type: string - prefix: - type: string - secretName: - type: string - type: object - backoffRetryPolicy: - properties: - maxRetryTimes: - type: integer - minRetryDuration: - type: string - retryTimeout: - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array type: object - backupMode: + type: object + azblob: + properties: + accessTier: type: string - backupType: + container: type: string - br: - properties: - checkRequirements: - type: boolean - checksum: - type: boolean - cluster: - type: string - clusterNamespace: - type: string - concurrency: - format: int32 - type: integer - db: - type: string - logLevel: - type: string - onLine: - type: boolean - options: - items: - type: string - type: array - rateLimit: - type: integer - sendCredToTikv: - type: boolean - statusAddr: - type: string - table: - type: string - timeAgo: - type: string - required: - - cluster - type: object - cleanOption: - properties: - backoffEnabled: - type: boolean - batchConcurrency: - format: int32 - type: integer - disableBatchConcurrency: - type: boolean - pageSize: - format: int64 - type: integer - retryCount: - type: integer - routineConcurrency: - format: int32 - type: integer - type: object - cleanPolicy: + path: type: string - commitTs: + prefix: type: string - dumpling: - properties: - options: - items: - type: string - type: array - tableFilter: - items: - type: string - type: array - type: object - env: + secretName: + type: string + type: object + backoffRetryPolicy: + properties: + maxRetryTimes: + type: integer + minRetryDuration: + type: string + retryTimeout: + type: string + type: object + backupMode: + type: string + backupType: + type: string + br: + properties: + checkRequirements: + type: boolean + checksum: + type: boolean + cluster: + type: string + clusterNamespace: + type: string + concurrency: + format: int32 + type: integer + db: + type: string + logLevel: + type: string + onLine: + type: boolean + options: + items: + type: string + type: array + rateLimit: + type: integer + sendCredToTikv: + type: boolean + statusAddr: + type: string + table: + type: string + timeAgo: + type: string + required: + - cluster + type: object + cleanOption: + properties: + backoffEnabled: + type: boolean + batchConcurrency: + format: int32 + type: integer + disableBatchConcurrency: + type: boolean + pageSize: + format: int64 + type: integer + retryCount: + type: integer + routineConcurrency: + format: int32 + type: integer + type: object + cleanPolicy: + type: string + commitTs: + type: string + dumpling: + properties: + options: + items: + type: string + type: array + tableFilter: items: + type: string + type: array + type: object + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: properties: - name: - type: string - value: - type: string - valueFrom: + configMapKeyRef: properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key type: object - required: - - name type: object - type: array - from: - properties: - host: - type: string - port: - format: int32 - type: integer - secretName: - type: string - tlsClientSecretName: - type: string - user: - type: string - required: - - host - - secretName - type: object - gcs: - properties: - bucket: - type: string - bucketAcl: - type: string - location: - type: string - objectAcl: - type: string - path: - type: string - prefix: - type: string - projectId: - type: string - secretName: - type: string - storageClass: - type: string - required: - - projectId - type: object - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - local: + required: + - name + type: object + type: array + federalVolumeBackupPhase: + type: string + from: + properties: + host: + type: string + port: + format: int32 + type: integer + secretName: + type: string + tlsClientSecretName: + type: string + user: + type: string + required: + - host + - secretName + type: object + gcs: + properties: + bucket: + type: string + bucketAcl: + type: string + location: + type: string + objectAcl: + type: string + path: + type: string + prefix: + type: string + projectId: + type: string + secretName: + type: string + storageClass: + type: string + required: + - projectId + type: object + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + local: + properties: + prefix: + type: string + volume: properties: - prefix: - type: string - volume: + awsElasticBlockStore: properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: + name: type: string - readOnly: - type: boolean - required: - - diskName - - diskURI type: object - azureFile: + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - readOnly: - type: boolean - secretName: - type: string - shareName: + name: type: string - required: - - secretName - - shareName type: object - cephfs: - properties: - monitors: - items: + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: type: string - required: - - monitors type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: + mode: + format: int32 + type: integer + path: type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + resourceFieldRef: properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + containerName: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + readOnly: + type: boolean + volumeClaimTemplate: + properties: + metadata: + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: anyOf: - type: integer - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - readOnly: - type: boolean - volumeClaimTemplate: - properties: - metadata: + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object type: object - spec: + selector: properties: - accessModes: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object + matchLabels: + additionalProperties: + type: string type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: + storageClassName: + type: string + volumeMode: + type: string + volumeName: type: string type: object required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName + - spec type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string type: object - glusterfs: + readOnly: + type: boolean + secretRef: properties: - endpoints: - type: string - path: + name: type: string - readOnly: - type: boolean - required: - - endpoints - - path type: object - hostPath: + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: properties: - path: - type: string - type: + name: type: string - required: - - path type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: + targetPortal: type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: properties: - configMap: - properties: - items: - items: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: properties: - key: - type: string - mode: - format: int32 - type: integer - path: + apiVersion: type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + fieldPath: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object required: - - path + - fieldPath type: object - type: array - type: object - secret: - properties: - items: - items: + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: properties: - key: + containerName: type: string - mode: - format: int32 - type: integer - path: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string required: - - key - - path + - resource type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object + required: + - path + type: object + type: array type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + secret: properties: - key: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: type: string - mode: - format: int32 + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 type: integer path: type: string required: - - key - path type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name + type: object + type: array type: object - volumeMount: + quobyte: properties: - mountPath: - type: string - mountPropagation: - type: string - name: + group: type: string readOnly: type: boolean - subPath: + registry: type: string - subPathExpr: + tenant: + type: string + user: + type: string + volume: type: string required: - - mountPath - - name + - registry + - volume type: object - required: - - volume - - volumeMount - type: object - logStop: - type: boolean - logTruncateUntil: - type: string - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: + rbd: properties: - level: + fsType: type: string - role: + image: type: string - type: + keyring: + type: string + monitors: + items: + type: string + type: array + pool: type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object user: type: string + required: + - image + - monitors type: object - seccompProfile: + scaleIO: properties: - localhostProfile: + fsType: type: string - type: + gateway: type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: + protectionDomain: type: string - gmsaCredentialSpecName: + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: type: string - runAsUserName: + storagePool: type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system type: object - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name type: object - s3: + volumeMount: properties: - acl: + mountPath: type: string - bucket: + mountPropagation: type: string - endpoint: + name: type: string - options: - items: - type: string - type: array - path: + readOnly: + type: boolean + subPath: type: string - prefix: + subPathExpr: type: string - provider: + required: + - mountPath + - name + type: object + required: + - volume + - volumeMount + type: object + logStop: + type: boolean + logTruncateUntil: + type: string + podSecurityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: type: string - region: + role: type: string - secretName: + type: type: string - sse: + user: type: string - storageClass: + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: type: string required: - - provider + - type type: object - serviceAccount: - type: string - storageClassName: - type: string - storageSize: - type: string - tableFilter: + supplementalGroups: items: - type: string + format: int64 + type: integer type: array - tikvGCLifeTime: - type: string - tolerations: + sysctls: items: properties: - effect: - type: string - key: - type: string - operator: + name: type: string - tolerationSeconds: - format: int64 - type: integer value: type: string + required: + - name + - value type: object type: array - toolImage: + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + runAsUserName: + type: string + type: object + type: object + priorityClassName: + type: string + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + s3: + properties: + acl: type: string - useKMS: - type: boolean + bucket: + type: string + endpoint: + type: string + options: + items: + type: string + type: array + path: + type: string + prefix: + type: string + provider: + type: string + region: + type: string + secretName: + type: string + sse: + type: string + storageClass: + type: string + required: + - provider type: object - imagePullSecrets: + serviceAccount: + type: string + storageClassName: + type: string + storageSize: + type: string + tableFilter: + items: + type: string + type: array + tikvGCLifeTime: + type: string + tolerations: items: properties: - name: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: type: string type: object type: array - logBackupTemplate: + toolImage: + type: string + useKMS: + type: boolean + type: object + status: + properties: + backoffRetryStatus: + items: + properties: + detectFailedAt: + format: date-time + type: string + expectedRetryAt: + format: date-time + type: string + originalReason: + type: string + realRetryAt: + format: date-time + type: string + retryNum: + type: integer + retryReason: + type: string + type: object + type: array + backupPath: + type: string + backupSize: + format: int64 + type: integer + backupSizeReadable: + type: string + commitTs: + type: string + conditions: + items: + properties: + command: + type: string + lastTransitionTime: + format: date-time + nullable: true + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + nullable: true + type: array + logCheckpointTs: + type: string + logSubCommandStatuses: + additionalProperties: + properties: + command: + type: string + conditions: + items: + properties: + command: + type: string + lastTransitionTime: + format: date-time + nullable: true + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - status + - type + type: object + nullable: true + type: array + logTruncatingUntil: + type: string + phase: + type: string + timeCompleted: + format: date-time + nullable: true + type: string + timeStarted: + format: date-time + nullable: true + type: string + type: object + type: object + logSuccessTruncateUntil: + type: string + phase: + type: string + progresses: + items: + properties: + lastTransitionTime: + format: date-time + nullable: true + type: string + progress: + type: number + step: + type: string + type: object + nullable: true + type: array + timeCompleted: + format: date-time + nullable: true + type: string + timeStarted: + format: date-time + nullable: true + type: string + type: object + required: + - metadata + - spec + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.2 + creationTimestamp: null + name: backupschedules.pingcap.com +spec: + additionalPrinterColumns: + - JSONPath: .spec.schedule + description: The cron format string used for backup scheduling + name: Schedule + type: string + - JSONPath: .spec.maxBackups + description: The max number of backups we want to keep + name: MaxBackups + type: integer + - JSONPath: .status.lastBackup + description: The last backup CR name + name: LastBackup + priority: 1 + type: string + - JSONPath: .status.lastBackupTime + description: The last time the backup was successfully created + name: LastBackupTime + priority: 1 + type: date + - JSONPath: .metadata.creationTimestamp + name: Age + type: date + group: pingcap.com + names: + kind: BackupSchedule + listKind: BackupScheduleList + plural: backupschedules + shortNames: + - bks + singular: backupschedule + preserveUnknownFields: false + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + backupTemplate: properties: affinity: properties: @@ -1787,6 +1995,8 @@ spec: - name type: object type: array + federalVolumeBackupPhase: + type: string from: properties: host: @@ -2677,227 +2887,23 @@ spec: useKMS: type: boolean type: object - maxBackups: - format: int32 - type: integer - maxReservedTime: - type: string - pause: - type: boolean - schedule: - type: string - storageClassName: - type: string - storageSize: - type: string - required: - - logBackupTemplate - - schedule - type: object - status: - properties: - allBackupCleanTime: - format: date-time - type: string - lastBackup: - type: string - lastBackupTime: - format: date-time - type: string - logBackup: - type: string - type: object - required: - - metadata - - spec - type: object - version: v1alpha1 - versions: - - name: v1alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.6.2 - creationTimestamp: null - name: backups.pingcap.com -spec: - additionalPrinterColumns: - - JSONPath: .spec.backupType - description: the type of backup, such as full, db, table. Only used when Mode - = snapshot. - name: Type - type: string - - JSONPath: .spec.backupMode - description: the mode of backup, such as snapshot, log. - name: Mode - type: string - - JSONPath: .status.phase - description: The current status of the backup - name: Status - type: string - - JSONPath: .status.backupPath - description: The full path of backup data - name: BackupPath - type: string - - JSONPath: .status.backupSizeReadable - description: The data size of the backup - name: BackupSize - type: string - - JSONPath: .status.commitTs - description: The commit ts of the backup - name: CommitTS - type: string - - JSONPath: .status.logSuccessTruncateUntil - description: The log backup truncate until ts - name: LogTruncateUntil - type: string - - JSONPath: .status.timeStarted - description: The time at which the backup was started - name: Started - priority: 1 - type: date - - JSONPath: .status.timeCompleted - description: The time at which the backup was completed - name: Completed - priority: 1 - type: date - - JSONPath: .metadata.creationTimestamp - name: Age - type: date - group: pingcap.com - names: - kind: Backup - listKind: BackupList - plural: backups - shortNames: - - bk - singular: backup - preserveUnknownFields: false - scope: Namespaced - subresources: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - affinity: + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + logBackupTemplate: properties: - nodeAffinity: + affinity: properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: + nodeAffinity: properties: - nodeSelectorTerms: + preferredDuringSchedulingIgnoredDuringExecution: items: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: + preference: properties: matchExpressions: items: @@ -2915,75 +2921,7 @@ spec: - operator type: object type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: + matchFields: items: properties: key: @@ -2999,1234 +2937,1302 @@ spec: - operator type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey + weight: + format: int32 + type: integer + required: + - preference + - weight type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - matchExpressions: - items: - properties: - key: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: type: string - operator: + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + type: object + type: object + namespaces: + items: type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + type: object type: object - type: object - azblob: - properties: - accessTier: - type: string - container: - type: string - path: - type: string - prefix: - type: string - secretName: - type: string - type: object - backoffRetryPolicy: - properties: - maxRetryTimes: - type: integer - minRetryDuration: - type: string - retryTimeout: - type: string - type: object - backupMode: - type: string - backupType: - type: string - br: - properties: - checkRequirements: - type: boolean - checksum: - type: boolean - cluster: - type: string - clusterNamespace: - type: string - concurrency: - format: int32 - type: integer - db: - type: string - logLevel: + azblob: + properties: + accessTier: + type: string + container: + type: string + path: + type: string + prefix: + type: string + secretName: + type: string + type: object + backoffRetryPolicy: + properties: + maxRetryTimes: + type: integer + minRetryDuration: + type: string + retryTimeout: + type: string + type: object + backupMode: type: string - onLine: - type: boolean - options: - items: - type: string - type: array - rateLimit: - type: integer - sendCredToTikv: - type: boolean - statusAddr: + backupType: type: string - table: + br: + properties: + checkRequirements: + type: boolean + checksum: + type: boolean + cluster: + type: string + clusterNamespace: + type: string + concurrency: + format: int32 + type: integer + db: + type: string + logLevel: + type: string + onLine: + type: boolean + options: + items: + type: string + type: array + rateLimit: + type: integer + sendCredToTikv: + type: boolean + statusAddr: + type: string + table: + type: string + timeAgo: + type: string + required: + - cluster + type: object + cleanOption: + properties: + backoffEnabled: + type: boolean + batchConcurrency: + format: int32 + type: integer + disableBatchConcurrency: + type: boolean + pageSize: + format: int64 + type: integer + retryCount: + type: integer + routineConcurrency: + format: int32 + type: integer + type: object + cleanPolicy: type: string - timeAgo: + commitTs: type: string - required: - - cluster - type: object - cleanOption: - properties: - backoffEnabled: - type: boolean - batchConcurrency: - format: int32 - type: integer - disableBatchConcurrency: - type: boolean - pageSize: - format: int64 - type: integer - retryCount: - type: integer - routineConcurrency: - format: int32 - type: integer - type: object - cleanPolicy: - type: string - commitTs: - type: string - dumpling: - properties: - options: - items: - type: string - type: array - tableFilter: + dumpling: + properties: + options: + items: + type: string + type: array + tableFilter: + items: + type: string + type: array + type: object + env: items: - type: string - type: array - type: object - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: + name: + type: string + value: + type: string + valueFrom: properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object type: object + required: + - name type: object - required: - - name - type: object - type: array - from: - properties: - host: - type: string - port: - format: int32 - type: integer - secretName: - type: string - tlsClientSecretName: - type: string - user: - type: string - required: - - host - - secretName - type: object - gcs: - properties: - bucket: - type: string - bucketAcl: - type: string - location: - type: string - objectAcl: - type: string - path: - type: string - prefix: - type: string - projectId: - type: string - secretName: - type: string - storageClass: - type: string - required: - - projectId - type: object - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - local: - properties: - prefix: + type: array + federalVolumeBackupPhase: type: string - volume: + from: properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: + host: + type: string + port: + format: int32 + type: integer + secretName: + type: string + tlsClientSecretName: + type: string + user: + type: string + required: + - host + - secretName + type: object + gcs: + properties: + bucket: + type: string + bucketAcl: + type: string + location: + type: string + objectAcl: + type: string + path: + type: string + prefix: + type: string + projectId: + type: string + secretName: + type: string + storageClass: + type: string + required: + - projectId + type: object + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + local: + properties: + prefix: + type: string + volume: + properties: + awsElasticBlockStore: properties: - name: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: type: string + required: + - volumeID type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: + azureDisk: properties: - name: + cachingMode: + type: string + diskName: type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: + azureFile: properties: - name: + readOnly: + type: boolean + secretName: type: string + shareName: + type: string + required: + - secretName + - shareName type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: + cephfs: + properties: + monitors: + items: type: string - resourceFieldRef: + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - containerName: + key: type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: + mode: + format: int32 + type: integer + path: type: string required: - - resource + - key + - path type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - readOnly: - type: boolean - volumeClaimTemplate: + type: array + name: + type: string + optional: + type: boolean + type: object + csi: properties: - metadata: - type: object - spec: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: anyOf: - type: integer - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - type: object + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + readOnly: + type: boolean + volumeClaimTemplate: + properties: + metadata: type: object - selector: + spec: properties: - matchExpressions: + accessModes: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object + storageClassName: + type: string + volumeMode: + type: string + volumeName: + type: string type: object - storageClassName: - type: string - volumeMode: + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: type: string - volumeName: + type: object + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: type: string type: object + targetPortal: + type: string required: - - spec + - iqn + - lun + - targetPortal type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: + name: type: string - options: - additionalProperties: - type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server type: object - readOnly: - type: boolean - secretRef: + persistentVolumeClaim: properties: - name: + claimName: type: string + readOnly: + type: boolean + required: + - claimName type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: + photonPersistentDisk: properties: - name: + fsType: + type: string + pdID: type: string + required: + - pdID type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: properties: - items: - items: - properties: - fieldRef: + configMap: + properties: + items: + items: properties: - apiVersion: + key: type: string - fieldPath: + mode: + format: int32 + type: integer + path: type: string required: - - fieldPath + - key + - path type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: properties: - containerName: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + mode: + format: int32 + type: integer + path: type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: type: string required: - - resource + - key + - path type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object type: object - serviceAccountToken: + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: + key: type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: properties: - name: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: type: string type: object - user: - type: string + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object required: - - image - - monitors + - name type: object - scaleIO: + volumeMount: properties: - fsType: + mountPath: type: string - gateway: + mountPropagation: type: string - protectionDomain: + name: type: string readOnly: type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: + subPath: type: string - volumeName: + subPathExpr: type: string required: - - gateway - - secretRef - - system + - mountPath + - name type: object - secret: + required: + - volume + - volumeMount + type: object + logStop: + type: boolean + logTruncateUntil: + type: string + podSecurityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: + level: type: string - type: object - storageos: - properties: - fsType: + role: type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: + type: type: string - volumeNamespace: + user: type: string type: object - vsphereVolume: + seccompProfile: properties: - fsType: + localhostProfile: type: string - storagePolicyID: + type: type: string - storagePolicyName: + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: type: string - volumePath: + gmsaCredentialSpecName: + type: string + runAsUserName: type: string - required: - - volumePath type: object - required: - - name type: object - volumeMount: + priorityClassName: + type: string + resources: properties: - mountPath: - type: string - mountPropagation: - type: string - name: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + s3: + properties: + acl: type: string - readOnly: - type: boolean - subPath: + bucket: type: string - subPathExpr: + endpoint: type: string - required: - - mountPath - - name - type: object - required: - - volume - - volumeMount - type: object - logStop: - type: boolean - logTruncateUntil: - type: string - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: + options: + items: + type: string + type: array + path: type: string - role: + prefix: type: string - type: + provider: type: string - user: + region: type: string - type: object - seccompProfile: - properties: - localhostProfile: + secretName: type: string - type: + sse: + type: string + storageClass: type: string required: - - type + - provider type: object - supplementalGroups: + serviceAccount: + type: string + storageClassName: + type: string + storageSize: + type: string + tableFilter: items: - format: int64 - type: integer + type: string type: array - sysctls: + tikvGCLifeTime: + type: string + tolerations: items: properties: - name: + effect: type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer value: type: string - required: - - name - - value type: object type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - s3: - properties: - acl: - type: string - bucket: - type: string - endpoint: - type: string - options: - items: - type: string - type: array - path: - type: string - prefix: - type: string - provider: - type: string - region: - type: string - secretName: - type: string - sse: - type: string - storageClass: + toolImage: type: string - required: - - provider + useKMS: + type: boolean type: object - serviceAccount: + maxBackups: + format: int32 + type: integer + maxReservedTime: + type: string + pause: + type: boolean + schedule: type: string storageClassName: type: string storageSize: type: string - tableFilter: - items: - type: string - type: array - tikvGCLifeTime: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - toolImage: - type: string - useKMS: - type: boolean + required: + - logBackupTemplate + - schedule type: object status: properties: - backoffRetryStatus: - items: - properties: - detectFailedAt: - format: date-time - type: string - expectedRetryAt: - format: date-time - type: string - originalReason: - type: string - realRetryAt: - format: date-time - type: string - retryNum: - type: integer - retryReason: - type: string - type: object - type: array - backupPath: - type: string - backupSize: - format: int64 - type: integer - backupSizeReadable: - type: string - commitTs: - type: string - conditions: - items: - properties: - command: - type: string - lastTransitionTime: - format: date-time - nullable: true - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - nullable: true - type: array - logCheckpointTs: - type: string - logSubCommandStatuses: - additionalProperties: - properties: - command: - type: string - conditions: - items: - properties: - command: - type: string - lastTransitionTime: - format: date-time - nullable: true - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - nullable: true - type: array - logTruncatingUntil: - type: string - phase: - type: string - timeCompleted: - format: date-time - nullable: true - type: string - timeStarted: - format: date-time - nullable: true - type: string - type: object - type: object - logSuccessTruncateUntil: + allBackupCleanTime: + format: date-time type: string - phase: + lastBackup: type: string - progresses: - items: - properties: - lastTransitionTime: - format: date-time - nullable: true - type: string - progress: - type: number - step: - type: string - type: object - nullable: true - type: array - timeCompleted: + lastBackupTime: format: date-time - nullable: true type: string - timeStarted: - format: date-time - nullable: true + logBackup: type: string type: object required: @@ -12622,6 +12628,8 @@ spec: - name type: object type: array + federalVolumeRestorePhase: + type: string gcs: properties: bucket: diff --git a/pkg/apis/pingcap/v1alpha1/backup.go b/pkg/apis/pingcap/v1alpha1/backup.go index 5dfa94e616..b7ca5faf69 100644 --- a/pkg/apis/pingcap/v1alpha1/backup.go +++ b/pkg/apis/pingcap/v1alpha1/backup.go @@ -50,6 +50,11 @@ func (bk *Backup) GetBackupJobName() string { return fmt.Sprintf("backup-%s", bk.GetName()) } +func (bk *Backup) GetVolumeBackupInitializeJobName() string { + backupJobName := bk.GetBackupJobName() + return fmt.Sprintf("%s-assistant", backupJobName) +} + // GetAllLogBackupJobName return the all log backup job name func (bk *Backup) GetAllLogBackupJobName() []string { return []string{ @@ -220,6 +225,33 @@ func IsBackupPrepared(backup *Backup) bool { return condition != nil && condition.Status == corev1.ConditionTrue } +// IsVolumeBackupInitialized returns true if volume backup is initialized +func IsVolumeBackupInitialized(backup *Backup) bool { + if backup.Spec.Mode != BackupModeVolumeSnapshot { + return false + } + _, condition := GetBackupCondition(&backup.Status, VolumeBackupInitialized) + return condition != nil && condition.Status == corev1.ConditionTrue +} + +// IsVolumeBackupInitializeFailed returns true if volume backup is initialized failed +func IsVolumeBackupInitializeFailed(backup *Backup) bool { + if backup.Spec.Mode != BackupModeVolumeSnapshot { + return false + } + _, condition := GetBackupCondition(&backup.Status, VolumeBackupInitializeFailed) + return condition != nil && condition.Status == corev1.ConditionTrue +} + +// IsVolumeBackupFailed returns true if volume backup is initialized failed +func IsVolumeBackupFailed(backup *Backup) bool { + if backup.Spec.Mode != BackupModeVolumeSnapshot { + return false + } + _, condition := GetBackupCondition(&backup.Status, VolumeBackupFailed) + return condition != nil && condition.Status == corev1.ConditionTrue +} + // IsLogBackupStopped returns true if a log backup is stopped. // It means log backup is at stopped status. // It used to filter CR update event which is stop command and stopped status, and let it run truncate after log backup stopped which is truncate command and stopped status. diff --git a/pkg/apis/pingcap/v1alpha1/openapi_generated.go b/pkg/apis/pingcap/v1alpha1/openapi_generated.go index 591291a196..92dc930c1b 100644 --- a/pkg/apis/pingcap/v1alpha1/openapi_generated.go +++ b/pkg/apis/pingcap/v1alpha1/openapi_generated.go @@ -1068,6 +1068,13 @@ func schema_pkg_apis_pingcap_v1alpha1_BackupSpec(ref common.ReferenceCallback) c Format: "", }, }, + "federalVolumeBackupPhase": { + SchemaProps: spec.SchemaProps{ + Description: "FederalVolumeBackupPhase indicates which phase to execute in federal volume backup", + Type: []string{"string"}, + Format: "", + }, + }, "dumpling": { SchemaProps: spec.SchemaProps{ Description: "DumplingConfig is the configs for dumpling", @@ -7408,6 +7415,13 @@ func schema_pkg_apis_pingcap_v1alpha1_RestoreSpec(ref common.ReferenceCallback) Format: "", }, }, + "federalVolumeRestorePhase": { + SchemaProps: spec.SchemaProps{ + Description: "FederalVolumeRestorePhase indicates which phase to execute in federal volume restore", + Type: []string{"string"}, + Format: "", + }, + }, "tikvGCLifeTime": { SchemaProps: spec.SchemaProps{ Description: "TikvGCLifeTime is to specify the safe gc life time for restore. The time limit during which data is retained for each GC, in the format of Go Duration. When a GC happens, the current time minus this value is the safe point.", diff --git a/pkg/apis/pingcap/v1alpha1/types.go b/pkg/apis/pingcap/v1alpha1/types.go index 613d996190..51e0d341e5 100644 --- a/pkg/apis/pingcap/v1alpha1/types.go +++ b/pkg/apis/pingcap/v1alpha1/types.go @@ -1944,6 +1944,9 @@ type BackupSpec struct { // LogStop indicates that will stop the log backup. // +optional LogStop bool `json:"logStop,omitempty"` + // FederalVolumeBackupPhase indicates which phase to execute in federal volume backup + // +optional + FederalVolumeBackupPhase FederalVolumeBackupPhase `json:"federalVolumeBackupPhase,omitempty"` // DumplingConfig is the configs for dumpling Dumpling *DumplingConfig `json:"dumpling,omitempty"` // Base tolerations of backup Pods, components may add more tolerations upon this respectively @@ -1982,6 +1985,18 @@ type BackupSpec struct { BackoffRetryPolicy BackoffRetryPolicy `json:"backoffRetryPolicy,omitempty"` } +// FederalVolumeBackupPhase represents a phase to execute in federal volume backup +type FederalVolumeBackupPhase string + +const ( + // FederalVolumeBackupInitialize means we should stop GC and PD schedule + FederalVolumeBackupInitialize FederalVolumeBackupPhase = "initialize" + // FederalVolumeBackupExecute means we should take volume snapshots for TiKV + FederalVolumeBackupExecute FederalVolumeBackupPhase = "execute" + // FederalVolumeBackupTeardown means we should resume GC and PD schedule + FederalVolumeBackupTeardown FederalVolumeBackupPhase = "teardown" +) + // +k8s:openapi-gen=true // DumplingConfig contains config for dumpling type DumplingConfig struct { @@ -2088,6 +2103,14 @@ const ( BackupStopped BackupConditionType = "Stopped" // BackupRestart means the backup was restarted, now just support snapshot backup BackupRestart BackupConditionType = "Restart" + // VolumeBackupInitialized means the volume backup has stopped GC and PD schedule + VolumeBackupInitialized BackupConditionType = "VolumeBackupInitialized" + // VolumeBackupInitializeFailed means the volume backup initialize job failed + VolumeBackupInitializeFailed BackupConditionType = "VolumeBackupInitializeFailed" + // VolumeBackupComplete means the volume backup has taken volume snapshots successfully + VolumeBackupComplete BackupConditionType = "VolumeBackupComplete" + // VolumeBackupFailed means the volume backup take volume snapshots failed + VolumeBackupFailed BackupConditionType = "VolumeBackupFailed" ) // BackupCondition describes the observed state of a Backup at a certain point. @@ -2305,6 +2328,8 @@ const ( // RestoreDataComplete means the Restore has successfully executed part-2 and the // data in restore volumes has been deal with consistency based on min_resolved_ts RestoreDataComplete RestoreConditionType = "DataComplete" + // RestoreTiKVComplete means in volume restore, all TiKV instances are started and up + RestoreTiKVComplete RestoreConditionType = "TikvComplete" // RestoreComplete means the Restore has successfully executed and the // backup data has been loaded into tidb cluster. RestoreComplete RestoreConditionType = "Complete" @@ -2361,6 +2386,9 @@ type RestoreSpec struct { PitrRestoredTs string `json:"pitrRestoredTs,omitempty"` // LogRestoreStartTs is the start timestamp which log restore from and it will be used in the future. LogRestoreStartTs string `json:"logRestoreStartTs,omitempty"` + // FederalVolumeRestorePhase indicates which phase to execute in federal volume restore + // +optional + FederalVolumeRestorePhase FederalVolumeRestorePhase `json:"federalVolumeRestorePhase,omitempty"` // TikvGCLifeTime is to specify the safe gc life time for restore. // The time limit during which data is retained for each GC, in the format of Go Duration. // When a GC happens, the current time minus this value is the safe point. @@ -2406,6 +2434,18 @@ type RestoreSpec struct { PriorityClassName string `json:"priorityClassName,omitempty"` } +// FederalVolumeRestorePhase represents a phase to execute in federal volume restore +type FederalVolumeRestorePhase string + +const ( + // FederalVolumeRestoreVolume means restore volumes of TiKV and start TiKV + FederalVolumeRestoreVolume FederalVolumeRestorePhase = "restore-volume" + // FederalVolumeRestoreData means restore data of TiKV to resolved TS + FederalVolumeRestoreData FederalVolumeRestorePhase = "restore-data" + // FederalVolumeRestoreFinish means restart TiKV and set recoveryMode true + FederalVolumeRestoreFinish FederalVolumeRestorePhase = "restore-finish" +) + // RestoreStatus represents the current status of a tidb cluster restore. type RestoreStatus struct { // TimeStarted is the time at which the restore was started. diff --git a/pkg/backup/backup/backup_manager.go b/pkg/backup/backup/backup_manager.go index 94350a4ad2..89b5f0a2ef 100644 --- a/pkg/backup/backup/backup_manager.go +++ b/pkg/backup/backup/backup_manager.go @@ -83,6 +83,14 @@ func (bm *backupManager) syncBackupJob(backup *v1alpha1.Backup) error { logBackupSubcommand := v1alpha1.ParseLogBackupSubcommand(backup) var err error + if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot { + // check volume backup initialize job, we should ensure the job is existed during volume backup + if err = bm.checkVolumeBackupInitializeJobExisted(backup); err != nil { + klog.Errorf("backup %s/%s check volume backup initialize job error %v.", ns, name, err) + return err + } + } + // validate backup if err = bm.validateBackup(backup); err != nil { klog.Errorf("backup %s/%s validate error %v.", ns, name, err) @@ -106,6 +114,15 @@ func (bm *backupManager) syncBackupJob(backup *v1alpha1.Backup) error { return err } + if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot && + backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupTeardown { + if err := bm.teardownVolumeBackup(backup); err != nil { + klog.Errorf("backup %s/%s teardown volume backup error %v.", ns, name, err) + return err + } + return nil + } + // make backup job var job *batchv1.Job var reason string @@ -142,7 +159,7 @@ func (bm *backupManager) validateBackup(backup *v1alpha1.Backup) error { logBackupSubcommand := v1alpha1.ParseLogBackupSubcommand(backup) var err error if backup.Spec.BR == nil { - err = backuputil.ValidateBackup(backup, "") + err = backuputil.ValidateBackup(backup, "", false) } else { backupNamespace := backup.GetNamespace() if backup.Spec.BR.ClusterNamespace != "" { @@ -164,7 +181,7 @@ func (bm *backupManager) validateBackup(backup *v1alpha1.Backup) error { } tikvImage := tc.TiKVImage() - err = backuputil.ValidateBackup(backup, tikvImage) + err = backuputil.ValidateBackup(backup, tikvImage, tc.AcrossK8s()) } if err != nil { @@ -181,12 +198,46 @@ func (bm *backupManager) validateBackup(backup *v1alpha1.Backup) error { return nil } +// checkVolumeBackupInitializeJobExisted check if volume backup initialized job is existed during volume backup +func (bm *backupManager) checkVolumeBackupInitializeJobExisted(backup *v1alpha1.Backup) error { + if backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupTeardown { + return nil + } + if !v1alpha1.IsVolumeBackupInitialized(backup) { + return nil + } + + ns := backup.GetNamespace() + name := backup.GetName() + initializeJobName := backup.GetVolumeBackupInitializeJobName() + _, err := bm.deps.JobLister.Jobs(ns).Get(initializeJobName) + if err != nil { + if !errors.IsNotFound(err) { + return fmt.Errorf("backup %s/%s get job %s failed, err: %v", ns, name, initializeJobName, err) + } + // volume backup initialize job was deleted during volume backup + // we can't ensure GC and PD schedules are stopped, set backup VolumeBackupInitializeFailed + updateErr := bm.statusUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.VolumeBackupInitializeFailed, + Status: corev1.ConditionTrue, + }, nil) + if updateErr != nil { + return updateErr + } + return controller.IgnoreErrorf("backup %s/%s job was deleted, set it VolumeBackupInitializeFailed", ns, name) + } + return nil +} + // skipBackupSync skip backup sync, if return true, backup can be skiped directly. func (bm *backupManager) skipBackupSync(backup *v1alpha1.Backup) (bool, error) { if backup.Spec.Mode == v1alpha1.BackupModeLog { return bm.skipLogBackupSync(backup) + } else if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot { + return bm.skipVolumeSnapshotBackupSync(backup) + } else { + return bm.skipSnapshotBackupSync(backup) } - return bm.skipSnapshotBackupSync(backup) } // waitPreTaskDone waits pre task done. @@ -459,6 +510,7 @@ func (bm *backupManager) makeExportJob(backup *v1alpha1.Backup) (*batchv1.Job, s func (bm *backupManager) makeBRBackupJob(backup *v1alpha1.Backup) (*batchv1.Job, string, error) { ns := backup.GetNamespace() name := backup.GetName() + jobName := backup.GetBackupJobName() backupNamespace := ns if backup.Spec.BR.ClusterNamespace != "" { backupNamespace = backup.Spec.BR.ClusterNamespace @@ -521,9 +573,14 @@ func (bm *backupManager) makeBRBackupJob(backup *v1alpha1.Backup) (*batchv1.Job, } } case v1alpha1.BackupModeVolumeSnapshot: - reason, err = bm.volumeSnapshotBackup(backup, tc) - if err != nil { - return nil, reason, fmt.Errorf("backup %s/%s, %v", ns, name, err) + if backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupExecute { + reason, err = bm.volumeSnapshotBackup(backup, tc) + if err != nil { + return nil, reason, fmt.Errorf("backup %s/%s, %v", ns, name, err) + } + } else if backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupInitialize { + jobName = backup.GetVolumeBackupInitializeJobName() + args = append(args, "--initialize=true") } args = append(args, fmt.Sprintf("--mode=%s", v1alpha1.BackupModeVolumeSnapshot)) default: @@ -650,9 +707,16 @@ func (bm *backupManager) makeBRBackupJob(backup *v1alpha1.Backup) (*batchv1.Job, }, } + // for volume backup initializing job, we should set resource requirement empty + // avoid it consuming too much resource + if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot && + backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupInitialize { + bm.setBackupPodResourceRequirementsEmpty(podSpec) + } + job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ - Name: backup.GetBackupJobName(), + Name: jobName, Namespace: ns, Labels: jobLabels, Annotations: jobAnnotations, @@ -669,6 +733,17 @@ func (bm *backupManager) makeBRBackupJob(backup *v1alpha1.Backup) (*batchv1.Job, return job, "", nil } +func (bm *backupManager) setBackupPodResourceRequirementsEmpty(podSpec *corev1.PodTemplateSpec) { + for _, c := range podSpec.Spec.InitContainers { + c.Resources.Requests = make(corev1.ResourceList, 0) + c.Resources.Limits = make(corev1.ResourceList, 0) + } + for _, c := range podSpec.Spec.Containers { + c.Resources.Requests = make(corev1.ResourceList, 0) + c.Resources.Limits = make(corev1.ResourceList, 0) + } +} + // save cluster meta to external storage since k8s size limitation on annotation/configMap func (bm *backupManager) saveClusterMetaToExternalStorage(b *v1alpha1.Backup, csb *snapshotter.CloudSnapBackup) (string, error) { @@ -827,6 +902,92 @@ func (bm *backupManager) skipLogBackupSync(backup *v1alpha1.Backup) (bool, error return skip, err } +// skipVolumeSnapshotBackupSync skip volume snapshot backup, returns true if can be skipped. +func (bm *backupManager) skipVolumeSnapshotBackupSync(backup *v1alpha1.Backup) (bool, error) { + if backup.Spec.Mode != v1alpha1.BackupModeVolumeSnapshot { + return false, nil + } + + ns := backup.GetNamespace() + name := backup.GetName() + var backupJobName string + switch backup.Spec.FederalVolumeBackupPhase { + case v1alpha1.FederalVolumeBackupInitialize, v1alpha1.FederalVolumeBackupTeardown: + backupJobName = backup.GetVolumeBackupInitializeJobName() + default: + backupJobName = backup.GetBackupJobName() + } + + _, err := bm.deps.JobLister.Jobs(ns).Get(backupJobName) + if err == nil { + // for teardown phase, we should delete the backup job, so we can't skip when job exists + return backup.Spec.FederalVolumeBackupPhase != v1alpha1.FederalVolumeBackupTeardown, nil + } + if !errors.IsNotFound(err) { + return false, fmt.Errorf("backup %s/%s get job %s failed, err: %v", ns, name, backupJobName, err) + } + return false, nil +} + +// teardownVolumeBackup delete the initializing job and set backup to complete status +func (bm *backupManager) teardownVolumeBackup(backup *v1alpha1.Backup) (err error) { + ns := backup.GetNamespace() + name := backup.GetName() + backupInitializeJobName := backup.GetVolumeBackupInitializeJobName() + jobCompleteOrFailed := false + + defer func() { + if err != nil { + return + } + + // if backup is failed or complete, just delete job, not modify status + if v1alpha1.IsBackupFailed(backup) || v1alpha1.IsBackupComplete(backup) { + return + } + backupCondition := v1alpha1.BackupComplete + // if volume backup failed in previous phase, we should set backup failed + if v1alpha1.IsVolumeBackupInitializeFailed(backup) || v1alpha1.IsVolumeBackupFailed(backup) { + backupCondition = v1alpha1.BackupFailed + } + // if job exists but isn't running, we can't ensure GC and PD schedules are stopped during volume backup + // the volume snapshots are invalid, we should set backup failed + if !jobCompleteOrFailed { + backupCondition = v1alpha1.BackupFailed + } + err = bm.statusUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: backupCondition, + Status: corev1.ConditionTrue, + }, nil) + }() + + backupInitializeJob, err := bm.deps.JobLister.Jobs(ns).Get(backupInitializeJobName) + if err != nil { + if errors.IsNotFound(err) { + return nil + } + return fmt.Errorf("backup %s/%s get initializing job %s failed, err: %v", + ns, name, backupInitializeJobName, err) + } + + for _, condition := range backupInitializeJob.Status.Conditions { + if condition.Type == batchv1.JobFailed || condition.Type == batchv1.JobComplete { + jobCompleteOrFailed = true + break + } + } + if jobCompleteOrFailed { + return nil + } + + // delete the initializing job to resume GC and PD schedules + if err := bm.deps.JobControl.DeleteJob(backup, backupInitializeJob); err != nil { + return fmt.Errorf("backup %s/%s delete initializing job %s failed, err: %v", + ns, name, backupInitializeJobName, err) + } + return nil +} + // shouldLogBackupCommandRequeue returns whether log backup subcommand should requeue. // truncate and stop should wait start complete, otherwise, we should requeue this key. func shouldLogBackupCommandRequeue(backup *v1alpha1.Backup) bool { @@ -841,12 +1002,17 @@ func shouldLogBackupCommandRequeue(backup *v1alpha1.Backup) bool { return false } +<<<<<<< HEAD // waitOldLogBackupJobDone wait old log backup job done func waitOldLogBackupJobDone(ns, name, backupJobName string, bm *backupManager, backup *v1alpha1.Backup, oldJob *batchv1.Job) error { if backup.Spec.Mode != v1alpha1.BackupModeLog { return nil } +======= +// waitOldBackupJobDone wait old backup job done +func waitOldBackupJobDone(ns, name, backupJobName string, bm *backupManager, backup *v1alpha1.Backup, oldJob *batchv1.Job) error { +>>>>>>> a0f6db4ae (br: refactor volume snapshot backup to support across k8s clusters (#4999)) if oldJob.DeletionTimestamp != nil { return controller.RequeueErrorf(fmt.Sprintf("log backup %s/%s job %s is being deleted", ns, name, backupJobName)) } @@ -858,11 +1024,22 @@ func waitOldLogBackupJobDone(ns, name, backupJobName string, bm *backupManager, } } if finished { +<<<<<<< HEAD klog.Infof("log backup %s/%s job %s has complete or failed, will delete job", ns, name, backupJobName) +======= + // when teardown volume snapshot backup, just wait execution job done, don't need to delete the execution job + if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot && + backup.Spec.FederalVolumeBackupPhase == v1alpha1.FederalVolumeBackupTeardown { + return nil + } + + klog.Infof("backup %s/%s job %s has complete or failed, will delete job", ns, name, backupJobName) +>>>>>>> a0f6db4ae (br: refactor volume snapshot backup to support across k8s clusters (#4999)) if err := bm.deps.JobControl.DeleteJob(backup, oldJob); err != nil { return fmt.Errorf("log backup %s/%s delete job %s failed, err: %v", ns, name, backupJobName, err) } } + // job running no need to requeue, because delete job will call update and it will requeue return controller.IgnoreErrorf("log backup %s/%s job %s is running, will be ignored", ns, name, backupJobName) } diff --git a/pkg/backup/util/util.go b/pkg/backup/util/util.go index 0135f7609c..fde7793b75 100644 --- a/pkg/backup/util/util.go +++ b/pkg/backup/util/util.go @@ -16,6 +16,7 @@ package util import ( "context" "encoding/json" + "errors" "fmt" "net/url" "path" @@ -467,7 +468,7 @@ func validateAccessConfig(config *v1alpha1.TiDBAccessConfig) string { } // ValidateBackup validates backup sepc -func ValidateBackup(backup *v1alpha1.Backup, tikvImage string) error { +func ValidateBackup(backup *v1alpha1.Backup, tikvImage string, acrossK8s bool) error { ns := backup.Namespace name := backup.Name @@ -538,6 +539,14 @@ func ValidateBackup(backup *v1alpha1.Backup, tikvImage string) error { } } + // validate volume snapshot backup + if backup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot { + // only support across k8s now. TODO compatible for single k8s + if !acrossK8s { + return errors.New("only support volume snapshot backup across k8s clusters") + } + } + if backup.Spec.BackoffRetryPolicy.MinRetryDuration != "" { _, err := time.ParseDuration(backup.Spec.BackoffRetryPolicy.MinRetryDuration) if err != nil { diff --git a/pkg/backup/util/utils_test.go b/pkg/backup/util/utils_test.go index f41c87630d..04527afb49 100644 --- a/pkg/backup/util/utils_test.go +++ b/pkg/backup/util/utils_test.go @@ -469,7 +469,7 @@ func TestValidateBackup(t *testing.T) { backup := new(v1alpha1.Backup) match := func(sub string) { t.Helper() - err := ValidateBackup(backup, "tikv:v4.0.8") + err := ValidateBackup(backup, "tikv:v4.0.8", false) if sub == "" { g.Expect(err).Should(BeNil()) } else { diff --git a/pkg/controller/backup/backup_controller.go b/pkg/controller/backup/backup_controller.go index d74d33708d..c9579ddb32 100644 --- a/pkg/controller/backup/backup_controller.go +++ b/pkg/controller/backup/backup_controller.go @@ -180,6 +180,12 @@ func (c *Controller) updateBackup(cur interface{}) { return } + // volume backup has multiple phases, we should always reconcile it before it is complete or failed + if newBackup.Spec.Mode == v1alpha1.BackupModeVolumeSnapshot { + klog.V(4).Infof("backup object %s/%s enqueue", ns, name) + c.enqueueBackup(newBackup) + } + if v1alpha1.IsBackupScheduled(newBackup) || v1alpha1.IsBackupRunning(newBackup) || v1alpha1.IsBackupPrepared(newBackup) || v1alpha1.IsLogBackupStopped(newBackup) { klog.V(4).Infof("backup %s/%s is already Scheduled, Running, Preparing or Failed, skipping.", ns, name) // TODO: log backup check all subcommand job's pod status