v1alpha1

package
v0.8.5-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: AGPL-3.0 Imports: 11 Imported by: 8

Documentation

Overview

+k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=dataprotection.kubeblocks.io

Package v1alpha1 contains API Schema definitions for the dataprotection v1alpha1 API group +kubebuilder:object:generate=true +groupName=dataprotection.kubeblocks.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "dataprotection.kubeblocks.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = GroupVersion

SchemeGroupVersion is group version used to register these objects.

Functions

func Resource added in v0.6.0

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AccessMethod added in v0.7.0

type AccessMethod string

AccessMethod is an enum type that defines the access method of the backup repo.

const (
	// AccessMethodMount means that the storage is mounted locally,
	// so that remote files can be accessed just like a local file.
	AccessMethodMount AccessMethod = "Mount"
	// AccessMethodTool means to access the storage with a command-line tool,
	// which helps to transfer files between the storage and local.
	AccessMethodTool AccessMethod = "Tool"
)

type ActionErrorMode added in v0.7.0

type ActionErrorMode string

ActionErrorMode defines how should treat an error from an action. +kubebuilder:validation:Enum=Continue;Fail

const (
	// ActionErrorModeContinue means that an error from an action is acceptable.
	ActionErrorModeContinue ActionErrorMode = "Continue"

	// ActionErrorModeFail means that an error from an action is problematic.
	ActionErrorModeFail ActionErrorMode = "Fail"
)

type ActionPhase added in v0.7.0

type ActionPhase string
const (
	// ActionPhaseNew means the action has been created but not yet processed by
	// the BackupController.
	ActionPhaseNew ActionPhase = "New"

	// ActionPhaseRunning means the action is currently executing.
	ActionPhaseRunning ActionPhase = "Running"

	// ActionPhaseCompleted means the action has run successfully without errors.
	ActionPhaseCompleted ActionPhase = "Completed"

	// ActionPhaseFailed means the action ran but encountered an error that
	ActionPhaseFailed ActionPhase = "Failed"
)

type ActionSet added in v0.7.0

type ActionSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ActionSetSpec   `json:"spec,omitempty"`
	Status ActionSetStatus `json:"status,omitempty"`
}

ActionSet is the Schema for the actionsets API

func (*ActionSet) DeepCopy added in v0.7.0

func (in *ActionSet) DeepCopy() *ActionSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSet.

func (*ActionSet) DeepCopyInto added in v0.7.0

func (in *ActionSet) DeepCopyInto(out *ActionSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ActionSet) DeepCopyObject added in v0.7.0

func (in *ActionSet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ActionSet) HasPostReadyStage added in v0.7.0

func (r *ActionSet) HasPostReadyStage() bool

func (*ActionSet) HasPrepareDataStage added in v0.7.0

func (r *ActionSet) HasPrepareDataStage() bool

type ActionSetList added in v0.7.0

type ActionSetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ActionSet `json:"items"`
}

ActionSetList contains a list of ActionSet

func (*ActionSetList) DeepCopy added in v0.7.0

func (in *ActionSetList) DeepCopy() *ActionSetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSetList.

func (*ActionSetList) DeepCopyInto added in v0.7.0

func (in *ActionSetList) DeepCopyInto(out *ActionSetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ActionSetList) DeepCopyObject added in v0.7.0

func (in *ActionSetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ActionSetSpec added in v0.7.0

type ActionSetSpec struct {
	// 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.
	//
	// +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous}
	// +kubebuilder:default=Full
	// +kubebuilder:validation:Required
	BackupType BackupType `json:"backupType"`

	// List of environment variables to set in the container.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// 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.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// backup specifies the backup action.
	// +optional
	Backup *BackupActionSpec `json:"backup,omitempty"`

	// restore specifies the restore action.
	// +optional
	Restore *RestoreActionSpec `json:"restore,omitempty"`
}

ActionSetSpec defines the desired state of ActionSet

func (*ActionSetSpec) DeepCopy added in v0.7.0

func (in *ActionSetSpec) DeepCopy() *ActionSetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSetSpec.

func (*ActionSetSpec) DeepCopyInto added in v0.7.0

func (in *ActionSetSpec) DeepCopyInto(out *ActionSetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ActionSetStatus added in v0.7.0

type ActionSetStatus struct {
	// phase - in list of [Available,Unavailable]
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// A human-readable message indicating details about why the ActionSet is in this phase.
	// +optional
	Message string `json:"message,omitempty"`

	// generation number
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ActionSetStatus defines the observed state of ActionSet

func (*ActionSetStatus) DeepCopy added in v0.7.0

func (in *ActionSetStatus) DeepCopy() *ActionSetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSetStatus.

func (*ActionSetStatus) DeepCopyInto added in v0.7.0

func (in *ActionSetStatus) DeepCopyInto(out *ActionSetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ActionSpec added in v0.7.0

type ActionSpec struct {
	// exec specifies the action should be executed by the pod exec API in a container.
	// +optional
	Exec *ExecActionSpec `json:"exec,omitempty"`

	// job specifies the action should be executed by a Kubernetes Job.
	// +optional
	Job *JobActionSpec `json:"job,omitempty"`
}

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

func (*ActionSpec) DeepCopy added in v0.7.0

func (in *ActionSpec) DeepCopy() *ActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionSpec.

func (*ActionSpec) DeepCopyInto added in v0.7.0

func (in *ActionSpec) DeepCopyInto(out *ActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ActionStatus added in v0.7.0

type ActionStatus struct {
	// name is the name of the action.
	Name string `json:"name,omitempty"`

	// phase is the current state of the action.
	// +optional
	Phase ActionPhase `json:"phase,omitempty"`

	// startTimestamp records the time an action was started.
	// +optional
	StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"`

	// completionTimestamp records the time an action was completed.
	// +optional
	CompletionTimestamp *metav1.Time `json:"completionTimestamp,omitempty"`

	// failureReason is an error that caused the backup to fail.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// actionType is the type of the action.
	// +optional
	ActionType ActionType `json:"actionType,omitempty"`

	// availableReplicas available replicas for statefulSet action.
	// +optional
	AvailableReplicas *int32 `json:"availableReplicas,omitempty"`

	// objectRef is the object reference for the action.
	// +optional
	ObjectRef *corev1.ObjectReference `json:"objectRef,omitempty"`

	// totalSize is the total size of backed up data size.
	// A string with capacity units in the format of "1Gi", "1Mi", "1Ki".
	// +optional
	TotalSize string `json:"totalSize,omitempty"`

	// timeRange records the time range of backed up data, for PITR, this is the
	// time range of recoverable data.
	// +optional
	TimeRange *BackupTimeRange `json:"timeRange,omitempty"`

	// volumeSnapshots records the volume snapshot status for the action.
	// +optional
	VolumeSnapshots []VolumeSnapshotStatus `json:"volumeSnapshots,omitempty"`
}

func (*ActionStatus) DeepCopy added in v0.7.0

func (in *ActionStatus) DeepCopy() *ActionStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionStatus.

func (*ActionStatus) DeepCopyInto added in v0.7.0

func (in *ActionStatus) DeepCopyInto(out *ActionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ActionType added in v0.7.0

type ActionType string
const (
	ActionTypeJob         ActionType = "Job"
	ActionTypeStatefulSet ActionType = "StatefulSet"
	ActionTypeNone        ActionType = ""
)

type Backup

type Backup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BackupSpec   `json:"spec,omitempty"`
	Status BackupStatus `json:"status,omitempty"`
}

Backup is the Schema for the backups API.

func (*Backup) DeepCopy added in v0.6.0

func (in *Backup) DeepCopy() *Backup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup.

func (*Backup) DeepCopyInto added in v0.6.0

func (in *Backup) DeepCopyInto(out *Backup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backup) DeepCopyObject added in v0.6.0

func (in *Backup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Backup) GetEndTime added in v0.7.0

func (r *Backup) GetEndTime() *metav1.Time

GetEndTime gets the backup end time. Default return status.completionTimestamp, unless status.timeRange.endTime is not nil.

func (*Backup) GetStartTime added in v0.7.0

func (r *Backup) GetStartTime() *metav1.Time

GetStartTime gets the backup start time. Default return status.startTimestamp, unless status.timeRange.startTime is not nil.

func (*Backup) GetTimeZone added in v0.8.1

func (r *Backup) GetTimeZone() string

type BackupActionSpec added in v0.7.0

type BackupActionSpec struct {
	// backupData specifies the backup data action.
	// +kubebuilder:validation:Required
	BackupData *BackupDataActionSpec `json:"backupData,omitempty"`

	// preBackup specifies a hook that should be executed before the backup.
	// +optional
	PreBackup []ActionSpec `json:"preBackup,omitempty"`

	// postBackup specifies a hook that should be executed after the backup.
	// +optional
	PostBackup []ActionSpec `json:"postBackup,omitempty"`

	// 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.
	// +optional
	PreDeleteBackup *BaseJobActionSpec `json:"preDelete,omitempty"`
}

func (*BackupActionSpec) DeepCopy added in v0.7.0

func (in *BackupActionSpec) DeepCopy() *BackupActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupActionSpec.

func (*BackupActionSpec) DeepCopyInto added in v0.7.0

func (in *BackupActionSpec) DeepCopyInto(out *BackupActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupDataActionSpec added in v0.7.0

type BackupDataActionSpec struct {
	JobActionSpec `json:",inline"`

	// syncProgress specifies whether to sync the backup progress and its interval seconds.
	// +optional
	SyncProgress *SyncProgress `json:"syncProgress,omitempty"`
}

BackupDataActionSpec defines how to back up data.

func (*BackupDataActionSpec) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupDataActionSpec.

func (*BackupDataActionSpec) DeepCopyInto added in v0.7.0

func (in *BackupDataActionSpec) DeepCopyInto(out *BackupDataActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupDeletionPolicy added in v0.7.0

type BackupDeletionPolicy string

BackupDeletionPolicy describes a policy for end-of-life maintenance of backup content. +enum +kubebuilder:validation:Enum={Delete,Retain}

const (
	BackupDeletionPolicyDelete BackupDeletionPolicy = "Delete"
	BackupDeletionPolicyRetain BackupDeletionPolicy = "Retain"
)

type BackupList

type BackupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Backup `json:"items"`
}

BackupList contains a list of Backup.

func (*BackupList) DeepCopy added in v0.6.0

func (in *BackupList) DeepCopy() *BackupList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList.

func (*BackupList) DeepCopyInto added in v0.6.0

func (in *BackupList) DeepCopyInto(out *BackupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupList) DeepCopyObject added in v0.6.0

func (in *BackupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupMethod added in v0.6.0

type BackupMethod struct {
	// the name of backup method.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	Name string `json:"name"`

	// 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.
	// +optional
	// +kubebuilder:default=false
	SnapshotVolumes *bool `json:"snapshotVolumes,omitempty"`

	// 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.
	// +optional
	ActionSetName string `json:"actionSetName,omitempty"`

	// targetVolumes specifies which volumes from the target should be mounted in
	// the backup workload.
	// +optional
	TargetVolumes *TargetVolumeInfo `json:"targetVolumes,omitempty"`

	// env specifies the environment variables for the backup workload.
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// runtimeSettings specifies runtime settings for the backup workload container.
	// +optional
	RuntimeSettings *RuntimeSettings `json:"runtimeSettings,omitempty"`

	// target specifies the target information to back up, it will override the global target policy.
	// +optional
	Target *BackupTarget `json:"target,omitempty"`
}

BackupMethod defines the backup method.

func (*BackupMethod) DeepCopy added in v0.7.0

func (in *BackupMethod) DeepCopy() *BackupMethod

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupMethod.

func (*BackupMethod) DeepCopyInto added in v0.7.0

func (in *BackupMethod) DeepCopyInto(out *BackupMethod)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupPhase

type BackupPhase string

BackupPhase is a string representation of the lifecycle phase of a Backup. +enum +kubebuilder:validation:Enum={New,InProgress,Running,Completed,Failed,Deleting}

const (
	// BackupPhaseNew means the backup has been created but not yet processed by
	// the BackupController.
	BackupPhaseNew BackupPhase = "New"

	// BackupPhaseRunning means the backup is currently executing.
	BackupPhaseRunning BackupPhase = "Running"

	// BackupPhaseCompleted means the backup has run successfully without errors.
	BackupPhaseCompleted BackupPhase = "Completed"

	// BackupPhaseFailed means the backup ran but encountered an error that
	// prevented it from completing successfully.
	BackupPhaseFailed BackupPhase = "Failed"

	// BackupPhaseDeleting means the backup and all its associated data are being deleted.
	BackupPhaseDeleting BackupPhase = "Deleting"
)

type BackupPolicy

type BackupPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BackupPolicySpec   `json:"spec,omitempty"`
	Status BackupPolicyStatus `json:"status,omitempty"`
}

BackupPolicy is the Schema for the backuppolicies API.

func (*BackupPolicy) DeepCopy added in v0.6.0

func (in *BackupPolicy) DeepCopy() *BackupPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupPolicy.

func (*BackupPolicy) DeepCopyInto added in v0.6.0

func (in *BackupPolicy) DeepCopyInto(out *BackupPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupPolicy) DeepCopyObject added in v0.6.0

func (in *BackupPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupPolicyList

type BackupPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupPolicy `json:"items"`
}

BackupPolicyList contains a list of BackupPolicy

func (*BackupPolicyList) DeepCopy added in v0.6.0

func (in *BackupPolicyList) DeepCopy() *BackupPolicyList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupPolicyList.

func (*BackupPolicyList) DeepCopyInto added in v0.6.0

func (in *BackupPolicyList) DeepCopyInto(out *BackupPolicyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupPolicyList) DeepCopyObject added in v0.6.0

func (in *BackupPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupPolicyPhase

type BackupPolicyPhase string

BackupPolicyPhase defines phases for BackupPolicy. +enum +kubebuilder:validation:Enum={Available,Failed}

const (
	BackupPolicyAvailable BackupPolicyPhase = "Available"
	BackupPolicyFailed    BackupPolicyPhase = "Failed"
)

type BackupPolicySpec

type BackupPolicySpec struct {
	// 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.
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	// +optional
	BackupRepoName *string `json:"backupRepoName,omitempty"`

	// pathPrefix is the directory inside the backup repository to store the backup content.
	// It is a relative to the path of the backup repository.
	// +optional
	PathPrefix string `json:"pathPrefix,omitempty"`

	// Specifies the number of retries before marking the backup failed.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=10
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`

	// target specifies the target information to back up.
	// +kubebuilder:validation:Required
	Target *BackupTarget `json:"target"`

	// backupMethods defines the backup methods.
	// +kubebuilder:validation:Required
	BackupMethods []BackupMethod `json:"backupMethods"`

	// 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.
	//
	// +optional
	// +kubebuilder:default=false
	UseKopia bool `json:"useKopia"`
}

BackupPolicySpec defines the desired state of BackupPolicy

func (*BackupPolicySpec) DeepCopy added in v0.6.0

func (in *BackupPolicySpec) DeepCopy() *BackupPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupPolicySpec.

func (*BackupPolicySpec) DeepCopyInto added in v0.6.0

func (in *BackupPolicySpec) DeepCopyInto(out *BackupPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupPolicyStatus

type BackupPolicyStatus struct {
	// phase - in list of [Available,Unavailable]
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// A human-readable message indicating details about why the BackupPolicy is
	// in this phase.
	// +optional
	Message string `json:"message,omitempty"`

	// 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.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

BackupPolicyStatus defines the observed state of BackupPolicy

func (*BackupPolicyStatus) DeepCopy added in v0.6.0

func (in *BackupPolicyStatus) DeepCopy() *BackupPolicyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupPolicyStatus.

func (*BackupPolicyStatus) DeepCopyInto added in v0.6.0

func (in *BackupPolicyStatus) DeepCopyInto(out *BackupPolicyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupRef added in v0.7.0

type BackupRef struct {
	// backup name
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// backup namespace
	// +kubebuilder:validation:Required
	Namespace string `json:"namespace"`
}

BackupRef describes the backup name and namespace.

func (*BackupRef) DeepCopy added in v0.7.0

func (in *BackupRef) DeepCopy() *BackupRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRef.

func (*BackupRef) DeepCopyInto added in v0.7.0

func (in *BackupRef) DeepCopyInto(out *BackupRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupRepo added in v0.6.0

type BackupRepo struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BackupRepoSpec   `json:"spec,omitempty"`
	Status BackupRepoStatus `json:"status,omitempty"`
}

BackupRepo is the Schema for the backuprepos API

func (*BackupRepo) AccessByMount added in v0.7.0

func (repo *BackupRepo) AccessByMount() bool

func (*BackupRepo) AccessByTool added in v0.7.0

func (repo *BackupRepo) AccessByTool() bool

func (*BackupRepo) DeepCopy added in v0.6.0

func (in *BackupRepo) DeepCopy() *BackupRepo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRepo.

func (*BackupRepo) DeepCopyInto added in v0.6.0

func (in *BackupRepo) DeepCopyInto(out *BackupRepo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupRepo) DeepCopyObject added in v0.6.0

func (in *BackupRepo) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupRepoList added in v0.6.0

type BackupRepoList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupRepo `json:"items"`
}

BackupRepoList contains a list of BackupRepo

func (*BackupRepoList) DeepCopy added in v0.6.0

func (in *BackupRepoList) DeepCopy() *BackupRepoList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRepoList.

func (*BackupRepoList) DeepCopyInto added in v0.6.0

func (in *BackupRepoList) DeepCopyInto(out *BackupRepoList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupRepoList) DeepCopyObject added in v0.6.0

func (in *BackupRepoList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupRepoPhase added in v0.6.0

type BackupRepoPhase string

BackupRepoPhase defines phases for BackupRepo CR. +enum +kubebuilder:validation:Enum={PreChecking,Failed,Ready,Deleting}

const (
	BackupRepoPreChecking BackupRepoPhase = "PreChecking"
	BackupRepoFailed      BackupRepoPhase = "Failed"
	BackupRepoReady       BackupRepoPhase = "Ready"
	BackupRepoDeleting    BackupRepoPhase = "Deleting"
)

type BackupRepoSpec added in v0.6.0

type BackupRepoSpec struct {
	// The storage provider used by this backup repo.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="StorageProviderRef is immutable"
	// +kubebuilder:validation:Required
	StorageProviderRef string `json:"storageProviderRef"`

	// Specifies the access method of the backup repo.
	// +kubebuilder:validation:Enum={Mount,Tool}
	// +kubebuilder:default=Mount
	// +optional
	AccessMethod AccessMethod `json:"accessMethod,omitempty"`

	// The requested capacity for the PVC created by this backup repo.
	// +optional
	VolumeCapacity resource.Quantity `json:"volumeCapacity,omitempty"`

	// The reclaim policy for the PV created by this backup repo.
	// +kubebuilder:validation:Enum={Delete,Retain}
	// +kubebuilder:validation:Required
	PVReclaimPolicy corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy"`

	// Non-secret configurations for the storage provider.
	// +optional
	Config map[string]string `json:"config,omitempty"`

	// A secret that contains the credentials needed by the storage provider.
	// +optional
	Credential *corev1.SecretReference `json:"credential,omitempty"`
}

BackupRepoSpec defines the desired state of BackupRepo

func (*BackupRepoSpec) DeepCopy added in v0.6.0

func (in *BackupRepoSpec) DeepCopy() *BackupRepoSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRepoSpec.

func (*BackupRepoSpec) DeepCopyInto added in v0.6.0

func (in *BackupRepoSpec) DeepCopyInto(out *BackupRepoSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupRepoStatus added in v0.6.0

type BackupRepoStatus struct {
	// Backup repo reconciliation phases. Valid values are PreChecking, Failed, Ready, Deleting.
	// +kubebuilder:validation:Enum={PreChecking,Failed,Ready,Deleting}
	// +optional
	Phase BackupRepoPhase `json:"phase,omitempty"`

	// conditions describes the current state of the repo.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// observedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// generatedCSIDriverSecret references the generated secret used by the CSI driver.
	// +optional
	GeneratedCSIDriverSecret *corev1.SecretReference `json:"generatedCSIDriverSecret,omitempty"`

	// generatedStorageClassName indicates the generated storage class name.
	// +optional
	GeneratedStorageClassName string `json:"generatedStorageClassName,omitempty"`

	// backupPVCName is the name of the PVC used to store backup data.
	// +optional
	BackupPVCName string `json:"backupPVCName,omitempty"`

	// toolConfigSecretName is the name of the secret containing the configuration for the access tool.
	// +optional
	ToolConfigSecretName string `json:"toolConfigSecretName,omitempty"`

	// isDefault indicates whether this backup repo is the default one.
	// +optional
	IsDefault bool `json:"isDefault,omitempty"`
}

BackupRepoStatus defines the observed state of BackupRepo

func (*BackupRepoStatus) DeepCopy added in v0.6.0

func (in *BackupRepoStatus) DeepCopy() *BackupRepoStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRepoStatus.

func (*BackupRepoStatus) DeepCopyInto added in v0.6.0

func (in *BackupRepoStatus) DeepCopyInto(out *BackupRepoStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupSchedule added in v0.7.0

type BackupSchedule struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BackupScheduleSpec   `json:"spec,omitempty"`
	Status BackupScheduleStatus `json:"status,omitempty"`
}

BackupSchedule is the Schema for the backupschedules API.

func (*BackupSchedule) DeepCopy added in v0.7.0

func (in *BackupSchedule) DeepCopy() *BackupSchedule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSchedule.

func (*BackupSchedule) DeepCopyInto added in v0.7.0

func (in *BackupSchedule) DeepCopyInto(out *BackupSchedule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupSchedule) DeepCopyObject added in v0.7.0

func (in *BackupSchedule) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupScheduleList added in v0.7.0

type BackupScheduleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupSchedule `json:"items"`
}

BackupScheduleList contains a list of BackupSchedule.

func (*BackupScheduleList) DeepCopy added in v0.7.0

func (in *BackupScheduleList) DeepCopy() *BackupScheduleList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleList.

func (*BackupScheduleList) DeepCopyInto added in v0.7.0

func (in *BackupScheduleList) DeepCopyInto(out *BackupScheduleList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupScheduleList) DeepCopyObject added in v0.7.0

func (in *BackupScheduleList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupSchedulePhase added in v0.7.0

type BackupSchedulePhase string

BackupSchedulePhase defines the phase of BackupSchedule

const (
	// BackupSchedulePhaseAvailable means the backup schedule is available.
	BackupSchedulePhaseAvailable BackupSchedulePhase = "Available"

	// BackupSchedulePhaseFailed means the backup schedule is failed.
	BackupSchedulePhaseFailed BackupSchedulePhase = "Failed"
)

type BackupScheduleSpec added in v0.7.0

type BackupScheduleSpec struct {
	// Which backupPolicy is applied to perform this backup.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	BackupPolicyName string `json:"backupPolicyName"`

	// startingDeadlineMinutes defines the deadline in minutes for starting the
	// backup workload if it misses scheduled time for any reason.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=1440
	StartingDeadlineMinutes *int64 `json:"startingDeadlineMinutes,omitempty"`

	// schedules defines the list of backup schedules.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	Schedules []SchedulePolicy `json:"schedules"`
}

BackupScheduleSpec defines the desired state of BackupSchedule.

func (*BackupScheduleSpec) DeepCopy added in v0.7.0

func (in *BackupScheduleSpec) DeepCopy() *BackupScheduleSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleSpec.

func (*BackupScheduleSpec) DeepCopyInto added in v0.7.0

func (in *BackupScheduleSpec) DeepCopyInto(out *BackupScheduleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupScheduleStatus added in v0.7.0

type BackupScheduleStatus struct {
	// phase describes the phase of the BackupSchedule.
	// +optional
	Phase BackupSchedulePhase `json:"phase,omitempty"`

	// 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.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// failureReason is an error that caused the backup to fail.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// schedules describes the status of each schedule.
	// +optional
	Schedules map[string]ScheduleStatus `json:"schedules,omitempty"`
}

BackupScheduleStatus defines the observed state of BackupSchedule.

func (*BackupScheduleStatus) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleStatus.

func (*BackupScheduleStatus) DeepCopyInto added in v0.7.0

func (in *BackupScheduleStatus) DeepCopyInto(out *BackupScheduleStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupSpec

type BackupSpec struct {
	// Which backupPolicy is applied to perform this backup.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.backupPolicyName"
	BackupPolicyName string `json:"backupPolicyName"`

	// backupMethod specifies the backup method name that is defined in backupPolicy.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.backupMethod"
	BackupMethod string `json:"backupMethod"`

	// 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 can not be deleted and remains in 'Deleting' phase.
	// "Delete" means that the backup content and its physical snapshot on backup repository are deleted.
	// +kubebuilder:validation:Enum=Delete;Retain
	// +kubebuilder:validation:Required
	// +kubebuilder:default=Delete
	DeletionPolicy BackupDeletionPolicy `json:"deletionPolicy,omitempty"`

	// 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.
	//
	// +optional
	RetentionPeriod RetentionPeriod `json:"retentionPeriod,omitempty"`

	// parentBackupName determines the parent backup name for incremental or
	// differential backup.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.parentBackupName"
	ParentBackupName string `json:"parentBackupName,omitempty"`
}

BackupSpec defines the desired state of Backup.

func (*BackupSpec) DeepCopy added in v0.6.0

func (in *BackupSpec) DeepCopy() *BackupSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec.

func (*BackupSpec) DeepCopyInto added in v0.6.0

func (in *BackupSpec) DeepCopyInto(out *BackupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupStatus

type BackupStatus struct {
	// formatVersion is the backup format version, including major, minor and patch version.
	// +optional
	FormatVersion string `json:"formatVersion,omitempty"`

	// phase is the current state of the Backup.
	// +optional
	Phase BackupPhase `json:"phase,omitempty"`

	// expiration is when this backup is eligible for garbage collection.
	// 'null' means the Backup will NOT be cleaned except delete manual.
	// +optional
	Expiration *metav1.Time `json:"expiration,omitempty"`

	// startTimestamp records the time a backup was started.
	// The server's time is used for StartTimestamp.
	// +optional
	StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"`

	// completionTimestamp records the time a backup was completed.
	// Completion time is recorded even on failed backups.
	// The server's time is used for CompletionTimestamp.
	// +optional
	CompletionTimestamp *metav1.Time `json:"completionTimestamp,omitempty"`

	// The duration time of backup execution.
	// When converted to a string, the format is "1h2m0.5s".
	// +optional
	Duration *metav1.Duration `json:"duration,omitempty"`

	// 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.
	// +optional
	TotalSize string `json:"totalSize,omitempty"`

	// failureReason is an error that caused the backup to fail.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// backupRepoName is the name of the backup repository.
	// +optional
	BackupRepoName string `json:"backupRepoName,omitempty"`

	// path is the directory inside the backup repository where the backup data is stored.
	// It is an absolute path in the backup repository.
	// +optional
	Path string `json:"path,omitempty"`

	// kopiaRepoPath records the path of the Kopia repository.
	// +optional
	KopiaRepoPath string `json:"kopiaRepoPath,omitempty"`

	// persistentVolumeClaimName is the name of the persistent volume claim that
	// is used to store the backup data.
	// +optional
	PersistentVolumeClaimName string `json:"persistentVolumeClaimName,omitempty"`

	// timeRange records the time range of backed up data, for PITR, this is the
	// time range of recoverable data.
	// +optional
	TimeRange *BackupTimeRange `json:"timeRange,omitempty"`

	// target records the target information for this backup.
	// +optional
	Target *BackupTarget `json:"target,omitempty"`

	// backupMethod records the backup method information for this backup.
	// Refer to BackupMethod for more details.
	// +optional
	BackupMethod *BackupMethod `json:"backupMethod,omitempty"`

	// actions records the actions information for this backup.
	// +optional
	Actions []ActionStatus `json:"actions,omitempty"`

	// volumeSnapshots records the volume snapshot status for the action.
	// +optional
	VolumeSnapshots []VolumeSnapshotStatus `json:"volumeSnapshots,omitempty"`

	// extra records the extra info for the backup.
	Extras []map[string]string `json:"extras,omitempty"`
}

BackupStatus defines the observed state of Backup.

func (*BackupStatus) DeepCopy added in v0.6.0

func (in *BackupStatus) DeepCopy() *BackupStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus.

func (*BackupStatus) DeepCopyInto added in v0.6.0

func (in *BackupStatus) DeepCopyInto(out *BackupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupTarget added in v0.7.0

type BackupTarget struct {
	// podSelector is used to find the target pod. The volumes of the target pod
	// will be backed up.
	// +kube:validation:Required
	PodSelector *PodSelector `json:"podSelector,omitempty"`

	// connectionCredential specifies the connection credential to connect to the
	// target database cluster.
	// +optional
	ConnectionCredential *ConnectionCredential `json:"connectionCredential,omitempty"`

	// resources specifies the kubernetes resources to back up.
	// +optional
	Resources *KubeResources `json:"resources,omitempty"`

	// serviceAccountName specifies the service account to run the backup workload.
	// +kubebuilder:validation:Required
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

func (*BackupTarget) DeepCopy added in v0.7.0

func (in *BackupTarget) DeepCopy() *BackupTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupTarget.

func (*BackupTarget) DeepCopyInto added in v0.7.0

func (in *BackupTarget) DeepCopyInto(out *BackupTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupTimeRange added in v0.7.0

type BackupTimeRange struct {
	// time zone, only support zone offset, value range: "-12:59 ~ +13:00"
	// +kubebuilder:validation:Pattern:=`^(\+|\-)(0[0-9]|1[0-3]):([0-5][0-9])$`
	// +optional
	TimeZone string `json:"timeZone,omitempty"`

	// start records the start time of backup(Coordinated Universal Time, UTC).
	// +optional
	Start *metav1.Time `json:"start,omitempty"`

	// end records the end time of backup(Coordinated Universal Time, UTC).
	// +optional
	End *metav1.Time `json:"end,omitempty"`
}

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

func (*BackupTimeRange) DeepCopy added in v0.7.0

func (in *BackupTimeRange) DeepCopy() *BackupTimeRange

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupTimeRange.

func (*BackupTimeRange) DeepCopyInto added in v0.7.0

func (in *BackupTimeRange) DeepCopyInto(out *BackupTimeRange)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupType

type BackupType string

BackupType the backup type. +enum +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous}

const (
	BackupTypeFull         BackupType = "Full"
	BackupTypeIncremental  BackupType = "Incremental"
	BackupTypeDifferential BackupType = "Differential"
	BackupTypeContinuous   BackupType = "Continuous"
)

type BaseJobActionSpec added in v0.8.0

type BaseJobActionSpec struct {
	// image specifies the image of backup container.
	// +kubebuilder:validation:Required
	Image string `json:"image"`

	// command specifies the commands to back up the volume data.
	// +kubebuilder:validation:Required
	Command []string `json:"command"`
}

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

func (*BaseJobActionSpec) DeepCopy added in v0.8.0

func (in *BaseJobActionSpec) DeepCopy() *BaseJobActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseJobActionSpec.

func (*BaseJobActionSpec) DeepCopyInto added in v0.8.0

func (in *BaseJobActionSpec) DeepCopyInto(out *BaseJobActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConnectionCredential added in v0.7.0

type ConnectionCredential struct {
	// secretName refers to the Secret object that contains the connection credential.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	SecretName string `json:"secretName"`

	// usernameKey specifies the map key of the user in the connection credential secret.
	// +kubebuilder:default=username
	UsernameKey string `json:"usernameKey,omitempty"`

	// 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.
	// +kubebuilder:default=password
	PasswordKey string `json:"passwordKey,omitempty"`

	// hostKey specifies the map key of the host in the connection credential secret.
	HostKey string `json:"hostKey,omitempty"`

	// portKey specifies the map key of the port in the connection credential secret.
	PortKey string `json:"portKey,omitempty"`
}

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

func (*ConnectionCredential) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionCredential.

func (*ConnectionCredential) DeepCopyInto added in v0.7.0

func (in *ConnectionCredential) DeepCopyInto(out *ConnectionCredential)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExecAction added in v0.7.0

type ExecAction struct {
	// execActionTarget defines the pods that need to be executed for the exec action.
	// will execute on all pods that meet the conditions.
	// +optional
	Target ExecActionTarget `json:"target"`
}

func (*ExecAction) DeepCopy added in v0.7.0

func (in *ExecAction) DeepCopy() *ExecAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecAction.

func (*ExecAction) DeepCopyInto added in v0.7.0

func (in *ExecAction) DeepCopyInto(out *ExecAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExecActionSpec added in v0.7.0

type ExecActionSpec struct {
	// container is the container in the pod where the command should be executed.
	// If not specified, the pod's first container is used.
	// +optional
	Container string `json:"container,omitempty"`

	// Command is the command and arguments to execute.
	// +kubebuilder:validation:MinItems=1
	Command []string `json:"command"`

	// OnError specifies how should behave if it encounters an error executing this action.
	// +optional
	// +kubebuilder:default=Fail
	OnError ActionErrorMode `json:"onError,omitempty"`

	// Timeout defines the maximum amount of time should wait for the hook to complete before
	// considering the execution a failure.
	// +optional
	Timeout metav1.Duration `json:"timeout,omitempty"`
}

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

func (*ExecActionSpec) DeepCopy added in v0.7.0

func (in *ExecActionSpec) DeepCopy() *ExecActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecActionSpec.

func (*ExecActionSpec) DeepCopyInto added in v0.7.0

func (in *ExecActionSpec) DeepCopyInto(out *ExecActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExecActionTarget added in v0.7.0

type ExecActionTarget struct {
	// kubectl exec in all selected pods.
	// +kubebuilder:validation:Required
	PodSelector metav1.LabelSelector `json:"podSelector"`
}

func (*ExecActionTarget) DeepCopy added in v0.7.0

func (in *ExecActionTarget) DeepCopy() *ExecActionTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecActionTarget.

func (*ExecActionTarget) DeepCopyInto added in v0.7.0

func (in *ExecActionTarget) DeepCopyInto(out *ExecActionTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IncludeResource added in v0.7.0

type IncludeResource struct {
	//
	// +kubebuilder:validation:Required
	GroupResource string `json:"groupResource"`

	// select the specified resource for recovery by label.
	// +optional
	LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`
}

func (*IncludeResource) DeepCopy added in v0.7.0

func (in *IncludeResource) DeepCopy() *IncludeResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncludeResource.

func (*IncludeResource) DeepCopyInto added in v0.7.0

func (in *IncludeResource) DeepCopyInto(out *IncludeResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobAction added in v0.7.0

type JobAction struct {
	// jobActionTarget defines the pod that need to be executed for the job action.
	//  will select a pod that meets the conditions to execute.
	// +kubebuilder:validation:Required
	Target JobActionTarget `json:"target"`
}

func (*JobAction) DeepCopy added in v0.7.0

func (in *JobAction) DeepCopy() *JobAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobAction.

func (*JobAction) DeepCopyInto added in v0.7.0

func (in *JobAction) DeepCopyInto(out *JobAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobActionSpec added in v0.7.0

type JobActionSpec struct {
	BaseJobActionSpec `json:",inline"`

	// 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.
	// +optional
	// +kubebuilder:default=false
	RunOnTargetPodNode *bool `json:"runOnTargetPodNode,omitempty"`

	// OnError specifies how should behave if it encounters an error executing
	// this action.
	// +optional
	// +kubebuilder:default=Fail
	OnError ActionErrorMode `json:"onError,omitempty"`
}

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

func (*JobActionSpec) DeepCopy added in v0.7.0

func (in *JobActionSpec) DeepCopy() *JobActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobActionSpec.

func (*JobActionSpec) DeepCopyInto added in v0.7.0

func (in *JobActionSpec) DeepCopyInto(out *JobActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobActionTarget added in v0.7.0

type JobActionTarget struct {
	// 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.
	// +kubebuilder:validation:Required
	PodSelector metav1.LabelSelector `json:"podSelector"`

	// volumeMounts defines which volumes of the selected pod need to be mounted on the restoring pod.
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

func (*JobActionTarget) DeepCopy added in v0.7.0

func (in *JobActionTarget) DeepCopy() *JobActionTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobActionTarget.

func (*JobActionTarget) DeepCopyInto added in v0.7.0

func (in *JobActionTarget) DeepCopyInto(out *JobActionTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KubeResources added in v0.7.0

type KubeResources struct {
	// 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.
	// +kube:validation:Required
	Selector *metav1.LabelSelector `json:"selector,omitempty"`

	// 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.
	// +optional
	// +kubebuilder:default={"*"}
	Included []string `json:"included,omitempty"`

	// excluded is a slice of namespaced-scoped resource type names to exclude in
	// the kubernetes resources.
	// The default value is empty.
	// +optional
	Excluded []string `json:"excluded,omitempty"`
}

KubeResources defines the kubernetes resources to back up.

func (*KubeResources) DeepCopy added in v0.7.0

func (in *KubeResources) DeepCopy() *KubeResources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeResources.

func (*KubeResources) DeepCopyInto added in v0.7.0

func (in *KubeResources) DeepCopyInto(out *KubeResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Phase added in v0.7.0

type Phase string

Phase defines the BackupPolicy and ActionSet CR .status.phase +enum +kubebuilder:validation:Enum={Available,Unavailable}

const (
	AvailablePhase   Phase = "Available"
	UnavailablePhase Phase = "Unavailable"
)

func (Phase) IsAvailable added in v0.7.0

func (p Phase) IsAvailable() bool

type PodSelectionStrategy added in v0.7.0

type PodSelectionStrategy string

PodSelectionStrategy specifies the strategy to select when multiple pods are selected for backup target +kubebuilder:validation:Enum={Any,All}

const (
	// PodSelectionStrategyAll selects all pods that match the labelsSelector.
	// TODO: support PodSelectionStrategyAll
	PodSelectionStrategyAll PodSelectionStrategy = "All"

	// PodSelectionStrategyAny selects any one pod that match the labelsSelector.
	PodSelectionStrategyAny PodSelectionStrategy = "Any"
)

type PodSelector added in v0.7.0

type PodSelector struct {
	// labelsSelector is the label selector to filter the target pods.
	*metav1.LabelSelector `json:",inline"`

	// 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.
	//
	// +kubebuilder:default=Any
	Strategy PodSelectionStrategy `json:"strategy,omitempty"`
}

func (*PodSelector) DeepCopy added in v0.7.0

func (in *PodSelector) DeepCopy() *PodSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSelector.

func (*PodSelector) DeepCopyInto added in v0.7.0

func (in *PodSelector) DeepCopyInto(out *PodSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrepareDataConfig added in v0.7.0

type PrepareDataConfig struct {
	// 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.
	// +kubebuilder:validation:XValidation:rule="self.volumeSource != ” || self.mountPath !=”",message="at least one exists for volumeSource and mountPath."
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.prepareDataConfig.dataSourceRef"
	// +optional
	DataSourceRef *VolumeConfig `json:"dataSourceRef,omitempty"`

	// 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.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.prepareDataConfig.volumeClaims"
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +optional
	RestoreVolumeClaims []RestoreVolumeClaim `json:"volumeClaims,omitempty"`

	// 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.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.prepareDataConfig.volumeClaimsTemplate"
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +optional
	RestoreVolumeClaimsTemplate *RestoreVolumeClaimsTemplate `json:"volumeClaimsTemplate,omitempty"`

	// 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.
	//
	// +kubebuilder:default=Parallel
	// +kubebuilder:validation:Required
	VolumeClaimRestorePolicy VolumeClaimRestorePolicy `json:"volumeClaimRestorePolicy"`

	// scheduling spec for restoring pod.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.prepareDataConfig.schedulingSpec"
	// +optional
	SchedulingSpec SchedulingSpec `json:"schedulingSpec,omitempty"`
}

func (*PrepareDataConfig) DeepCopy added in v0.7.0

func (in *PrepareDataConfig) DeepCopy() *PrepareDataConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrepareDataConfig.

func (*PrepareDataConfig) DeepCopyInto added in v0.7.0

func (in *PrepareDataConfig) DeepCopyInto(out *PrepareDataConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PrepareDataConfig) IsSerialPolicy added in v0.7.0

func (p *PrepareDataConfig) IsSerialPolicy() bool

type ReadinessProbe added in v0.7.0

type ReadinessProbe struct {
	// number of seconds after the container has started before probe is initiated.
	// +optional
	// +kubebuilder:validation:Minimum=0
	InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"`

	// number of seconds after which the probe times out.
	// defaults to 30 second, minimum value is 1.
	// +optional
	// +kubebuilder:default=30
	// +kubebuilder:validation:Minimum=1
	TimeoutSeconds int `json:"timeoutSeconds"`

	// how often (in seconds) to perform the probe.
	// defaults to 5 second, minimum value is 1.
	// +optional
	// +kubebuilder:default=5
	// +kubebuilder:validation:Minimum=1
	PeriodSeconds int `json:"periodSeconds"`

	// exec specifies the action to take.
	// +kubebuilder:validation:Required
	Exec ReadinessProbeExecAction `json:"exec"`
}

func (*ReadinessProbe) DeepCopy added in v0.7.0

func (in *ReadinessProbe) DeepCopy() *ReadinessProbe

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadinessProbe.

func (*ReadinessProbe) DeepCopyInto added in v0.7.0

func (in *ReadinessProbe) DeepCopyInto(out *ReadinessProbe)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReadinessProbeExecAction added in v0.7.0

type ReadinessProbeExecAction struct {
	// refer to container image.
	// +kubebuilder:validation:Required
	Image string `json:"image"`

	// refer to container command.
	// +kubebuilder:validation:Required
	Command []string `json:"command"`
}

func (*ReadinessProbeExecAction) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadinessProbeExecAction.

func (*ReadinessProbeExecAction) DeepCopyInto added in v0.7.0

func (in *ReadinessProbeExecAction) DeepCopyInto(out *ReadinessProbeExecAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReadyConfig added in v0.7.0

type ReadyConfig struct {
	// configuration for job action.
	// +optional
	JobAction *JobAction `json:"jobAction,omitempty"`

	// configuration for exec action.
	// +optional
	ExecAction *ExecAction `json:"execAction,omitempty"`

	// credential template used for creating a connection credential
	// +optional
	ConnectionCredential *ConnectionCredential `json:"connectionCredential,omitempty"`

	// periodic probe of the service readiness.
	// controller will perform postReadyHooks of BackupScript.spec.restore after the service readiness when readinessProbe is configured.
	// +optional
	ReadinessProbe *ReadinessProbe `json:"readinessProbe,omitempty"`
}

func (*ReadyConfig) DeepCopy added in v0.7.0

func (in *ReadyConfig) DeepCopy() *ReadyConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadyConfig.

func (*ReadyConfig) DeepCopyInto added in v0.7.0

func (in *ReadyConfig) DeepCopyInto(out *ReadyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Restore added in v0.7.0

type Restore struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RestoreSpec   `json:"spec,omitempty"`
	Status RestoreStatus `json:"status,omitempty"`
}

Restore is the Schema for the restores API

func (*Restore) DeepCopy added in v0.7.0

func (in *Restore) DeepCopy() *Restore

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restore.

func (*Restore) DeepCopyInto added in v0.7.0

func (in *Restore) DeepCopyInto(out *Restore)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Restore) DeepCopyObject added in v0.7.0

func (in *Restore) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RestoreActionSpec added in v0.7.0

type RestoreActionSpec struct {
	// prepareData specifies the action to prepare data.
	// +optional
	PrepareData *JobActionSpec `json:"prepareData,omitempty"`

	// postReady specifies the action to execute after the data is ready.
	// +optional
	PostReady []ActionSpec `json:"postReady,omitempty"`
}

RestoreActionSpec defines how to restore data.

func (*RestoreActionSpec) DeepCopy added in v0.7.0

func (in *RestoreActionSpec) DeepCopy() *RestoreActionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreActionSpec.

func (*RestoreActionSpec) DeepCopyInto added in v0.7.0

func (in *RestoreActionSpec) DeepCopyInto(out *RestoreActionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreActionStatus added in v0.7.0

type RestoreActionStatus string

RestoreActionStatus the status of restore action. +enum +kubebuilder:validation:Enum={Processing,Completed,Failed}

const (
	RestoreActionProcessing RestoreActionStatus = "Processing"
	RestoreActionCompleted  RestoreActionStatus = "Completed"
	RestoreActionFailed     RestoreActionStatus = "Failed"
)

type RestoreKubeResources added in v0.7.0

type RestoreKubeResources struct {
	// will restore the specified resources
	IncludeResources []IncludeResource `json:"included,omitempty"`
}

func (*RestoreKubeResources) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreKubeResources.

func (*RestoreKubeResources) DeepCopyInto added in v0.7.0

func (in *RestoreKubeResources) DeepCopyInto(out *RestoreKubeResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreList added in v0.7.0

type RestoreList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Restore `json:"items"`
}

RestoreList contains a list of Restore

func (*RestoreList) DeepCopy added in v0.7.0

func (in *RestoreList) DeepCopy() *RestoreList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreList.

func (*RestoreList) DeepCopyInto added in v0.7.0

func (in *RestoreList) DeepCopyInto(out *RestoreList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreList) DeepCopyObject added in v0.7.0

func (in *RestoreList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RestorePhase added in v0.7.0

type RestorePhase string

RestorePhase The current phase. Valid values are Running, Completed, Failed, AsDataSource. +enum +kubebuilder:validation:Enum={Running,Completed,Failed,AsDataSource}

const (
	RestorePhaseRunning      RestorePhase = "Running"
	RestorePhaseCompleted    RestorePhase = "Completed"
	RestorePhaseFailed       RestorePhase = "Failed"
	RestorePhaseAsDataSource RestorePhase = "AsDataSource"
)

type RestoreSpec added in v0.7.0

type RestoreSpec struct {
	// 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.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.backupName"
	Backup BackupRef `json:"backup"`

	// restoreTime is the point in time for restoring.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.restoreTime"
	// +optional
	// +kubebuilder:validation:Pattern=`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$`
	RestoreTime string `json:"restoreTime,omitempty"`

	// restore the specified resources of kubernetes.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.resources"
	// +optional
	Resources *RestoreKubeResources `json:"resources,omitempty"`

	// configuration for the action of "prepareData" phase, including the persistent volume claims
	// that need to be restored and scheduling strategy of temporary recovery pod.
	// +optional
	PrepareDataConfig *PrepareDataConfig `json:"prepareDataConfig,omitempty"`

	// service account name which needs for recovery pod.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// configuration for the action of "postReady" phase.
	// +kubebuilder:validation:XValidation:rule="has(self.jobAction) || has(self.execAction)", message="at least one exists for jobAction and execAction."
	// +optional
	ReadyConfig *ReadyConfig `json:"readyConfig,omitempty"`

	// 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`.
	//
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// specified the required resources of restore job's container.
	// +optional
	ContainerResources corev1.ResourceRequirements `json:"containerResources,omitempty"`

	// Specifies the number of retries before marking the restore failed.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=10
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`
}

RestoreSpec defines the desired state of Restore

func (*RestoreSpec) DeepCopy added in v0.7.0

func (in *RestoreSpec) DeepCopy() *RestoreSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSpec.

func (*RestoreSpec) DeepCopyInto added in v0.7.0

func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreStage added in v0.7.0

type RestoreStage string
const (
	PrepareData RestoreStage = "prepareData"
	PostReady   RestoreStage = "postReady"
)

type RestoreStatus added in v0.7.0

type RestoreStatus struct {
	// +optional
	Phase RestorePhase `json:"phase,omitempty"`

	// Date/time when the restore started being processed.
	// +optional
	StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"`

	// Date/time when the restore finished being processed.
	// +optional
	CompletionTimestamp *metav1.Time `json:"completionTimestamp,omitempty"`

	// The duration time of restore execution.
	// When converted to a string, the form is "1h2m0.5s".
	// +optional
	Duration *metav1.Duration `json:"duration,omitempty"`

	// recorded all restore actions performed.
	// +optional
	Actions RestoreStatusActions `json:"actions,omitempty"`

	// describe current state of restore API Resource, like warning.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

RestoreStatus defines the observed state of Restore

func (*RestoreStatus) DeepCopy added in v0.7.0

func (in *RestoreStatus) DeepCopy() *RestoreStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreStatus.

func (*RestoreStatus) DeepCopyInto added in v0.7.0

func (in *RestoreStatus) DeepCopyInto(out *RestoreStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreStatusAction added in v0.7.0

type RestoreStatusAction struct {
	// name describes the name of the recovery action based on the current backup.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// which backup's restore action belongs to.
	// +kubebuilder:validation:Required
	BackupName string `json:"backupName"`

	// the execution object of the restore action.
	// +kubebuilder:validation:Required
	ObjectKey string `json:"objectKey"`

	// message is a human-readable message indicating details about the object condition.
	// +optional
	Message string `json:"message,omitempty"`

	// the status of this action.
	// +kubebuilder:validation:Required
	Status RestoreActionStatus `json:"status,omitempty"`

	// startTime is the start time for the restore job.
	// +optional
	StartTime metav1.Time `json:"startTime,omitempty"`

	// endTime is the completion time for the restore job.
	// +optional
	EndTime metav1.Time `json:"endTime,omitempty"`
}

func (*RestoreStatusAction) DeepCopy added in v0.7.0

func (in *RestoreStatusAction) DeepCopy() *RestoreStatusAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreStatusAction.

func (*RestoreStatusAction) DeepCopyInto added in v0.7.0

func (in *RestoreStatusAction) DeepCopyInto(out *RestoreStatusAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreStatusActions added in v0.7.0

type RestoreStatusActions struct {
	// record the actions for prepareData phase.
	// +patchMergeKey=jobName
	// +patchStrategy=merge,retainKeys
	// +optional
	PrepareData []RestoreStatusAction `json:"prepareData,omitempty"`

	// record the actions for postReady phase.
	// +patchMergeKey=jobName
	// +patchStrategy=merge,retainKeys
	// +optional
	PostReady []RestoreStatusAction `json:"postReady,omitempty"`
}

func (*RestoreStatusActions) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreStatusActions.

func (*RestoreStatusActions) DeepCopyInto added in v0.7.0

func (in *RestoreStatusActions) DeepCopyInto(out *RestoreStatusActions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreVolumeClaim added in v0.7.0

type RestoreVolumeClaim struct {
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +kubebuilder:validation:Required
	metav1.ObjectMeta `json:"metadata"`

	// volumeClaimSpec defines the desired characteristics of a persistent volume claim.
	// +kubebuilder:validation:Required
	VolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"volumeClaimSpec"`

	// describing the source volume of the backup targetVolumes and how to mount path in the restoring container.
	// +kubebuilder:validation:XValidation:rule="self.volumeSource != ” || self.mountPath !=”",message="at least one exists for volumeSource and mountPath."
	VolumeConfig `json:",inline"`
}

func (*RestoreVolumeClaim) DeepCopy added in v0.7.0

func (in *RestoreVolumeClaim) DeepCopy() *RestoreVolumeClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreVolumeClaim.

func (*RestoreVolumeClaim) DeepCopyInto added in v0.7.0

func (in *RestoreVolumeClaim) DeepCopyInto(out *RestoreVolumeClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreVolumeClaimsTemplate added in v0.7.0

type RestoreVolumeClaimsTemplate struct {
	// templates is a list of volume claims.
	// +kubebuilder:validation:Required
	Templates []RestoreVolumeClaim `json:"templates"`

	// the replicas of persistent volume claim which need to be created and restored.
	// the format of created claim name is `$(template-name)-$(index)`.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Required
	Replicas int32 `json:"replicas"`

	// the starting index for the created persistent volume claim by according to template.
	// minimum is 0.
	// +kubebuilder:validation:Minimum=0
	StartingIndex int32 `json:"startingIndex,omitempty"`
}

func (*RestoreVolumeClaimsTemplate) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreVolumeClaimsTemplate.

func (*RestoreVolumeClaimsTemplate) DeepCopyInto added in v0.7.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RetentionPeriod added in v0.7.0

type RetentionPeriod string

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

func (RetentionPeriod) String added in v0.7.0

func (r RetentionPeriod) String() string

func (RetentionPeriod) ToDuration added in v0.7.0

func (r RetentionPeriod) ToDuration() (time.Duration, error)

ToDuration converts the RetentionPeriod to time.Duration.

type RuntimeSettings added in v0.7.0

type RuntimeSettings struct {
	// resources specifies the resource required by container.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

func (*RuntimeSettings) DeepCopy added in v0.7.0

func (in *RuntimeSettings) DeepCopy() *RuntimeSettings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeSettings.

func (*RuntimeSettings) DeepCopyInto added in v0.7.0

func (in *RuntimeSettings) DeepCopyInto(out *RuntimeSettings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SchedulePhase added in v0.7.0

type SchedulePhase string

SchedulePhase defines the phase of schedule

const (
	ScheduleRunning SchedulePhase = "Running"
	ScheduleFailed  SchedulePhase = "Failed"
)

type SchedulePolicy

type SchedulePolicy struct {
	// enabled specifies whether the backup schedule is enabled or not.
	// +optional
	Enabled *bool `json:"enabled,omitempty"`

	// backupMethod specifies the backup method name that is defined in backupPolicy.
	// +kubebuilder:validation:Required
	BackupMethod string `json:"backupMethod"`

	// the cron expression for schedule, the timezone is in UTC.
	// see https://en.wikipedia.org/wiki/Cron.
	// +kubebuilder:validation:Required
	CronExpression string `json:"cronExpression"`

	// 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
	//
	// +optional
	// +kubebuilder:default="7d"
	RetentionPeriod RetentionPeriod `json:"retentionPeriod,omitempty"`
}

func (*SchedulePolicy) DeepCopy added in v0.6.0

func (in *SchedulePolicy) DeepCopy() *SchedulePolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulePolicy.

func (*SchedulePolicy) DeepCopyInto added in v0.6.0

func (in *SchedulePolicy) DeepCopyInto(out *SchedulePolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScheduleStatus added in v0.7.0

type ScheduleStatus struct {
	// phase describes the phase of the schedule.
	// +optional
	Phase SchedulePhase `json:"phase,omitempty"`

	// failureReason is an error that caused the backup to fail.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// lastScheduleTime records the last time the backup was scheduled.
	// +optional
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`

	// lastSuccessfulTime records the last time the backup was successfully completed.
	// +optional
	LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"`
}

ScheduleStatus defines the status of each schedule.

func (*ScheduleStatus) DeepCopy added in v0.7.0

func (in *ScheduleStatus) DeepCopy() *ScheduleStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleStatus.

func (*ScheduleStatus) DeepCopyInto added in v0.7.0

func (in *ScheduleStatus) DeepCopyInto(out *ScheduleStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SchedulingSpec added in v0.7.0

type SchedulingSpec struct {
	// the restoring pod's tolerations.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// 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/
	// +optional
	// +mapType=atomic
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// 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.
	// +optional
	NodeName string `json:"nodeName,omitempty"`

	// affinity is a group of affinity scheduling rules.
	// refer to https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// 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/
	// +optional
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// If specified, the pod will be dispatched by specified scheduler.
	// If not specified, the pod will be dispatched by default scheduler.
	// +optional
	SchedulerName string `json:"schedulerName,omitempty"`
}

func (*SchedulingSpec) DeepCopy added in v0.7.0

func (in *SchedulingSpec) DeepCopy() *SchedulingSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingSpec.

func (*SchedulingSpec) DeepCopyInto added in v0.7.0

func (in *SchedulingSpec) DeepCopyInto(out *SchedulingSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SyncProgress added in v0.7.0

type SyncProgress struct {
	// 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.
	// +optional
	Enabled *bool `json:"enabled,omitempty"`

	// intervalSeconds specifies the interval seconds to sync the backup progress.
	// +optional
	// +kubebuilder:default=60
	IntervalSeconds *int32 `json:"intervalSeconds,omitempty"`
}

func (*SyncProgress) DeepCopy added in v0.7.0

func (in *SyncProgress) DeepCopy() *SyncProgress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncProgress.

func (*SyncProgress) DeepCopyInto added in v0.7.0

func (in *SyncProgress) DeepCopyInto(out *SyncProgress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TargetVolumeInfo added in v0.7.0

type TargetVolumeInfo struct {
	// Volumes indicates the list of volumes of targeted application that should
	// be mounted on the backup job.
	// +optional
	Volumes []string `json:"volumes,omitempty"`

	// volumeMounts specifies the mount for the volumes specified in `Volumes` section.
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

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

func (*TargetVolumeInfo) DeepCopy added in v0.7.0

func (in *TargetVolumeInfo) DeepCopy() *TargetVolumeInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetVolumeInfo.

func (*TargetVolumeInfo) DeepCopyInto added in v0.7.0

func (in *TargetVolumeInfo) DeepCopyInto(out *TargetVolumeInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeClaimRestorePolicy added in v0.7.0

type VolumeClaimRestorePolicy string

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.

+enum +kubebuilder:validation:Enum={Parallel,Serial}

const (
	VolumeClaimRestorePolicyParallel VolumeClaimRestorePolicy = "Parallel"
	VolumeClaimRestorePolicySerial   VolumeClaimRestorePolicy = "Serial"
)

type VolumeConfig added in v0.7.0

type VolumeConfig struct {
	// volumeSource describes the volume will be restored from the specified volume of the backup targetVolumes.
	// required if the backup uses volume snapshot.
	// +optional
	VolumeSource string `json:"volumeSource,omitempty"`

	// mountPath path within the restoring container at which the volume should be mounted.
	// +optional
	MountPath string `json:"mountPath,omitempty"`
}

func (*VolumeConfig) DeepCopy added in v0.7.0

func (in *VolumeConfig) DeepCopy() *VolumeConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeConfig.

func (*VolumeConfig) DeepCopyInto added in v0.7.0

func (in *VolumeConfig) DeepCopyInto(out *VolumeConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeSnapshotStatus added in v0.7.0

type VolumeSnapshotStatus struct {
	// name is the name of the volume snapshot.
	Name string `json:"name,omitempty"`

	// contentName is the name of the volume snapshot content.
	ContentName string `json:"contentName,omitempty"`

	// volumeName is the name of the volume.
	// +optional
	VolumeName string `json:"volumeName,omitempty"`

	// size is the size of the volume snapshot.
	// +optional
	Size string `json:"size,omitempty"`
}

func (*VolumeSnapshotStatus) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotStatus.

func (*VolumeSnapshotStatus) DeepCopyInto added in v0.7.0

func (in *VolumeSnapshotStatus) DeepCopyInto(out *VolumeSnapshotStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL