Skip to main content
Version: Preview

Backup API Reference


Packages:

dataprotection.kubeblocks.io/v1alpha1

Resource Types:

ActionSet

ActionSet is the Schema for the actionsets API

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
ActionSet
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ActionSetSpec


backupType
BackupType

backupType specifies the backup type, supported values:

  • Full means full backup.
  • Incremental means back up data that have changed since the last backup (full or incremental).
  • Differential means back up data that have changed since the last full backup.
  • Continuous will back up the transaction log continuously, the PITR (Point in Time Recovery) can be performed based on the continuous backup and full backup.
env
[]Kubernetes core/v1.EnvVar
(Optional)

List of environment variables to set in the container.

envFrom
[]Kubernetes core/v1.EnvFromSource
(Optional)

List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

backup
BackupActionSpec
(Optional)

backup specifies the backup action.

restore
RestoreActionSpec
(Optional)

restore specifies the restore action.

status
ActionSetStatus

Backup

Backup is the Schema for the backups API.

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
Backup
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
BackupSpec


backupPolicyName
string

Which backupPolicy is applied to perform this backup.

backupMethod
string

backupMethod specifies the backup method name that is defined in backupPolicy.

deletionPolicy
BackupDeletionPolicy

deletionPolicy determines whether the backup contents stored in backup repository should be deleted when the backup custom resource is deleted. Supported values are Retain and Delete.

  • Retain means that the backup content and its physical snapshot on backup repository are kept.
  • Delete means that the backup content and its physical snapshot on backup repository are deleted.

the backup custom objects but retaining the backup contents in backup repository. The current implementation only prevent accidental deletion of backup data.

retentionPeriod
RetentionPeriod
(Optional)

retentionPeriod determines a duration up to which the backup should be kept. Controller will remove all backups that are older than the RetentionPeriod. For example, RetentionPeriod of 30d will keep only the backups of last 30 days. Sample duration format:

  • years: 2y
  • months: 6mo
  • days: 30d
  • hours: 12h
  • minutes: 30m

You can also combine the above durations. For example: 30d12h30m. If not set, the backup will be kept forever.

parentBackupName
string
(Optional)

parentBackupName determines the parent backup name for incremental or differential backup.

status
BackupStatus

BackupPolicy

BackupPolicy is the Schema for the backuppolicies API.

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
BackupPolicy
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
BackupPolicySpec


backupRepoName
string
(Optional)

backupRepoName is the name of BackupRepo and the backup data will be stored in this repository. If not set, will be stored in the default backup repository.

pathPrefix
string
(Optional)

pathPrefix is the directory inside the backup repository to store the backup content. It is a relative to the path of the backup repository.

backoffLimit
int32
(Optional)

Specifies the number of retries before marking the backup failed.

target
BackupTarget

target specifies the target information to back up.

backupMethods
[]BackupMethod

backupMethods defines the backup methods.

useKopia
bool
(Optional)

useKopia specifies whether backup data should be stored in a Kopia repository.

Data within the Kopia repository is both compressed and encrypted. Furthermore, data deduplication is implemented across various backups of the same cluster. This approach significantly reduces the actual storage usage, particularly for clusters with a low update frequency.

NOTE: This feature should NOT be enabled when using KubeBlocks Community Edition, otherwise the backup will not be processed.

status
BackupPolicyStatus

BackupRepo

BackupRepo is a repository for storing backup data.

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
BackupRepo
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
BackupRepoSpec


storageProviderRef
string

Specifies the name of the StorageProvider used by this backup repository.

accessMethod
AccessMethod
(Optional)

Specifies the access method of the backup repository.

volumeCapacity
Kubernetes resource.Quantity
(Optional)

Specifies the capacity of the PVC created by this backup repository.

pvReclaimPolicy
Kubernetes core/v1.PersistentVolumeReclaimPolicy

Specifies reclaim policy of the PV created by this backup repository.

config
map[string]string
(Optional)

Stores the non-secret configuration parameters for the StorageProvider.

credential
Kubernetes core/v1.SecretReference
(Optional)

References to the secret that holds the credentials for the StorageProvider.

status
BackupRepoStatus

BackupSchedule

BackupSchedule is the Schema for the backupschedules API.

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
BackupSchedule
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
BackupScheduleSpec


backupPolicyName
string

Which backupPolicy is applied to perform this backup.

startingDeadlineMinutes
int64
(Optional)

startingDeadlineMinutes defines the deadline in minutes for starting the backup workload if it misses scheduled time for any reason.

schedules
[]SchedulePolicy

schedules defines the list of backup schedules.

status
BackupScheduleStatus

Restore

Restore is the Schema for the restores API

FieldDescription
apiVersion
string
dataprotection.kubeblocks.io/v1alpha1
kind
string
Restore
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
RestoreSpec


backup
BackupRef

backup to be restored. The restore behavior based on the backup type:

  1. Full: will be restored the full backup directly.
  2. Incremental: will be restored sequentially from the most recent full backup of this incremental backup.
  3. Differential: will be restored sequentially from the parent backup of the differential backup.
  4. Continuous: will find the most recent full backup at this time point and the continuous backups after it to restore.
restoreTime
string
(Optional)

restoreTime is the point in time for restoring.

resources
RestoreKubeResources
(Optional)

restore the specified resources of kubernetes.

prepareDataConfig
PrepareDataConfig
(Optional)

configuration for the action of “prepareData” phase, including the persistent volume claims that need to be restored and scheduling strategy of temporary recovery pod.

serviceAccountName
string
(Optional)

service account name which needs for recovery pod.

readyConfig
ReadyConfig
(Optional)

configuration for the action of “postReady” phase.

env
[]Kubernetes core/v1.EnvVar
(Optional)

list of environment variables to set in the container for restore and will be merged with the env of Backup and ActionSet.

The priority of merging is as follows: Restore env > Backup env > ActionSet env.

containerResources
Kubernetes core/v1.ResourceRequirements
(Optional)

specified the required resources of restore job’s container.

backoffLimit
int32
(Optional)

Specifies the number of retries before marking the restore failed.

status
RestoreStatus

AccessMethod (string alias)

(Appears on:BackupRepoSpec)

AccessMethod represents an enumeration type that outlines how the BackupRepo can be accessed.

ValueDescription

"Mount"

AccessMethodMount suggests that the storage is mounted locally which allows for remote files to be accessed akin to local ones.

"Tool"

AccessMethodTool indicates the utilization of a command-line tool for accessing the storage.

ActionErrorMode (string alias)

(Appears on:ExecActionSpec, JobActionSpec)

ActionErrorMode defines how should treat an error from an action.

ValueDescription

"Continue"

ActionErrorModeContinue means that an error from an action is acceptable.

"Fail"

ActionErrorModeFail means that an error from an action is problematic.

ActionPhase (string alias)

(Appears on:ActionStatus)

ValueDescription

"Completed"

ActionPhaseCompleted means the action has run successfully without errors.

"Failed"

ActionPhaseFailed means the action ran but encountered an error that

"New"

ActionPhaseNew means the action has been created but not yet processed by the BackupController.

"Running"

ActionPhaseRunning means the action is currently executing.

ActionSetSpec

(Appears on:ActionSet)

ActionSetSpec defines the desired state of ActionSet

FieldDescription
backupType
BackupType

backupType specifies the backup type, supported values:

  • Full means full backup.
  • Incremental means back up data that have changed since the last backup (full or incremental).
  • Differential means back up data that have changed since the last full backup.
  • Continuous will back up the transaction log continuously, the PITR (Point in Time Recovery) can be performed based on the continuous backup and full backup.
env
[]Kubernetes core/v1.EnvVar
(Optional)

List of environment variables to set in the container.

envFrom
[]Kubernetes core/v1.EnvFromSource
(Optional)

List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

backup
BackupActionSpec
(Optional)

backup specifies the backup action.

restore
RestoreActionSpec
(Optional)

restore specifies the restore action.

ActionSetStatus

(Appears on:ActionSet)

ActionSetStatus defines the observed state of ActionSet

FieldDescription
phase
Phase
(Optional)

phase - in list of [Available,Unavailable]

message
string
(Optional)

A human-readable message indicating details about why the ActionSet is in this phase.

observedGeneration
int64
(Optional)

generation number

ActionSpec

(Appears on:BackupActionSpec, RestoreActionSpec)

ActionSpec defines an action that should be executed. Only one of the fields may be set.

FieldDescription
exec
ExecActionSpec
(Optional)

exec specifies the action should be executed by the pod exec API in a container.

job
JobActionSpec
(Optional)

job specifies the action should be executed by a Kubernetes Job.

ActionStatus

(Appears on:BackupStatus)

FieldDescription
name
string

name is the name of the action.

phase
ActionPhase
(Optional)

phase is the current state of the action.

startTimestamp
Kubernetes meta/v1.Time
(Optional)

startTimestamp records the time an action was started.

completionTimestamp
Kubernetes meta/v1.Time
(Optional)

completionTimestamp records the time an action was completed.

failureReason
string
(Optional)

failureReason is an error that caused the backup to fail.

actionType
ActionType
(Optional)

actionType is the type of the action.

availableReplicas
int32
(Optional)

availableReplicas available replicas for statefulSet action.

objectRef
Kubernetes core/v1.ObjectReference
(Optional)

objectRef is the object reference for the action.

totalSize
string
(Optional)

totalSize is the total size of backed up data size. A string with capacity units in the format of “1Gi”, “1Mi”, “1Ki”.

timeRange
BackupTimeRange
(Optional)

timeRange records the time range of backed up data, for PITR, this is the time range of recoverable data.

volumeSnapshots
[]VolumeSnapshotStatus
(Optional)

volumeSnapshots records the volume snapshot status for the action.

ActionType (string alias)

(Appears on:ActionStatus)

ValueDescription

"Job"

""

"StatefulSet"

BackupActionSpec

(Appears on:ActionSetSpec)

FieldDescription
backupData
BackupDataActionSpec

backupData specifies the backup data action.

preBackup
[]ActionSpec
(Optional)

preBackup specifies a hook that should be executed before the backup.

postBackup
[]ActionSpec
(Optional)

postBackup specifies a hook that should be executed after the backup.

preDelete
BaseJobActionSpec
(Optional)

preDelete defines that custom deletion action which can be executed before executing the built-in deletion action. note that preDelete action job will ignore the env/envFrom.

BackupDataActionSpec

(Appears on:BackupActionSpec)

BackupDataActionSpec defines how to back up data.

FieldDescription
JobActionSpec
JobActionSpec

(Members of JobActionSpec are embedded into this type.)

syncProgress
SyncProgress
(Optional)

syncProgress specifies whether to sync the backup progress and its interval seconds.

BackupDeletionPolicy (string alias)

(Appears on:BackupSpec)

BackupDeletionPolicy describes a policy for end-of-life maintenance of backup content.

ValueDescription

"Delete"

"Retain"

BackupMethod

(Appears on:BackupPolicySpec, BackupStatus)

BackupMethod defines the backup method.

FieldDescription
name
string

the name of backup method.

snapshotVolumes
bool
(Optional)

snapshotVolumes specifies whether to take snapshots of persistent volumes. if true, the BackupScript is not required, the controller will use the CSI volume snapshotter to create the snapshot.

actionSetName
string
(Optional)

actionSetName refers to the ActionSet object that defines the backup actions. For volume snapshot backup, the actionSet is not required, the controller will use the CSI volume snapshotter to create the snapshot.

targetVolumes
TargetVolumeInfo
(Optional)

targetVolumes specifies which volumes from the target should be mounted in the backup workload.

env
[]Kubernetes core/v1.EnvVar
(Optional)

env specifies the environment variables for the backup workload.

runtimeSettings
RuntimeSettings
(Optional)

runtimeSettings specifies runtime settings for the backup workload container.

target
BackupTarget
(Optional)

target specifies the target information to back up, it will override the global target policy.

BackupPhase (string alias)

(Appears on:BackupStatus)

BackupPhase is a string representation of the lifecycle phase of a Backup.

ValueDescription

"Completed"

BackupPhaseCompleted means the backup has run successfully without errors.

"Deleting"

BackupPhaseDeleting means the backup and all its associated data are being deleted.

"Failed"

BackupPhaseFailed means the backup ran but encountered an error that prevented it from completing successfully.

"New"

BackupPhaseNew means the backup has been created but not yet processed by the BackupController.

"Running"

BackupPhaseRunning means the backup is currently executing.

BackupPolicyPhase (string alias)

BackupPolicyPhase defines phases for BackupPolicy.

ValueDescription

"Available"

"Failed"

BackupPolicySpec

(Appears on:BackupPolicy)

BackupPolicySpec defines the desired state of BackupPolicy

FieldDescription
backupRepoName
string
(Optional)

backupRepoName is the name of BackupRepo and the backup data will be stored in this repository. If not set, will be stored in the default backup repository.

pathPrefix
string
(Optional)

pathPrefix is the directory inside the backup repository to store the backup content. It is a relative to the path of the backup repository.

backoffLimit
int32
(Optional)

Specifies the number of retries before marking the backup failed.

target
BackupTarget

target specifies the target information to back up.

backupMethods
[]BackupMethod

backupMethods defines the backup methods.

useKopia
bool
(Optional)

useKopia specifies whether backup data should be stored in a Kopia repository.

Data within the Kopia repository is both compressed and encrypted. Furthermore, data deduplication is implemented across various backups of the same cluster. This approach significantly reduces the actual storage usage, particularly for clusters with a low update frequency.

NOTE: This feature should NOT be enabled when using KubeBlocks Community Edition, otherwise the backup will not be processed.

BackupPolicyStatus

(Appears on:BackupPolicy)

BackupPolicyStatus defines the observed state of BackupPolicy

FieldDescription
phase
Phase
(Optional)

phase - in list of [Available,Unavailable]

message
string
(Optional)

A human-readable message indicating details about why the BackupPolicy is in this phase.

observedGeneration
int64
(Optional)

observedGeneration is the most recent generation observed for this BackupPolicy. It refers to the BackupPolicy’s generation, which is updated on mutation by the API Server.

BackupRef

(Appears on:RestoreSpec)

BackupRef describes the backup name and namespace.

FieldDescription
name
string

backup name

namespace
string

backup namespace

BackupRepoPhase (string alias)

(Appears on:BackupRepoStatus)

BackupRepoPhase denotes different stages for the BackupRepo.

ValueDescription

"Deleting"

BackupRepoDeleting indicates the backup repository is being deleted.

"Failed"

BackupRepoFailed indicates the pre-check has been failed.

"PreChecking"

BackupRepoPreChecking indicates the backup repository is being pre-checked.

"Ready"

BackupRepoReady indicates the backup repository is ready for use.

BackupRepoSpec

(Appears on:BackupRepo)

BackupRepoSpec defines the desired state of BackupRepo.

FieldDescription
storageProviderRef
string

Specifies the name of the StorageProvider used by this backup repository.

accessMethod
AccessMethod
(Optional)

Specifies the access method of the backup repository.

volumeCapacity
Kubernetes resource.Quantity
(Optional)

Specifies the capacity of the PVC created by this backup repository.

pvReclaimPolicy
Kubernetes core/v1.PersistentVolumeReclaimPolicy

Specifies reclaim policy of the PV created by this backup repository.

config
map[string]string
(Optional)

Stores the non-secret configuration parameters for the StorageProvider.

credential
Kubernetes core/v1.SecretReference
(Optional)

References to the secret that holds the credentials for the StorageProvider.

BackupRepoStatus

(Appears on:BackupRepo)

BackupRepoStatus defines the observed state of BackupRepo.

FieldDescription
phase
BackupRepoPhase
(Optional)

Represents the current phase of reconciliation for the backup repository. Permissible values are PreChecking, Failed, Ready, Deleting.

conditions
[]Kubernetes meta/v1.Condition
(Optional)

Provides a detailed description of the current state of the backup repository.

observedGeneration
int64
(Optional)

Represents the latest generation of the resource that the controller has observed.

generatedCSIDriverSecret
Kubernetes core/v1.SecretReference
(Optional)

Refers to the generated secret for the StorageProvider.

generatedStorageClassName
string
(Optional)

Represents the name of the generated storage class.

backupPVCName
string
(Optional)

Represents the name of the PVC that stores backup data.

toolConfigSecretName
string
(Optional)

Represents the name of the secret that contains the configuration for the tool.

isDefault
bool
(Optional)

Indicates if this backup repository is the default one.

BackupSchedulePhase (string alias)

(Appears on:BackupScheduleStatus)

BackupSchedulePhase defines the phase of BackupSchedule

ValueDescription

"Available"

BackupSchedulePhaseAvailable means the backup schedule is available.

"Failed"

BackupSchedulePhaseFailed means the backup schedule is failed.

BackupScheduleSpec

(Appears on:BackupSchedule)

BackupScheduleSpec defines the desired state of BackupSchedule.

FieldDescription
backupPolicyName
string

Which backupPolicy is applied to perform this backup.

startingDeadlineMinutes
int64
(Optional)

startingDeadlineMinutes defines the deadline in minutes for starting the backup workload if it misses scheduled time for any reason.

schedules
[]SchedulePolicy

schedules defines the list of backup schedules.

BackupScheduleStatus

(Appears on:BackupSchedule)

BackupScheduleStatus defines the observed state of BackupSchedule.

FieldDescription
phase
BackupSchedulePhase
(Optional)

phase describes the phase of the BackupSchedule.

observedGeneration
int64
(Optional)

observedGeneration is the most recent generation observed for this BackupSchedule. It refers to the BackupSchedule’s generation, which is updated on mutation by the API Server.

failureReason
string
(Optional)

failureReason is an error that caused the backup to fail.

schedules
map[string]github.com/apecloud/kubeblocks/apis/dataprotection/v1alpha1.ScheduleStatus
(Optional)

schedules describes the status of each schedule.

BackupSpec

(Appears on:Backup)

BackupSpec defines the desired state of Backup.

FieldDescription
backupPolicyName
string

Which backupPolicy is applied to perform this backup.

backupMethod
string

backupMethod specifies the backup method name that is defined in backupPolicy.

deletionPolicy
BackupDeletionPolicy

deletionPolicy determines whether the backup contents stored in backup repository should be deleted when the backup custom resource is deleted. Supported values are Retain and Delete.

  • Retain means that the backup content and its physical snapshot on backup repository are kept.
  • Delete means that the backup content and its physical snapshot on backup repository are deleted.

the backup custom objects but retaining the backup contents in backup repository. The current implementation only prevent accidental deletion of backup data.

retentionPeriod
RetentionPeriod
(Optional)

retentionPeriod determines a duration up to which the backup should be kept. Controller will remove all backups that are older than the RetentionPeriod. For example, RetentionPeriod of 30d will keep only the backups of last 30 days. Sample duration format:

  • years: 2y
  • months: 6mo
  • days: 30d
  • hours: 12h
  • minutes: 30m

You can also combine the above durations. For example: 30d12h30m. If not set, the backup will be kept forever.

parentBackupName
string
(Optional)

parentBackupName determines the parent backup name for incremental or differential backup.

BackupStatus

(Appears on:Backup)

BackupStatus defines the observed state of Backup.

FieldDescription
formatVersion
string
(Optional)

formatVersion is the backup format version, including major, minor and patch version.

phase
BackupPhase
(Optional)

phase is the current state of the Backup.

expiration
Kubernetes meta/v1.Time
(Optional)

expiration is when this backup is eligible for garbage collection. ‘null’ means the Backup will NOT be cleaned except delete manual.

startTimestamp
Kubernetes meta/v1.Time
(Optional)

startTimestamp records the time a backup was started. The server’s time is used for StartTimestamp.

completionTimestamp
Kubernetes meta/v1.Time
(Optional)

completionTimestamp records the time a backup was completed. Completion time is recorded even on failed backups. The server’s time is used for CompletionTimestamp.

duration
Kubernetes meta/v1.Duration
(Optional)

The duration time of backup execution. When converted to a string, the format is “1h2m0.5s”.

totalSize
string
(Optional)

totalSize is the total size of backed up data size. A string with capacity units in the format of “1Gi”, “1Mi”, “1Ki”. If no capacity unit is specified, it is assumed to be in bytes.

failureReason
string
(Optional)

failureReason is an error that caused the backup to fail.

backupRepoName
string
(Optional)

backupRepoName is the name of the backup repository.

path
string
(Optional)

path is the directory inside the backup repository where the backup data is stored. It is an absolute path in the backup repository.

kopiaRepoPath
string
(Optional)

kopiaRepoPath records the path of the Kopia repository.

persistentVolumeClaimName
string
(Optional)

persistentVolumeClaimName is the name of the persistent volume claim that is used to store the backup data.

timeRange
BackupTimeRange
(Optional)

timeRange records the time range of backed up data, for PITR, this is the time range of recoverable data.

target
BackupTarget
(Optional)

target records the target information for this backup.

backupMethod
BackupMethod
(Optional)

backupMethod records the backup method information for this backup. Refer to BackupMethod for more details.

actions
[]ActionStatus
(Optional)

actions records the actions information for this backup.

volumeSnapshots
[]VolumeSnapshotStatus
(Optional)

volumeSnapshots records the volume snapshot status for the action.

extras
[]string

extra records the extra info for the backup.

BackupTarget

(Appears on:BackupMethod, BackupPolicySpec, BackupStatus)

FieldDescription
podSelector
PodSelector

podSelector is used to find the target pod. The volumes of the target pod will be backed up.

connectionCredential
ConnectionCredential
(Optional)

connectionCredential specifies the connection credential to connect to the target database cluster.

resources
KubeResources
(Optional)

resources specifies the kubernetes resources to back up.

serviceAccountName
string

serviceAccountName specifies the service account to run the backup workload.

BackupTimeRange

(Appears on:ActionStatus, BackupStatus)

BackupTimeRange records the time range of backed up data, for PITR, this is the time range of recoverable data.

FieldDescription
timeZone
string
(Optional)

time zone, only support zone offset, value range: “-12:59 ~ +13:00”

start
Kubernetes meta/v1.Time
(Optional)

start records the start time of backup(Coordinated Universal Time, UTC).

end
Kubernetes meta/v1.Time
(Optional)

end records the end time of backup(Coordinated Universal Time, UTC).

BackupType (string alias)

(Appears on:ActionSetSpec)

BackupType the backup type.

ValueDescription

"Continuous"

"Differential"

"Full"

"Incremental"

BaseJobActionSpec

(Appears on:BackupActionSpec, JobActionSpec)

BaseJobActionSpec is an action that creates a Kubernetes Job to execute a command.

FieldDescription
image
string

image specifies the image of backup container.

command
[]string

command specifies the commands to back up the volume data.

ConnectionCredential

(Appears on:BackupTarget, ReadyConfig)

ConnectionCredential specifies the connection credential to connect to the target database cluster.

FieldDescription
secretName
string

secretName refers to the Secret object that contains the connection credential.

usernameKey
string

usernameKey specifies the map key of the user in the connection credential secret.

passwordKey
string

passwordKey specifies the map key of the password in the connection credential secret. This password will be saved in the backup annotation for full backup. You can use the environment variable DP_ENCRYPTION_KEY to specify encryption key.

hostKey
string

hostKey specifies the map key of the host in the connection credential secret.

portKey
string

portKey specifies the map key of the port in the connection credential secret.

ExecAction

(Appears on:ReadyConfig)

FieldDescription
target
ExecActionTarget
(Optional)

execActionTarget defines the pods that need to be executed for the exec action. will execute on all pods that meet the conditions.

ExecActionSpec

(Appears on:ActionSpec)

ExecActionSpec is an action that uses the pod exec API to execute a command in a container in a pod.

FieldDescription
container
string
(Optional)

container is the container in the pod where the command should be executed. If not specified, the pod’s first container is used.

command
[]string

Command is the command and arguments to execute.

onError
ActionErrorMode
(Optional)

OnError specifies how should behave if it encounters an error executing this action.

timeout
Kubernetes meta/v1.Duration
(Optional)

Timeout defines the maximum amount of time should wait for the hook to complete before considering the execution a failure.

ExecActionTarget

(Appears on:ExecAction)

FieldDescription
podSelector
Kubernetes meta/v1.LabelSelector

kubectl exec in all selected pods.

IncludeResource

(Appears on:RestoreKubeResources)

FieldDescription
groupResource
string
labelSelector
Kubernetes meta/v1.LabelSelector
(Optional)

select the specified resource for recovery by label.

JobAction

(Appears on:ReadyConfig)

FieldDescription
target
JobActionTarget

jobActionTarget defines the pod that need to be executed for the job action. will select a pod that meets the conditions to execute.

JobActionSpec

(Appears on:ActionSpec, BackupDataActionSpec, RestoreActionSpec)

JobActionSpec is an action that creates a Kubernetes Job to execute a command.

FieldDescription
BaseJobActionSpec
BaseJobActionSpec

(Members of BaseJobActionSpec are embedded into this type.)

runOnTargetPodNode
bool
(Optional)

runOnTargetPodNode specifies whether to run the job workload on the target pod node. If backup container should mount the target pod’s volumes, this field should be set to true. otherwise the target pod’s volumes will be ignored.

onError
ActionErrorMode
(Optional)

OnError specifies how should behave if it encounters an error executing this action.

JobActionTarget

(Appears on:JobAction)

FieldDescription
podSelector
Kubernetes meta/v1.LabelSelector

select one of the pods which selected by labels to build the job spec, such as mount required volumes and inject built-in env of the selected pod.

volumeMounts
[]Kubernetes core/v1.VolumeMount
(Optional)

volumeMounts defines which volumes of the selected pod need to be mounted on the restoring pod.

KubeResources

(Appears on:BackupTarget)

KubeResources defines the kubernetes resources to back up.

FieldDescription
selector
Kubernetes meta/v1.LabelSelector

selector is a metav1.LabelSelector to filter the target kubernetes resources that need to be backed up. If not set, will do not back up any kubernetes resources.

included
[]string
(Optional)

included is a slice of namespaced-scoped resource type names to include in the kubernetes resources. The default value is “*”, which means all resource types will be included.

excluded
[]string
(Optional)

excluded is a slice of namespaced-scoped resource type names to exclude in the kubernetes resources. The default value is empty.

Phase (string alias)

(Appears on:ActionSetStatus, BackupPolicyStatus)

Phase defines the BackupPolicy and ActionSet CR .status.phase

ValueDescription

"Available"

"Unavailable"

PodSelectionStrategy (string alias)

(Appears on:PodSelector)

PodSelectionStrategy specifies the strategy to select when multiple pods are selected for backup target

ValueDescription

"All"

PodSelectionStrategyAll selects all pods that match the labelsSelector.

"Any"

PodSelectionStrategyAny selects any one pod that match the labelsSelector.

PodSelector

(Appears on:BackupTarget)

FieldDescription
LabelSelector
Kubernetes meta/v1.LabelSelector

(Members of LabelSelector are embedded into this type.)

labelsSelector is the label selector to filter the target pods.

strategy
PodSelectionStrategy

strategy specifies the strategy to select the target pod when multiple pods are selected. Valid values are:

  • Any: select any one pod that match the labelsSelector.
  • All: select all pods that match the labelsSelector.

PrepareDataConfig

(Appears on:RestoreSpec)

FieldDescription
dataSourceRef
VolumeConfig
(Optional)

dataSourceRef describes the configuration when using persistentVolumeClaim.spec.dataSourceRef method for restoring. it describes the source volume of the backup targetVolumes and how to mount path in the restoring container.

volumeClaims
[]RestoreVolumeClaim
(Optional)

volumeClaims defines the persistent Volume claims that need to be restored and mount them together into the restore job. these persistent Volume claims will be created if not exist.

volumeClaimsTemplate
RestoreVolumeClaimsTemplate
(Optional)

volumeClaimsTemplate defines a template to build persistent Volume claims that need to be restored. these claims will be created in an orderly manner based on the number of replicas or reused if already exist.

volumeClaimRestorePolicy
VolumeClaimRestorePolicy

VolumeClaimRestorePolicy defines restore policy for persistent volume claim. Supported policies are as follows:

  1. Parallel: parallel recovery of persistent volume claim.
  2. Serial: restore the persistent volume claim in sequence, and wait until the previous persistent volume claim is restored before restoring a new one.
schedulingSpec
SchedulingSpec
(Optional)

scheduling spec for restoring pod.

ReadinessProbe

(Appears on:ReadyConfig)

FieldDescription
initialDelaySeconds
int
(Optional)

number of seconds after the container has started before probe is initiated.

timeoutSeconds
int
(Optional)

number of seconds after which the probe times out. defaults to 30 second, minimum value is 1.

periodSeconds
int
(Optional)

how often (in seconds) to perform the probe. defaults to 5 second, minimum value is 1.

exec
ReadinessProbeExecAction

exec specifies the action to take.

ReadinessProbeExecAction

(Appears on:ReadinessProbe)

FieldDescription
image
string

refer to container image.

command
[]string

refer to container command.

ReadyConfig

(Appears on:RestoreSpec)

FieldDescription
jobAction
JobAction
(Optional)

configuration for job action.

execAction
ExecAction
(Optional)

configuration for exec action.

connectionCredential
ConnectionCredential
(Optional)

credential template used for creating a connection credential

readinessProbe
ReadinessProbe
(Optional)

periodic probe of the service readiness. controller will perform postReadyHooks of BackupScript.spec.restore after the service readiness when readinessProbe is configured.

RestoreActionSpec

(Appears on:ActionSetSpec)

RestoreActionSpec defines how to restore data.

FieldDescription
prepareData
JobActionSpec
(Optional)

prepareData specifies the action to prepare data.

postReady
[]ActionSpec
(Optional)

postReady specifies the action to execute after the data is ready.

RestoreActionStatus (string alias)

(Appears on:RestoreStatusAction)

RestoreActionStatus the status of restore action.

ValueDescription

"Completed"

"Failed"

"Processing"

RestoreKubeResources

(Appears on:RestoreSpec)

FieldDescription
included
[]IncludeResource

will restore the specified resources

RestorePhase (string alias)

(Appears on:RestoreStatus)

RestorePhase The current phase. Valid values are Running, Completed, Failed, AsDataSource.

ValueDescription

"AsDataSource"

"Completed"

"Failed"

"Running"

RestoreSpec

(Appears on:Restore)

RestoreSpec defines the desired state of Restore

FieldDescription
backup
BackupRef

backup to be restored. The restore behavior based on the backup type:

  1. Full: will be restored the full backup directly.
  2. Incremental: will be restored sequentially from the most recent full backup of this incremental backup.
  3. Differential: will be restored sequentially from the parent backup of the differential backup.
  4. Continuous: will find the most recent full backup at this time point and the continuous backups after it to restore.
restoreTime
string
(Optional)

restoreTime is the point in time for restoring.

resources
RestoreKubeResources
(Optional)

restore the specified resources of kubernetes.

prepareDataConfig
PrepareDataConfig
(Optional)

configuration for the action of “prepareData” phase, including the persistent volume claims that need to be restored and scheduling strategy of temporary recovery pod.

serviceAccountName
string
(Optional)

service account name which needs for recovery pod.

readyConfig
ReadyConfig
(Optional)

configuration for the action of “postReady” phase.

env
[]Kubernetes core/v1.EnvVar
(Optional)

list of environment variables to set in the container for restore and will be merged with the env of Backup and ActionSet.

The priority of merging is as follows: Restore env > Backup env > ActionSet env.

containerResources
Kubernetes core/v1.ResourceRequirements
(Optional)

specified the required resources of restore job’s container.

backoffLimit
int32
(Optional)

Specifies the number of retries before marking the restore failed.

RestoreStage (string alias)

ValueDescription

"postReady"

"prepareData"

RestoreStatus

(Appears on:Restore)

RestoreStatus defines the observed state of Restore

FieldDescription
phase
RestorePhase
(Optional)
startTimestamp
Kubernetes meta/v1.Time
(Optional)

Date/time when the restore started being processed.

completionTimestamp
Kubernetes meta/v1.Time
(Optional)

Date/time when the restore finished being processed.

duration
Kubernetes meta/v1.Duration
(Optional)

The duration time of restore execution. When converted to a string, the form is “1h2m0.5s”.

actions
RestoreStatusActions
(Optional)

recorded all restore actions performed.

conditions
[]Kubernetes meta/v1.Condition
(Optional)

describe current state of restore API Resource, like warning.

RestoreStatusAction

(Appears on:RestoreStatusActions)

FieldDescription
name
string

name describes the name of the recovery action based on the current backup.

backupName
string

which backup’s restore action belongs to.

objectKey
string

the execution object of the restore action.

message
string
(Optional)

message is a human-readable message indicating details about the object condition.

status
RestoreActionStatus

the status of this action.

startTime
Kubernetes meta/v1.Time
(Optional)

startTime is the start time for the restore job.

endTime
Kubernetes meta/v1.Time
(Optional)

endTime is the completion time for the restore job.

RestoreStatusActions

(Appears on:RestoreStatus)

FieldDescription
prepareData
[]RestoreStatusAction
(Optional)

record the actions for prepareData phase.

postReady
[]RestoreStatusAction
(Optional)

record the actions for postReady phase.

RestoreVolumeClaim

(Appears on:PrepareDataConfig, RestoreVolumeClaimsTemplate)

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

Refer to the Kubernetes API documentation for the fields of themetadata field.
volumeClaimSpec
Kubernetes core/v1.PersistentVolumeClaimSpec

volumeClaimSpec defines the desired characteristics of a persistent volume claim.

VolumeConfig
VolumeConfig

(Members of VolumeConfig are embedded into this type.)

describing the source volume of the backup targetVolumes and how to mount path in the restoring container.

RestoreVolumeClaimsTemplate

(Appears on:PrepareDataConfig)

FieldDescription
templates
[]RestoreVolumeClaim

templates is a list of volume claims.

replicas
int32

the replicas of persistent volume claim which need to be created and restored. the format of created claim name is $(template-name)-$(index).

startingIndex
int32

the starting index for the created persistent volume claim by according to template. minimum is 0.

RetentionPeriod (string alias)

(Appears on:BackupSpec, SchedulePolicy)

RetentionPeriod represents a duration in the format “1y2mo3w4d5h6m”, where y=year, mo=month, w=week, d=day, h=hour, m=minute.

RuntimeSettings

(Appears on:BackupMethod)

FieldDescription
resources
Kubernetes core/v1.ResourceRequirements
(Optional)

resources specifies the resource required by container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

SchedulePhase (string alias)

(Appears on:ScheduleStatus)

SchedulePhase defines the phase of schedule

ValueDescription

"Failed"

"Running"

SchedulePolicy

(Appears on:BackupScheduleSpec)

FieldDescription
enabled
bool
(Optional)

enabled specifies whether the backup schedule is enabled or not.

backupMethod
string

backupMethod specifies the backup method name that is defined in backupPolicy.

cronExpression
string

the cron expression for schedule, the timezone is in UTC. see https://en.wikipedia.org/wiki/Cron.

retentionPeriod
RetentionPeriod
(Optional)

retentionPeriod determines a duration up to which the backup should be kept. controller will remove all backups that are older than the RetentionPeriod. For example, RetentionPeriod of 30d will keep only the backups of last 30 days. Sample duration format:

  • years: 2y
  • months: 6mo
  • days: 30d
  • hours: 12h
  • minutes: 30m

You can also combine the above durations. For example: 30d12h30m

ScheduleStatus

(Appears on:BackupScheduleStatus)

ScheduleStatus defines the status of each schedule.

FieldDescription
phase
SchedulePhase
(Optional)

phase describes the phase of the schedule.

failureReason
string
(Optional)

failureReason is an error that caused the backup to fail.

lastScheduleTime
Kubernetes meta/v1.Time
(Optional)

lastScheduleTime records the last time the backup was scheduled.

lastSuccessfulTime
Kubernetes meta/v1.Time
(Optional)

lastSuccessfulTime records the last time the backup was successfully completed.

SchedulingSpec

(Appears on:PrepareDataConfig)

FieldDescription
tolerations
[]Kubernetes core/v1.Toleration
(Optional)

the restoring pod’s tolerations.

nodeSelector
map[string]string
(Optional)

nodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

nodeName
string
(Optional)

nodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.

affinity
Kubernetes core/v1.Affinity
(Optional)

affinity is a group of affinity scheduling rules. refer to https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

topologySpreadConstraints
[]Kubernetes core/v1.TopologySpreadConstraint
(Optional)

topologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. refer to https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/

schedulerName
string
(Optional)

If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.

SyncProgress

(Appears on:BackupDataActionSpec)

FieldDescription
enabled
bool
(Optional)

enabled specifies whether to sync the backup progress. If enabled, a sidecar container will be created to sync the backup progress to the Backup CR status.

intervalSeconds
int32
(Optional)

intervalSeconds specifies the interval seconds to sync the backup progress.

TargetVolumeInfo

(Appears on:BackupMethod)

TargetVolumeInfo specifies the volumes and their mounts of the targeted application that should be mounted in backup workload.

FieldDescription
volumes
[]string
(Optional)

Volumes indicates the list of volumes of targeted application that should be mounted on the backup job.

volumeMounts
[]Kubernetes core/v1.VolumeMount
(Optional)

volumeMounts specifies the mount for the volumes specified in Volumes section.

VolumeClaimRestorePolicy (string alias)

(Appears on:PrepareDataConfig)

VolumeClaimRestorePolicy defines restore policy for persistent volume claim. Supported policies are as follows:

  1. Parallel: parallel recovery of persistent volume claim.
  2. Serial: restore the persistent volume claim in sequence, and wait until the previous persistent volume claim is restored before restoring a new one.
ValueDescription

"Parallel"

"Serial"

VolumeConfig

(Appears on:PrepareDataConfig, RestoreVolumeClaim)

FieldDescription
volumeSource
string
(Optional)

volumeSource describes the volume will be restored from the specified volume of the backup targetVolumes. required if the backup uses volume snapshot.

mountPath
string
(Optional)

mountPath path within the restoring container at which the volume should be mounted.

VolumeSnapshotStatus

(Appears on:ActionStatus, BackupStatus)

FieldDescription
name
string

name is the name of the volume snapshot.

contentName
string

contentName is the name of the volume snapshot content.

volumeName
string
(Optional)

volumeName is the name of the volume.

size
string
(Optional)

size is the size of the volume snapshot.


storage.kubeblocks.io/v1alpha1

Resource Types:

StorageProvider

StorageProvider comprises specifications that provide guidance on accessing remote storage. Currently the supported access methods are via a dedicated CSI driver or the datasafed tool. In case of CSI driver, the specification expounds on provisioning PVCs for that driver. As for the datasafed tool, the specification provides insights on generating the necessary configuration file.

FieldDescription
apiVersion
string
storage.kubeblocks.io/v1alpha1
kind
string
StorageProvider
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
StorageProviderSpec


csiDriverName
string
(Optional)

Specifies the name of the CSI driver used to access remote storage. This field can be empty, it indicates that the storage is not accessible via CSI.

csiDriverSecretTemplate
string
(Optional)

A Go template that used to render and generate k8s.io/api/core/v1.Secretresources for a specific CSI driver. For example, accessKey and secretKey needed by CSI-S3 are stored in thisSecret resource.

storageClassTemplate
string
(Optional)

A Go template utilized to render and generate kubernetes.storage.k8s.io.v1.StorageClassresources. The `StorageClass’ created by this template is aimed at using the CSI driver.

persistentVolumeClaimTemplate
string
(Optional)

A Go template that renders and generates k8s.io/api/core/v1.PersistentVolumeClaimresources. This PVC can reference the StorageClass created from storageClassTemplate, allowing Pods to access remote storage by mounting the PVC.

datasafedConfigTemplate
string
(Optional)

A Go template used to render and generate k8s.io/api/core/v1.Secret. This Secret involves the configuration details required by the datasafed tool to access remote storage. For example, the Secret should contain endpoint,bucket, ‘region’, ‘accessKey’, ‘secretKey’, or something else for S3 storage. This field can be empty, it means this kind of storage is not accessible via the datasafed tool.

parametersSchema
ParametersSchema
(Optional)

Describes the parameters required for storage. The parameters defined here can be referenced in the above templates, and kbcli uses this definition for dynamic command-line parameter parsing.

status
StorageProviderStatus

ParametersSchema

(Appears on:StorageProviderSpec)

ParametersSchema describes the parameters needed for a certain storage.

FieldDescription
openAPIV3Schema
Kubernetes api extensions v1.JSONSchemaProps
(Optional)

Defines the parameters in OpenAPI V3.

credentialFields
[]string
(Optional)

Defines which parameters are credential fields, which need to be handled specifically. For instance, these should be stored in a Secret instead of a ConfigMap.

StorageProviderPhase (string alias)

(Appears on:StorageProviderStatus)

StorageProviderPhase defines phases of a StorageProvider.

ValueDescription

"NotReady"

StorageProviderNotReady indicates that the StorageProvider is not ready, usually because the specified CSI driver is not yet installed.

"Ready"

StorageProviderReady indicates that the StorageProvider is ready for use.

StorageProviderSpec

(Appears on:StorageProvider)

StorageProviderSpec defines the desired state of StorageProvider.

FieldDescription
csiDriverName
string
(Optional)

Specifies the name of the CSI driver used to access remote storage. This field can be empty, it indicates that the storage is not accessible via CSI.

csiDriverSecretTemplate
string
(Optional)

A Go template that used to render and generate k8s.io/api/core/v1.Secretresources for a specific CSI driver. For example, accessKey and secretKey needed by CSI-S3 are stored in thisSecret resource.

storageClassTemplate
string
(Optional)

A Go template utilized to render and generate kubernetes.storage.k8s.io.v1.StorageClassresources. The `StorageClass’ created by this template is aimed at using the CSI driver.

persistentVolumeClaimTemplate
string
(Optional)

A Go template that renders and generates k8s.io/api/core/v1.PersistentVolumeClaimresources. This PVC can reference the StorageClass created from storageClassTemplate, allowing Pods to access remote storage by mounting the PVC.

datasafedConfigTemplate
string
(Optional)

A Go template used to render and generate k8s.io/api/core/v1.Secret. This Secret involves the configuration details required by the datasafed tool to access remote storage. For example, the Secret should contain endpoint,bucket, ‘region’, ‘accessKey’, ‘secretKey’, or something else for S3 storage. This field can be empty, it means this kind of storage is not accessible via the datasafed tool.

parametersSchema
ParametersSchema
(Optional)

Describes the parameters required for storage. The parameters defined here can be referenced in the above templates, and kbcli uses this definition for dynamic command-line parameter parsing.

StorageProviderStatus

(Appears on:StorageProvider)

StorageProviderStatus defines the observed state of StorageProvider.

FieldDescription
phase
StorageProviderPhase

The phase of the StorageProvider. Valid phases are NotReady and Ready.

conditions
[]Kubernetes meta/v1.Condition
(Optional)

Describes the current state of the StorageProvider.


Generated with gen-crd-api-reference-docs