v1alpha1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 29 Imported by: 3

Documentation

Overview

+groupName=core.kubestash.com

Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group +kubebuilder:object:generate=true +groupName=core.kubestash.com

Index

Constants

View Source
const (
	ResourceKindBackupBatch     = "BackupBatch"
	ResourceSingularBackupBatch = "backupbatch"
	ResourcePluralBackupBatch   = "backupbatches"
)
View Source
const (
	ResourceKindBackupBlueprint     = "BackupBlueprint"
	ResourceSingularBackupBlueprint = "backupblueprint"
	ResourcePluralBackupBlueprint   = "backupblueprints"
)
View Source
const (
	ResourceKindBackupConfiguration     = "BackupConfiguration"
	ResourceSingularBackupConfiguration = "backupconfiguration"
	ResourcePluralBackupConfiguration   = "backupconfigurations"
)
View Source
const (
	// TypeValidationPassed indicates the validation conditions of the CRD are passed or not.
	TypeValidationPassed           = "ValidationPassed"
	ReasonResourceValidationPassed = "ResourceValidationPassed"
	ReasonResourceValidationFailed = "ResourceValidationFailed"

	// TypeSchedulerEnsured indicates whether the Scheduler is ensured or not.
	TypeSchedulerEnsured      = "SchedulerEnsured"
	ReasonSchedulerNotEnsured = "SchedulerNotEnsured"
	ReasonSchedulerEnsured    = "SchedulerEnsured"
)
View Source
const (
	ResourceKindBackupSession     = "BackupSession"
	ResourceSingularBackupSession = "backupsession"
	ResourcePluralBackupSession   = "backupsessions"
)
View Source
const (
	// TypeBackupSkipped indicates that the current session was skipped
	TypeBackupSkipped = "BackupSkipped"
	// ReasonSkippedTakingNewBackup indicates that the backup was skipped because another backup was running or backup invoker is not ready state.
	ReasonSkippedTakingNewBackup = "PreRequisitesNotSatisfied"

	// TypeSessionHistoryCleaned indicates whether the backup history was cleaned or not according to backupHistoryLimit
	TypeSessionHistoryCleaned               = "SessionHistoryCleaned"
	ReasonSuccessfullyCleanedSessionHistory = "SuccessfullyCleanedSessionHistory"
	ReasonFailedToCleanSessionHistory       = "FailedToCleanSessionHistory"

	// TypePreBackupHooksExecutionSucceeded indicates whether the pre-backup hooks were executed successfully or not
	TypePreBackupHooksExecutionSucceeded     = "PreBackupHooksExecutionSucceeded"
	ReasonSuccessfullyExecutedPreBackupHooks = "SuccessfullyExecutedPreBackupHooks"
	ReasonFailedToExecutePreBackupHooks      = "FailedToExecutePreBackupHooks"

	// TypePostBackupHooksExecutionSucceeded indicates whether the pre-backup hooks were executed successfully or not
	TypePostBackupHooksExecutionSucceeded     = "PostBackupHooksExecutionSucceeded"
	ReasonSuccessfullyExecutedPostBackupHooks = "SuccessfullyExecutedPostBackupHooks"
	ReasonFailedToExecutePostBackupHooks      = "FailedToExecutePostBackupHooks"

	// TypeBackupExecutorEnsured indicates whether the Backup Executor is ensured or not.
	TypeBackupExecutorEnsured               = "BackupExecutorEnsured"
	ReasonSuccessfullyEnsuredBackupExecutor = "SuccessfullyEnsuredBackupExecutor"
	ReasonFailedToEnsureBackupExecutor      = "FailedToEnsureBackupExecutor"

	// TypeSnapshotsEnsured indicates whether Snapshots are ensured for each Repository or not
	TypeSnapshotsEnsured               = "SnapshotsEnsured"
	ReasonSuccessfullyEnsuredSnapshots = "SuccessfullyEnsuredSnapshots"
	ReasonFailedToEnsureSnapshots      = "FailedToEnsureSnapshots"
)
View Source
const (
	ResourceKindHookTemplate     = "HookTemplate"
	ResourceSingularHookTemplate = "hooktemplate"
	ResourcePluralHookTemplate   = "hooktemplates"
)
View Source
const (
	ResourceKindRestoreSession     = "RestoreSession"
	ResourceSingularRestoreSession = "restoresession"
	ResourcePluralRestoreSession   = "restoresessions"
)
View Source
const (
	TypeRestoreExecutorEnsured               = "RestoreExecutorEnsured"
	ReasonSuccessfullyEnsuredRestoreExecutor = "SuccessfullyEnsuredRestoreExecutor"
	ReasonFailedToEnsureRestoreExecutor      = "FailedToEnsureRestoreExecutor"

	TypePreRestoreHooksExecutionSucceeded     = "PreRestoreHooksExecutionSucceeded"
	ReasonSuccessfullyExecutedPreRestoreHooks = "SuccessfullyExecutedPreRestoreHooks"
	ReasonFailedToExecutePreRestoreHooks      = "FailedToExecutePreRestoreHooks"

	TypePostRestoreHooksExecutionSucceeded     = "PostRestoreHooksExecutionSucceeded"
	ReasonSuccessfullyExecutedPostRestoreHooks = "SuccessfullyExecutedPostRestoreHooks"
	ReasonFailedToExecutePostRestoreHooks      = "FailedToExecutePostRestoreHooks"

	TypeRestoreTargetFound                = "RestoreTargetFound"
	ReasonUnableToCheckTargetAvailability = "UnableToCheckTargetAvailability"
)
View Source
const (
	TypeDeadlineExceeded                 = "DeadlineExceeded"
	ReasonFailedToCompleteWithinDeadline = "FailedToCompleteWithinDeadline"

	// TypeMetricsPushed indicates whether Metrics are pushed or not
	TypeMetricsPushed               = "MetricsPushed"
	ReasonSuccessfullyPushedMetrics = "SuccessfullyPushedMetrics"
	ReasonFailedToPushMetrics       = "FailedToPushMetrics"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "core.kubestash.com", 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
)

Functions

func GenerateBackupSessionName

func GenerateBackupSessionName(invokerName, sessionName string) string

Types

type AddonInfo

type AddonInfo struct {
	// Name specifies the name of the addon that will be used for the backup/restore purpose
	Name string `json:"name,omitempty"`

	// Tasks specifies a list of backup/restore tasks and their configuration parameters
	Tasks []TaskReference `json:"tasks,omitempty"`

	// ContainerRuntimeSettings specifies runtime settings for the backup/restore executor container
	// +optional
	ContainerRuntimeSettings *ofst.ContainerRuntimeSettings `json:"containerRuntimeSettings,omitempty"`

	// JobTemplate specifies runtime configurations for the backup/restore Job
	// +optional
	JobTemplate *ofst.PodTemplateSpec `json:"jobTemplate,omitempty"`
}

AddonInfo specifies addon configuration that will be used to backup/restore the respective target.

func (*AddonInfo) DeepCopy

func (in *AddonInfo) DeepCopy() *AddonInfo

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

func (*AddonInfo) DeepCopyInto

func (in *AddonInfo) DeepCopyInto(out *AddonInfo)

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

type AddonVolumeInfo added in v0.2.0

type AddonVolumeInfo struct {
	// Name specifies the name of the volume
	Name string `json:"name,omitempty"`

	// Source specifies the source of this volume.
	Source *apis.VolumeSource `json:"source,omitempty"`
}

AddonVolumeInfo specifies the name and the source of volume

func (*AddonVolumeInfo) DeepCopy added in v0.2.0

func (in *AddonVolumeInfo) DeepCopy() *AddonVolumeInfo

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

func (*AddonVolumeInfo) DeepCopyInto added in v0.2.0

func (in *AddonVolumeInfo) DeepCopyInto(out *AddonVolumeInfo)

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

type BackendReference

type BackendReference struct {
	// Name provides an identifier for this storage.
	Name string `json:"name,omitempty"`

	// StorageRef refers to the CR that holds the information of a storage.
	// You can refer to the BackupStorage CR of a different namespace as long as it is allowed
	// by the `usagePolicy` of the BackupStorage.`
	StorageRef *kmapi.ObjectReference `json:"storageRef,omitempty"`

	// RetentionPolicy refers to a RetentionPolicy CRs which defines how to cleanup the old Snapshots.
	// This field is optional. If you don't provide this field, KubeStash will use the default RetentionPolicy for
	// the namespace. If there is no default RetentionPolicy for the namespace, then KubeStash will find a
	// RetentionPolicy from other namespaces that is allowed to use from the current namespace.
	// +optional
	RetentionPolicy *kmapi.ObjectReference `json:"retentionPolicy,omitempty"`
}

BackendReference specifies reference to a storage where the backed up data will be stored.

func (*BackendReference) DeepCopy

func (in *BackendReference) DeepCopy() *BackendReference

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

func (*BackendReference) DeepCopyInto

func (in *BackendReference) DeepCopyInto(out *BackendReference)

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

type BackendStatus

type BackendStatus struct {
	// Name indicates the backend name
	Name string `json:"name,omitempty"`

	// Ready indicates whether the respective BackupStorage is ready or not
	// +optional
	Ready *bool `json:"ready,omitempty"`

	// Storage indicates the status of the respective BackupStorage
	// +optional
	Storage *StorageStatus `json:"storage,omitempty"`

	// RetentionPolicy indicates the status of the respective RetentionPolicy
	// +optional
	RetentionPolicy *RetentionPolicyStatus `json:"retentionPolicy,omitempty"`
}

BackendStatus specifies the status of the backends

func (*BackendStatus) DeepCopy

func (in *BackendStatus) DeepCopy() *BackendStatus

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

func (*BackendStatus) DeepCopyInto

func (in *BackendStatus) DeepCopyInto(out *BackendStatus)

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

type BackupBatch

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

	Spec   BackupBatchSpec   `json:"spec,omitempty"`
	Status BackupBatchStatus `json:"status,omitempty"`
}

BackupBatch specifies the configurations for taking backup of multiple co-related applications.

func (BackupBatch) CustomResourceDefinition

func (_ BackupBatch) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupBatch) DeepCopy

func (in *BackupBatch) DeepCopy() *BackupBatch

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

func (*BackupBatch) DeepCopyInto

func (in *BackupBatch) DeepCopyInto(out *BackupBatch)

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

func (*BackupBatch) DeepCopyObject

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

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

func (BackupBatch) HasTarget

func (bb BackupBatch) HasTarget(target kmapi.TypedObjectReference) bool

func (*BackupBatch) SetupWebhookWithManager

func (r *BackupBatch) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*BackupBatch) ValidateCreate

func (r *BackupBatch) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*BackupBatch) ValidateDelete

func (r *BackupBatch) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*BackupBatch) ValidateUpdate

func (r *BackupBatch) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type BackupBatchList

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

BackupBatchList contains a list of BackupBatch

func (*BackupBatchList) DeepCopy

func (in *BackupBatchList) DeepCopy() *BackupBatchList

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

func (*BackupBatchList) DeepCopyInto

func (in *BackupBatchList) DeepCopyInto(out *BackupBatchList)

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

func (*BackupBatchList) DeepCopyObject

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

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

type BackupBatchSpec

type BackupBatchSpec struct {
	// Backends specifies a list of storage references where the backed up data will be stored.
	// The respective BackupStorages can be in a different namespace than the BackupBatch.
	// However, it must be allowed by the `usagePolicy` of the BackupStorage to refer from this namespace.
	//
	// This field is optional, if you don't provide any backend here, KubeStash will use the default BackupStorage for the namespace.
	// If a default BackupStorage does not exist in the same namespace, then KubeStash will look for a default BackupStorage
	// in other namespaces that allows using it from the BackupBatch namespace.
	// +optional
	Backends []BackendReference `json:"backends,omitempty"`

	// Targets specifies a list of targets that are subject to backup.
	Targets []TargetReference `json:"targets,omitempty"`

	// Session defines a list of session configurations that specifies when and how to take backup.
	Sessions []BatchSession `json:"sessions,omitempty"`

	// Paused indicates that the BackupBatch has been paused from taking backup. Default value is 'false'.
	// If you set `paused` field to `true`, KubeStash will suspend the respective backup triggering CronJob and
	// skip processing any further events for this BackupBatch.
	// +optional
	Paused bool `json:"paused,omitempty"`
}

BackupBatchSpec defines the targets of backup, the backend where the backed up data will be stored, and the session configuration which specifies when and how to take the backup.

func (*BackupBatchSpec) DeepCopy

func (in *BackupBatchSpec) DeepCopy() *BackupBatchSpec

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

func (*BackupBatchSpec) DeepCopyInto

func (in *BackupBatchSpec) DeepCopyInto(out *BackupBatchSpec)

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

type BackupBatchStatus

type BackupBatchStatus struct {
	// +optional
	OffshootStatus `json:",inline"`

	// Phase represents the current state of the Backup Invoker.
	// +optional
	Phase BackupInvokerPhase `json:"phase,omitempty"`

	// Targets specifies whether the backup targets exist or not
	// +optional
	Targets []ResourceFoundStatus `json:"targets,omitempty"`

	// Conditions represents list of conditions regarding this BackupConfiguration
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

BackupBatchStatus defines the observed state of BackupBatch

func (*BackupBatchStatus) DeepCopy

func (in *BackupBatchStatus) DeepCopy() *BackupBatchStatus

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

func (*BackupBatchStatus) DeepCopyInto

func (in *BackupBatchStatus) DeepCopyInto(out *BackupBatchStatus)

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

type BackupBlueprint

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

	Spec BackupBlueprintSpec `json:"spec,omitempty"`
}

BackupBlueprint lets you define a common template for taking backup for all the similar applications. Then, you can just apply some annotations in the targeted application to enable backup. KubeStash will automatically resolve the template and create a BackupConfiguration for the targeted application.

func (BackupBlueprint) CustomResourceDefinition

func (_ BackupBlueprint) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupBlueprint) DeepCopy

func (in *BackupBlueprint) DeepCopy() *BackupBlueprint

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

func (*BackupBlueprint) DeepCopyInto

func (in *BackupBlueprint) DeepCopyInto(out *BackupBlueprint)

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

func (*BackupBlueprint) DeepCopyObject

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

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

func (*BackupBlueprint) Default

func (r *BackupBlueprint) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*BackupBlueprint) OffshootLabels added in v0.2.0

func (b *BackupBlueprint) OffshootLabels() map[string]string

func (*BackupBlueprint) SetupWebhookWithManager

func (r *BackupBlueprint) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*BackupBlueprint) UsageAllowed added in v0.2.0

func (b *BackupBlueprint) UsageAllowed(srcNamespace *corev1.Namespace) bool

func (*BackupBlueprint) ValidateCreate

func (r *BackupBlueprint) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*BackupBlueprint) ValidateDelete

func (r *BackupBlueprint) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*BackupBlueprint) ValidateUpdate

func (r *BackupBlueprint) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type BackupBlueprintList

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

BackupBlueprintList contains a list of BackupBlueprint

func (*BackupBlueprintList) DeepCopy

func (in *BackupBlueprintList) DeepCopy() *BackupBlueprintList

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

func (*BackupBlueprintList) DeepCopyInto

func (in *BackupBlueprintList) DeepCopyInto(out *BackupBlueprintList)

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

func (*BackupBlueprintList) DeepCopyObject

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

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

type BackupBlueprintSpec

type BackupBlueprintSpec struct {
	// BackupConfigurationTemplate Specifies the BackupConfiguration that will be created by BackupBlueprint.
	BackupConfigurationTemplate *BackupConfigurationTemplate `json:"backupConfigurationTemplate,omitempty"`

	// Subjects specify a list of subject to which this BackupBlueprint is applicable. KubeStash will start watcher for these resources.
	// Multiple BackupBlueprints can have common subject. The watcher will find the appropriate blueprint from its annotations.
	Subjects []metav1.TypeMeta `json:"subjects,omitempty"`

	// UsagePolicy specifies a policy of how this BackupBlueprint will be used. For example,
	// you can use `allowedNamespaces` policy to restrict the usage of this BackupBlueprint to particular namespaces.
	// This field is optional. If you don't provide the usagePolicy, then it can be used only from the current namespace.
	// +optional
	UsagePolicy *apis.UsagePolicy `json:"usagePolicy,omitempty"`
}

BackupBlueprintSpec defines the desired state of BackupBlueprint

func (*BackupBlueprintSpec) DeepCopy

func (in *BackupBlueprintSpec) DeepCopy() *BackupBlueprintSpec

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

func (*BackupBlueprintSpec) DeepCopyInto

func (in *BackupBlueprintSpec) DeepCopyInto(out *BackupBlueprintSpec)

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

type BackupConfiguration

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

	Spec   BackupConfigurationSpec   `json:"spec,omitempty"`
	Status BackupConfigurationStatus `json:"status,omitempty"`
}

BackupConfiguration specifies the configuration for taking backup of a target application.

func (*BackupConfiguration) CalculatePhase

func (b *BackupConfiguration) CalculatePhase() BackupInvokerPhase

func (BackupConfiguration) CustomResourceDefinition

func (_ BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupConfiguration) DeepCopy

func (in *BackupConfiguration) DeepCopy() *BackupConfiguration

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

func (*BackupConfiguration) DeepCopyInto

func (in *BackupConfiguration) DeepCopyInto(out *BackupConfiguration)

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

func (*BackupConfiguration) DeepCopyObject

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

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

func (*BackupConfiguration) Default added in v0.2.0

func (b *BackupConfiguration) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*BackupConfiguration) GetStorageRef

func (b *BackupConfiguration) GetStorageRef(backend string) *kmapi.ObjectReference

func (*BackupConfiguration) GetTargetRef added in v0.2.0

func (b *BackupConfiguration) GetTargetRef() *kmapi.TypedObjectReference

func (*BackupConfiguration) SetupWebhookWithManager

func (b *BackupConfiguration) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*BackupConfiguration) ValidateCreate

func (b *BackupConfiguration) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*BackupConfiguration) ValidateDelete

func (b *BackupConfiguration) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*BackupConfiguration) ValidateUpdate

func (b *BackupConfiguration) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type BackupConfigurationList

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

BackupConfigurationList contains a list of BackupConfiguration

func (*BackupConfigurationList) DeepCopy

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

func (*BackupConfigurationList) DeepCopyInto

func (in *BackupConfigurationList) DeepCopyInto(out *BackupConfigurationList)

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

func (*BackupConfigurationList) DeepCopyObject

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

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

type BackupConfigurationSpec

type BackupConfigurationSpec struct {
	// Target refers to the target of backup. The target must be in the same namespace as the BackupConfiguration.
	Target *kmapi.TypedObjectReference `json:"target,omitempty"`

	// Backends specifies a list of storage references where the backed up data will be stored.
	// The respective BackupStorages can be in a different namespace than the BackupConfiguration.
	// However, it must be allowed by the `usagePolicy` of the BackupStorage to refer from this namespace.
	//
	// This field is optional, if you don't provide any backend here, KubeStash will use the default BackupStorage for the namespace.
	// If a default BackupStorage does not exist in the same namespace, then KubeStash will look for a default BackupStorage
	// in other namespaces that allows using it from the BackupConfiguration namespace.
	// +optional
	Backends []BackendReference `json:"backends,omitempty"`

	// Sessions defines a list of session configuration that specifies when and how to take backup.
	Sessions []Session `json:"sessions,omitempty"`

	// Paused indicates that the BackupConfiguration has been paused from taking backup. Default value is 'false'.
	// If you set `paused` field to `true`, KubeStash will suspend the respective backup triggering CronJob and
	// skip processing any further events for this BackupConfiguration.
	// +optional
	Paused bool `json:"paused,omitempty"`
}

BackupConfigurationSpec defines the target of backup, the backends where the data will be stored, and the sessions that specifies when and how to take backup.

func (*BackupConfigurationSpec) DeepCopy

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

func (*BackupConfigurationSpec) DeepCopyInto

func (in *BackupConfigurationSpec) DeepCopyInto(out *BackupConfigurationSpec)

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

type BackupConfigurationStatus

type BackupConfigurationStatus struct {
	// +optional
	OffshootStatus `json:",inline"`

	// Phase represents the current state of the Backup Invoker.
	// +optional
	Phase BackupInvokerPhase `json:"phase,omitempty"`

	// TargetFound specifies whether the backup target exist or not
	// +optional
	TargetFound *bool `json:"targetFound,omitempty"`

	// Conditions represents list of conditions regarding this BackupConfiguration
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

BackupConfigurationStatus defines the observed state of BackupConfiguration

func (*BackupConfigurationStatus) DeepCopy

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

func (*BackupConfigurationStatus) DeepCopyInto

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

type BackupConfigurationTemplate added in v0.2.0

type BackupConfigurationTemplate struct {
	// Namespace specifies the namespace of the BackupConfiguration.
	// The field is optional. If you don't provide the namespace, then BackupConfiguration will be created in the BackupBlueprint namespace.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Backends specifies a list of storage references where the backed up data will be stored.
	// The respective BackupStorages can be in a different namespace than the BackupConfiguration.
	// However, it must be allowed by the `usagePolicy` of the BackupStorage to refer from this namespace.
	//
	// This field is optional, if you don't provide any backend here, KubeStash will use the default BackupStorage for the namespace.
	// If a default BackupStorage does not exist in the same namespace, then KubeStash will look for a default BackupStorage
	// in other namespaces that allows using it from the BackupConfiguration namespace.
	// +optional
	Backends []BackendReference `json:"backends,omitempty"`

	// Sessions specifies a list of session template for backup. You can use custom variables
	// in your template then provide the variable value through annotations.
	Sessions []Session `json:"sessions,omitempty"`

	// DeletionPolicy specifies whether the BackupConfiguration will be deleted on BackupBlueprint deletion
	// This field is optional, if you don't provide deletionPolicy, then BackupConfiguration will not be deleted on BackupBlueprint deletion
	// +optional
	DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
}

BackupConfigurationTemplate specifies the template for the BackupConfiguration created by the BackupBlueprint.

func (*BackupConfigurationTemplate) DeepCopy added in v0.2.0

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

func (*BackupConfigurationTemplate) DeepCopyInto added in v0.2.0

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

type BackupHooks

type BackupHooks struct {
	// PreBackup specifies a list of hooks that will be executed before backup
	// +optional
	PreBackup []HookInfo `json:"preBackup,omitempty"`

	// PostBackup specifies a list of hooks that will be executed after backup
	// +optional
	PostBackup []HookInfo `json:"postBackup,omitempty"`
}

BackupHooks specifies the hooks that will be executed before and/or after backup

func (*BackupHooks) DeepCopy

func (in *BackupHooks) DeepCopy() *BackupHooks

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

func (*BackupHooks) DeepCopyInto

func (in *BackupHooks) DeepCopyInto(out *BackupHooks)

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

type BackupInvokerPhase

type BackupInvokerPhase string

BackupInvokerPhase specifies the current state of the backup setup process +kubebuilder:validation:Enum=NotReady;Ready;Invalid

const (
	BackupInvokerNotReady BackupInvokerPhase = "NotReady"
	BackupInvokerReady    BackupInvokerPhase = "Ready"
	BackupInvokerInvalid  BackupInvokerPhase = "Invalid"
)

type BackupSession

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

	Spec   BackupSessionSpec   `json:"spec,omitempty"`
	Status BackupSessionStatus `json:"status,omitempty"`
}

BackupSession represent one backup run for the target(s) pointed by the respective BackupConfiguration or BackupBatch

func (*BackupSession) CalculatePhase

func (b *BackupSession) CalculatePhase() BackupSessionPhase

func (BackupSession) CustomResourceDefinition

func (_ BackupSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupSession) DeepCopy

func (in *BackupSession) DeepCopy() *BackupSession

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

func (*BackupSession) DeepCopyInto

func (in *BackupSession) DeepCopyInto(out *BackupSession)

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

func (*BackupSession) DeepCopyObject

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

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

func (*BackupSession) FinalStepExecuted

func (b *BackupSession) FinalStepExecuted() bool

func (*BackupSession) GetSummary added in v0.2.0

func (b *BackupSession) GetSummary(targetRef *kmapi.TypedObjectReference) *Summary

func (*BackupSession) IsCompleted added in v0.2.0

func (b *BackupSession) IsCompleted() bool

func (*BackupSession) IsRunning

func (b *BackupSession) IsRunning() bool

func (*BackupSession) OffshootLabels added in v0.2.0

func (b *BackupSession) OffshootLabels() map[string]string

func (*BackupSession) SetupWebhookWithManager

func (r *BackupSession) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*BackupSession) ValidateCreate

func (r *BackupSession) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*BackupSession) ValidateDelete

func (r *BackupSession) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*BackupSession) ValidateUpdate

func (r *BackupSession) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type BackupSessionList

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

BackupSessionList contains a list of BackupSession

func (*BackupSessionList) DeepCopy

func (in *BackupSessionList) DeepCopy() *BackupSessionList

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

func (*BackupSessionList) DeepCopyInto

func (in *BackupSessionList) DeepCopyInto(out *BackupSessionList)

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

func (*BackupSessionList) DeepCopyObject

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

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

type BackupSessionPhase

type BackupSessionPhase string

BackupSessionPhase specifies the current state of the backup process +kubebuilder:validation:Enum=Pending;Running;Succeeded;Failed;Skipped

const (
	BackupSessionPending   BackupSessionPhase = "Pending"
	BackupSessionRunning   BackupSessionPhase = "Running"
	BackupSessionSucceeded BackupSessionPhase = "Succeeded"
	BackupSessionFailed    BackupSessionPhase = "Failed"
	BackupSessionSkipped   BackupSessionPhase = "Skipped"
)

type BackupSessionSpec

type BackupSessionSpec struct {
	// Invoker points to the respective BackupConfiguration or BackupBatch
	// which is responsible for triggering this backup.
	Invoker *core.TypedLocalObjectReference `json:"invoker,omitempty"`

	// Session specifies the name of the session that triggered this backup
	Session string `json:"session,omitempty"`

	// RetryLeft specifies number of retry attempts left for the session.
	// If this set to non-zero, KubeStash will create a new BackupSession if the current one fails.
	// +optional
	RetryLeft int32 `json:"retryLeft,omitempty"`
}

BackupSessionSpec specifies the information related to the respective backup invoker and session.

func (*BackupSessionSpec) DeepCopy

func (in *BackupSessionSpec) DeepCopy() *BackupSessionSpec

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

func (*BackupSessionSpec) DeepCopyInto

func (in *BackupSessionSpec) DeepCopyInto(out *BackupSessionSpec)

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

type BackupSessionStatus

type BackupSessionStatus struct {
	// Phase represents the current state of the backup process.
	// +optional
	Phase BackupSessionPhase `json:"phase,omitempty"`

	// Duration specifies the time required to complete the backup process
	// +optional
	Duration string `json:"duration,omitempty"`

	// Deadline specifies the deadline of backup. BackupSession will be
	// considered Failed if backup does not complete within this deadline
	// +optional
	Deadline *metav1.Time `json:"sessionDeadline,omitempty"`

	// Snapshots specifies the Snapshots status
	// +optional
	Snapshots []SnapshotStatus `json:"snapshots,omitempty"`

	// Hooks represents the hook execution status
	// +optional
	Hooks HookStatus `json:"hooks,omitempty"`

	// Verifications specifies the backup verification status
	// +optional
	Verifications []VerificationStatus `json:"verifications,omitempty"`

	// RetentionPolices specifies whether the retention policies were properly applied on the repositories or not
	// +optional
	RetentionPolicies []RetentionPolicyApplyStatus `json:"retentionPolicy,omitempty"`

	// Retried specifies whether this session was retried or not.
	// This field will exist only if the `retryConfig` has been set in the respective backup invoker.
	// +optional
	Retried *bool `json:"retried,omitempty"`

	// NextRetry specifies the time when KubeStash should retry the current failed backup.
	// This field will exist only if the `retryConfig` has been set in the respective backup invoker.
	// +optional
	NextRetry *metav1.Time `json:"nextRetry,omitempty"`

	// Conditions represents list of conditions regarding this BackupSession
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

BackupSessionStatus defines the observed state of BackupSession

func (*BackupSessionStatus) DeepCopy

func (in *BackupSessionStatus) DeepCopy() *BackupSessionStatus

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

func (*BackupSessionStatus) DeepCopyInto

func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus)

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

type BackupVerificationPhase

type BackupVerificationPhase string

BackupVerificationPhase represents the state of the backup verification process +kubebuilder:validation:Enum=Verified;NotVerified;VerificationFailed

const (
	Verified           BackupVerificationPhase = "Verified"
	NotVerified        BackupVerificationPhase = "NotVerified"
	VerificationFailed BackupVerificationPhase = "VerificationFailed"
)

type BatchSession

type BatchSession struct {
	*SessionConfig `json:",inline"`

	// Targets specifies a list of target backup specification.
	Targets []TargetBackupSpec `json:"targets,omitempty"`
}

BatchSession specifies the session configuration for the targets.

func (*BatchSession) DeepCopy

func (in *BatchSession) DeepCopy() *BatchSession

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

func (*BatchSession) DeepCopyInto

func (in *BatchSession) DeepCopyInto(out *BatchSession)

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

type ComponentRestoreStatus

type ComponentRestoreStatus struct {
	// Phase represents the restore phase of the component
	// +optional
	Phase RestorePhase `json:"phase,omitempty"`

	// Duration specifies the total time taken to complete the restore process for this component
	// +optional
	Duration string `json:"duration,omitempty"`

	// Error specifies the reason in case of restore failure for the component
	// +optional
	Error string `json:"error,omitempty"`
}

ComponentRestoreStatus represents the restore status of individual components

func (*ComponentRestoreStatus) DeepCopy

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

func (*ComponentRestoreStatus) DeepCopyInto

func (in *ComponentRestoreStatus) DeepCopyInto(out *ComponentRestoreStatus)

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

type DeletionPolicy added in v0.2.0

type DeletionPolicy string

DeletionPolicy specifies whether the BackupConfiguration will be deleted on BackupBlueprint deletion +kubebuilder:validation:Enum=OnDelete

const (
	DeletionPolicyOnDelete DeletionPolicy = "OnDelete"
)

type FailurePolicy

type FailurePolicy string

FailurePolicy specifies what to do if a backup/restore fails +kubebuilder:validation:Enum=Fail;Retry

const (
	FailurePolicyFail  FailurePolicy = "Fail"
	FailurePolicyRetry FailurePolicy = "Retry"
)

type FunctionHookExecutorSpec

type FunctionHookExecutorSpec struct {
	// Name indicate the name of the Function that contains the container definition for executing the hook logic
	Name string `json:"name,omitempty"`

	// EnvVariables specifies a list of environment variables that will be passed to the executor container
	// +optional
	EnvVariables []core.EnvVar `json:"env,omitempty"`

	// VolumeMounts specifies the volumes mounts for the executor container
	// +optional
	VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty"`

	// Volumes specifies the volumes that will be mounted in the executor container
	// +optional
	Volumes []ofst.Volume `json:"volumes,omitempty"`
}

FunctionHookExecutorSpec defines function and its parameters that will be used to create hook executor job

func (*FunctionHookExecutorSpec) DeepCopy

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

func (*FunctionHookExecutorSpec) DeepCopyInto

func (in *FunctionHookExecutorSpec) DeepCopyInto(out *FunctionHookExecutorSpec)

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

type HookExecutionPhase

type HookExecutionPhase string

HookExecutionPhase specifies the state of the hook execution +kubebuilder:validation:Enum=Succeeded;Failed;Pending

const (
	HookExecutionSucceeded HookExecutionPhase = "Succeeded"
	HookExecutionFailed    HookExecutionPhase = "Failed"
	HookExecutionPending   HookExecutionPhase = "Pending"
)

type HookExecutionPolicy

type HookExecutionPolicy string

HookExecutionPolicy specifies when to execute the hook. +kubebuilder:validation:Enum=Always;OnSuccess;OnFailure

const (
	ExecuteAlways    HookExecutionPolicy = "Always"
	ExecuteOnSuccess HookExecutionPolicy = "OnSuccess"
	ExecuteOnFailure HookExecutionPolicy = "OnFailure"
)

type HookExecutionStatus

type HookExecutionStatus struct {
	// Name indicates the name of the hook whose status is being shown here.
	Name string `json:"name,omitempty"`

	// Phase represents the hook execution phase
	// +optional
	Phase HookExecutionPhase `json:"phase,omitempty"`
}

HookExecutionStatus represents the state of the hook execution

func (*HookExecutionStatus) DeepCopy

func (in *HookExecutionStatus) DeepCopy() *HookExecutionStatus

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

func (*HookExecutionStatus) DeepCopyInto

func (in *HookExecutionStatus) DeepCopyInto(out *HookExecutionStatus)

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

type HookExecutor

type HookExecutor struct {
	// Type indicate the types of entity that will execute the hook.
	// Valid values are:
	// - "Function": KubeStash will create a job with the provided information in `function` section. The job will execute the hook.
	// - "Pod": KubeStash will select the pod that matches the selector provided in `pod` section. This pod(s) will execute the hook.
	// - "Operator": KubeStash operator itself will execute the hook.
	Type HookExecutorType `json:"type,omitempty"`

	// Function specifies the function information which will be used to create the hook executor job.
	// +optional
	Function *FunctionHookExecutorSpec `json:"function,omitempty"`

	// Pod specifies the criteria to use to select the hook executor pods
	// +optional
	Pod *PodHookExecutorSpec `json:"pod,omitempty"`
}

HookExecutor specifies the entity specification which is responsible for executing the hook

func (*HookExecutor) DeepCopy

func (in *HookExecutor) DeepCopy() *HookExecutor

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

func (*HookExecutor) DeepCopyInto

func (in *HookExecutor) DeepCopyInto(out *HookExecutor)

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

type HookExecutorType

type HookExecutorType string

HookExecutorType specifies the type of entity that will execute the hook +kubebuilder:validation:Enum=Function;Pod;Operator

const (
	HookExecutorFunction HookExecutorType = "Function"
	HookExecutorPod      HookExecutorType = "Pod"
	HookExecutorOperator HookExecutorType = "Operator"
)

type HookInfo

type HookInfo struct {
	// Name specifies a name for the hook
	Name string `json:"name,omitempty"`

	// HookTemplate points to a HookTemplate CR that will be used to execute the hook.
	// You can refer to a HookTemplate from other namespaces as long as your current
	// namespace is allowed by the `usagePolicy` in the respective HookTemplate.
	HookTemplate *kmapi.ObjectReference `json:"hookTemplate,omitempty"`

	// Params specifies parameters for the hook. You must provide the parameter in the HookTemplates desired structure.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Params *runtime.RawExtension `json:"params,omitempty"`

	// MaxRetry specifies how many times KubeStash should retry the hook execution in case of failure.
	// The default value of this field is 0 which means no retry.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MaxRetry int32 `json:"maxRetry,omitempty"`

	// Timeout specifies a duration in seconds that KubeStash should wait for the hook execution to be completed.
	// If the hook execution does not finish within this time period, KubeStash will consider this hook execution as failure.
	// Then, it will be re-tried according to MaxRetry policy.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// ExecutionPolicy specifies when to execute the hook.
	// Valid values are:
	// - "Always": KubeStash will execute this hook no matter the backup/restore failed. This is the default execution policy.
	// - "OnSuccess": KubeStash will execute this hook only if the backup/restore has succeeded.
	// - "OnFailure": KubeStash will execute this hook only if the backup/restore has failed.
	// +kubebuilder:default=Always
	// +optional
	ExecutionPolicy HookExecutionPolicy `json:"executionPolicy,omitempty"`

	// Variables specifies a list of variables and their sources that will be used to resolve the HookTemplate.
	// +optional
	Variables []core.EnvVar `json:"variables,omitempty"`

	// Volumes indicates the list of volumes of targeted application that should be mounted on the hook executor.
	// Use this field only for `Function` type hook executor.
	// +optional
	Volumes []ofst.Volume `json:"volumes,omitempty"`

	// VolumeMounts specifies the mount for the volumes specified in `Volumes` section
	// Use this field only for `Function` type hook executor.
	// +optional
	VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty"`

	// RuntimeSettings specifies runtime configurations for the hook executor Job.
	// Use this field only for `Function` type hook executor.
	// +optional
	RuntimeSettings *ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`
}

HookInfo specifies the information about the backup/restore hooks

func (*HookInfo) DeepCopy

func (in *HookInfo) DeepCopy() *HookInfo

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

func (*HookInfo) DeepCopyInto

func (in *HookInfo) DeepCopyInto(out *HookInfo)

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

type HookStatus added in v0.2.0

type HookStatus struct {
	// PreHooks represents the pre-restore hook execution status
	// +optional
	PreHooks []HookExecutionStatus `json:"preHooks,omitempty"`

	// PostHooks represents the post-restore hook execution status
	// +optional
	PostHooks []HookExecutionStatus `json:"postHooks,omitempty"`
}

HookStatus represents the status of the hooks

func (*HookStatus) DeepCopy added in v0.2.0

func (in *HookStatus) DeepCopy() *HookStatus

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

func (*HookStatus) DeepCopyInto added in v0.2.0

func (in *HookStatus) DeepCopyInto(out *HookStatus)

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

type HookTemplate

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

	Spec HookTemplateSpec `json:"spec,omitempty"`
}

HookTemplate defines a template for some action that will be executed before or/and after backup/restore process. For example, there could be a HookTemplate that pause an application before backup and another HookTemplate that resume the application after backup. This is a namespaced CRD. However, you can use it from other namespaces. You can control which namespaces are allowed to use it using the `usagePolicy` section.

func (HookTemplate) CustomResourceDefinition

func (_ HookTemplate) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*HookTemplate) DeepCopy

func (in *HookTemplate) DeepCopy() *HookTemplate

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

func (*HookTemplate) DeepCopyInto

func (in *HookTemplate) DeepCopyInto(out *HookTemplate)

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

func (*HookTemplate) DeepCopyObject

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

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

func (*HookTemplate) Default

func (r *HookTemplate) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*HookTemplate) OffshootLabels added in v0.2.0

func (h *HookTemplate) OffshootLabels() map[string]string

func (*HookTemplate) SetupWebhookWithManager

func (r *HookTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*HookTemplate) UsageAllowed added in v0.2.0

func (h *HookTemplate) UsageAllowed(srcNamespace *corev1.Namespace) bool

func (*HookTemplate) ValidateCreate

func (r *HookTemplate) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*HookTemplate) ValidateDelete

func (r *HookTemplate) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*HookTemplate) ValidateUpdate

func (r *HookTemplate) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type HookTemplateList

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

HookTemplateList contains a list of HookTemplate

func (*HookTemplateList) DeepCopy

func (in *HookTemplateList) DeepCopy() *HookTemplateList

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

func (*HookTemplateList) DeepCopyInto

func (in *HookTemplateList) DeepCopyInto(out *HookTemplateList)

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

func (*HookTemplateList) DeepCopyObject

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

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

type HookTemplateSpec

type HookTemplateSpec struct {
	// UsagePolicy specifies a policy of how this HookTemplate will be used. For example,
	// you can use `allowedNamespaces` policy to restrict the usage of this HookTemplate to particular namespaces.
	//
	// This field is optional. If you don't provide the usagePolicy, then it can be used only from the current namespace.
	// +optional
	UsagePolicy *apis.UsagePolicy `json:"usagePolicy,omitempty"`

	// Params defines a list of parameters that is used by the HookTemplate to execute its logic.
	// +optional
	Params []apis.ParameterDefinition `json:"params,omitempty"`

	// Action specifies the operation that is performed by this HookTemplate
	// Valid values are:
	// - "exec": Execute command in a shell
	// - "httpGet": Do an HTTP GET request
	// - "httpPost": Do an HTTP POST request
	// - "tcpSocket": Check if a TCP socket open or not
	Action *prober.Handler `json:"action,omitempty"`

	// Executor specifies the entity where the hook will be executed.
	Executor *HookExecutor `json:"executor,omitempty"`
}

HookTemplateSpec defines the template for the operation that will be performed by this hook

func (*HookTemplateSpec) DeepCopy

func (in *HookTemplateSpec) DeepCopy() *HookTemplateSpec

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

func (*HookTemplateSpec) DeepCopyInto

func (in *HookTemplateSpec) DeepCopyInto(out *HookTemplateSpec)

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

type JobTemplate

type JobTemplate struct {
	// Specifies the maximum desired number of pods the job should
	// run at any given time. The actual number of pods running in steady state will
	// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
	// i.e. when the work left to do is less than max parallelism.
	// More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
	// +optional
	Parallelism *int32 `json:"parallelism,omitempty"`

	// Specifies the desired number of successfully finished pods the
	// job should be run with.  Setting to nil means that the success of any
	// pod signals the success of all pods, and allows parallelism to have any positive
	// value.  Setting to 1 means that parallelism is limited to 1 and the success of that
	// pod signals the success of the job.
	// More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
	// +optional
	Completions *int32 `json:"completions,omitempty"`

	// Specifies the duration in seconds relative to the startTime that the job
	// may be continuously active before the system tries to terminate it; value
	// must be positive integer. If a Job is suspended (at creation or through an
	// update), this timer will effectively be stopped and reset when the Job is
	// resumed again.
	// +optional
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`

	// Specifies the number of retries before marking this job failed.
	// Defaults to 6
	// +optional
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`

	// Describes the pod that will be created when executing a job.
	// +optional
	Template ofst.PodTemplateSpec `json:"template"`

	// ttlSecondsAfterFinished limits the lifetime of a Job that has finished
	// execution (either Complete or Failed). If this field is set,
	// ttlSecondsAfterFinished after the Job finishes, it is eligible to be
	// automatically deleted. When the Job is being deleted, its lifecycle
	// guarantees (e.g. finalizers) will be honored. If this field is unset,
	// the Job won't be automatically deleted. If this field is set to zero,
	// the Job becomes eligible to be deleted immediately after it finishes.
	// This field is alpha-level and is only honored by servers that enable the
	// TTLAfterFinished feature.
	// +optional
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

	// CompletionMode specifies how Pod completions are tracked. It can be
	// `NonIndexed` (default) or `Indexed`.
	//
	// `NonIndexed` means that the Job is considered complete when there have
	// been .spec.completions successfully completed Pods. Each Pod completion is
	// homologous to each other.
	//
	// `Indexed` means that the Pods of a
	// Job get an associated completion index from 0 to (.spec.completions - 1),
	// available in the annotation batch.kubernetes.io/job-completion-index.
	// The Job is considered complete when there is one successfully completed Pod
	// for each index.
	// When value is `Indexed`, .spec.completions must be specified and
	// `.spec.parallelism` must be less than or equal to 10^5.
	//
	// This field is alpha-level and is only honored by servers that enable the
	// IndexedJob feature gate. More completion modes can be added in the future.
	// If the Job controller observes a mode that it doesn't recognize, the
	// controller skips updates for the Job.
	// +optional
	CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`

	// Suspend specifies whether the Job controller should create Pods or not. If
	// a Job is created with suspend set to true, no Pods are created by the Job
	// controller. If a Job is suspended after creation (i.e. the flag goes from
	// false to true), the Job controller will delete all active Pods associated
	// with this Job. Users must design their workload to gracefully handle this.
	// Suspending a Job will reset the StartTime field of the Job, effectively
	// resetting the ActiveDeadlineSeconds timer too. This is an alpha field and
	// requires the SuspendJob feature gate to be enabled; otherwise this field
	// may not be set to true. Defaults to false.
	// +optional
	Suspend *bool `json:"suspend,omitempty"`
}

JobTemplate specifies the template for the Job created by the scheduler CronJob.

func (*JobTemplate) DeepCopy

func (in *JobTemplate) DeepCopy() *JobTemplate

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

func (*JobTemplate) DeepCopyInto

func (in *JobTemplate) DeepCopyInto(out *JobTemplate)

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

type KubeDBManifestOptions

type KubeDBManifestOptions struct {
	// DB specifies whether to restore the DB manifest or not
	// +optional
	DB bool `json:"db,omitempty"`

	// DBName specifies the new name of the DB yaml after restore
	// +optional
	DBName string `json:"dbName,omitempty"`

	// AuthSecret specifies whether to restore the AuthSecret manifest or not
	// +optional
	AuthSecret bool `json:"authSecret,omitempty"`

	// AuthSecretName specifies new name of the AuthSecret yaml after restore
	// +optional
	AuthSecretName string `json:"authSecretName,omitempty"`

	// ConfigSecret specifies whether to restore the ConfigSecret manifest or not
	// +optional
	ConfigSecret bool `json:"configSecret,omitempty"`

	// ConfigSecretName specifies new name of the ConfigSecret yaml after restore
	// +optional
	ConfigSecretName string `json:"configSecretName,omitempty"`

	// IssuerRefName specifies new name of the IssuerRef after restore
	// +optional
	IssuerRefName string `json:"issuerRefName,omitempty"`
}

func (*KubeDBManifestOptions) DeepCopy

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

func (*KubeDBManifestOptions) DeepCopyInto

func (in *KubeDBManifestOptions) DeepCopyInto(out *KubeDBManifestOptions)

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

type ManifestRestoreOptions

type ManifestRestoreOptions struct {
	// RestoreNamespace specifies the Namespace where the restored files will be applied
	//+optional
	RestoreNamespace string `json:"restoreNamespace,omitempty"`

	// MongoDB specifies the options for selecting particular MongoDB components to restore in manifest restore
	// +optional
	MongoDB *KubeDBManifestOptions `json:"mongoDB,omitempty"`

	// Postgres specifies the options for selecting particular Postgres components to restore in manifest restore
	// +optional
	Postgres *KubeDBManifestOptions `json:"postgres,omitempty"`

	// MySQL specifies the options for selecting particular MySQL components to restore in manifest restore
	// +optional
	MySQL *KubeDBManifestOptions `json:"mySQL,omitempty"`

	// MariaDB specifies the options for selecting particular MariaDB components to restore in manifest restore
	// +optional
	MariaDB *KubeDBManifestOptions `json:"mariaDB,omitempty"`
}

func (*ManifestRestoreOptions) DeepCopy

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

func (*ManifestRestoreOptions) DeepCopyInto

func (in *ManifestRestoreOptions) DeepCopyInto(out *ManifestRestoreOptions)

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

type OffshootStatus

type OffshootStatus struct {
	// Backends specifies whether the backends exist or not
	// +optional
	Backends []BackendStatus `json:"backends,omitempty"`

	// Repositories specifies whether the repositories have been successfully initialized or not
	// +optional
	Repositories []RepoStatus `json:"repositories,omitempty"`

	// Dependencies specifies whether the objects required by this BackupConfiguration exist or not
	// +optional
	Dependencies []ResourceFoundStatus `json:"dependencies,omitempty"`

	// Sessions specifies status of the session specific resources
	// +optional
	Sessions []SessionStatus `json:"sessions,omitempty"`
}

OffshootStatus specifies the status that are common between BackupConfiguration and BackupBatch

func (*OffshootStatus) DeepCopy

func (in *OffshootStatus) DeepCopy() *OffshootStatus

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

func (*OffshootStatus) DeepCopyInto

func (in *OffshootStatus) DeepCopyInto(out *OffshootStatus)

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

type PITR

type PITR struct {
	// TargetTime specifies the desired date and time at which you want to roll back your application data
	TargetTime *metav1.Time `json:"targetTime,omitempty"`

	// Exclusive specifies whether to exclude the Snapshot that falls in the exact time specified
	// in the `targetTime` field. By default, KubeStash will select the Snapshot that fall in the exact time.
	// +optional
	Exclusive bool `json:"exclusive,omitempty"`
}

PITR specifies the target time and behavior of Point-In-Time Recovery

func (*PITR) DeepCopy

func (in *PITR) DeepCopy() *PITR

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

func (*PITR) DeepCopyInto

func (in *PITR) DeepCopyInto(out *PITR)

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

type PodHookExecutionStrategy

type PodHookExecutionStrategy string

PodHookExecutionStrategy specifies the strategy to follow when multiple pods are selected for hook execution +kubebuilder:validation:Enum=ExecuteOnOne;ExecuteOnAll

const (
	ExecuteOnOne PodHookExecutionStrategy = "ExecuteOnOne"
	ExecuteOnAll PodHookExecutionStrategy = "ExecuteOnAll"
)

type PodHookExecutorSpec

type PodHookExecutorSpec struct {
	// Selector specifies list of key value pair that will be used as label selector to select the desired pods.
	// You can use comma to separate multiple labels (i.e. "app=my-app,env=prod")
	Selector string `json:"selector,omitempty"`

	// Owner specifies a template for owner reference that will be used to filter the selected pods.
	// +optional
	Owner *metav1.OwnerReference `json:"owner,omitempty"`

	// Strategy specifies what should be the behavior when multiple pods are selected
	// Valid values are:
	// - "ExecuteOnOne": Execute hook on only one of the selected pods. This is default behavior
	// - "ExecuteOnAll": Execute hook on all the selected pods.
	// +kubebuilder:default=ExecuteOnOne
	Strategy PodHookExecutionStrategy `json:"strategy,omitempty"`
}

PodHookExecutorSpec specifies the criteria that will be used to select the pod which will execute the hook

func (*PodHookExecutorSpec) DeepCopy

func (in *PodHookExecutorSpec) DeepCopy() *PodHookExecutorSpec

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

func (*PodHookExecutorSpec) DeepCopyInto

func (in *PodHookExecutorSpec) DeepCopyInto(out *PodHookExecutorSpec)

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

type RepoStatus

type RepoStatus struct {
	// Name indicate the name of the Repository
	Name string `json:"name,omitempty"`

	// Ready indicates whether the respective Repository is ready or not
	// +optional
	Phase v1alpha1.RepositoryPhase `json:"phase,omitempty"`

	// Reason specifies the error messages found while ensuring the respective Repository
	// +optional
	Reason string `json:"reason,omitempty"`
}

RepoStatus specifies the status of a Repository

func (*RepoStatus) DeepCopy

func (in *RepoStatus) DeepCopy() *RepoStatus

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

func (*RepoStatus) DeepCopyInto

func (in *RepoStatus) DeepCopyInto(out *RepoStatus)

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

type RepositoryInfo

type RepositoryInfo struct {
	// Name specifies the name of the Repository
	Name string `json:"name,omitempty"`

	// Backend specifies the name of the backend where this repository will be initialized.
	// This should point to a backend name specified in `.spec.backends` section.
	// For using a default backend, keep this field empty.
	// +optional
	Backend string `json:"backend,omitempty"`

	// Directory specifies the path inside the backend where the backed up data will be stored.
	Directory string `json:"directory,omitempty"`

	// EncryptionSecret refers to the Secret containing the encryption key which will be used to encode/decode the backed up dta.
	// You can refer to a Secret of a different namespace.
	// If you don't provide the namespace field, KubeStash will look for the Secret in the same namespace as the BackupConfiguration / BackupBatch.
	EncryptionSecret *kmapi.ObjectReference `json:"encryptionSecret,omitempty"`

	// DeletionPolicy specifies what to do when you delete a Repository CR.
	// +optional
	DeletionPolicy v1alpha1.DeletionPolicy `json:"deletionPolicy,omitempty"`
}

RepositoryInfo specifies information about the repository where the backed up data will be stored. KubeStash will create the respective Repository CR from this information.

func (*RepositoryInfo) DeepCopy

func (in *RepositoryInfo) DeepCopy() *RepositoryInfo

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

func (*RepositoryInfo) DeepCopyInto

func (in *RepositoryInfo) DeepCopyInto(out *RepositoryInfo)

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

type ResourceFoundStatus

type ResourceFoundStatus struct {
	kmapi.TypedObjectReference `json:",inline"`
	// Found indicates whether the resource was found or not
	Found *bool `json:"found,omitempty"`
}

ResourceFoundStatus specifies whether a resource was found or not

func (*ResourceFoundStatus) DeepCopy

func (in *ResourceFoundStatus) DeepCopy() *ResourceFoundStatus

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

func (*ResourceFoundStatus) DeepCopyInto

func (in *ResourceFoundStatus) DeepCopyInto(out *ResourceFoundStatus)

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

type RestoreDataSource

type RestoreDataSource struct {
	// Namespace specifies the namespace of the DataSource (i.e. Repository, Snapshot).
	Namespace string `json:"namespace,omitempty"`

	// Repository points to the Repository name from which the data will be restored
	Repository string `json:"repository,omitempty"`

	// Snapshot specifies the Snapshot name that will be restored.
	// If you want to use Point-In-Time recovery option, don't specify this field. Specify `pitr` field instead.
	// +optional
	Snapshot string `json:"snapshot,omitempty"`

	// PITR stands for Point-In-Time Recovery. You can provide a target time instead of specifying a particular Snapshot.
	// KubeStash will automatically find the latest Snapshot that satisfies the targeted time and restore it.
	// +optional
	PITR *PITR `json:"pitr,omitempty"`

	// Components specifies the components that will be restored. If you keep this field empty, then all
	// the components that were backed up in the desired Snapshot will be restored.
	// +optional
	Components []string `json:"components,omitempty"`

	// EncryptionSecret refers to the Secret containing the encryption key which will be used to encode/decode the backed up data.
	// You can refer to a Secret of a different namespace.
	// If you don't provide the namespace field, KubeStash will look for the Secret in the same namespace as the RestoreSession.
	// +optional
	EncryptionSecret *kmapi.ObjectReference `json:"encryptionSecret,omitempty"`
}

RestoreDataSource specifies the information about the data that will be restored

func (*RestoreDataSource) DeepCopy

func (in *RestoreDataSource) DeepCopy() *RestoreDataSource

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

func (*RestoreDataSource) DeepCopyInto

func (in *RestoreDataSource) DeepCopyInto(out *RestoreDataSource)

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

type RestoreHooks

type RestoreHooks struct {
	// PreRestore specifies a list of hooks that will be executed before restore
	// +optional
	PreRestore []HookInfo `json:"preRestore,omitempty"`

	// PostRestore specifies a list of hooks that will be executed after restore
	// +optional
	PostRestore []HookInfo `json:"postRestore,omitempty"`
}

RestoreHooks specifies the hooks that will be executed before and/or after restore

func (*RestoreHooks) DeepCopy

func (in *RestoreHooks) DeepCopy() *RestoreHooks

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

func (*RestoreHooks) DeepCopyInto

func (in *RestoreHooks) DeepCopyInto(out *RestoreHooks)

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

type RestorePhase

type RestorePhase string

RestorePhase represents the current state of the restore process +kubebuilder:validation:Enum=Pending;Running;Failed;Succeeded;Invalid;Unknown

const (
	RestorePending      RestorePhase = "Pending"
	RestoreRunning      RestorePhase = "Running"
	RestoreFailed       RestorePhase = "Failed"
	RestoreSucceeded    RestorePhase = "Succeeded"
	RestoreInvalid      RestorePhase = "Invalid"
	RestorePhaseUnknown RestorePhase = "Unknown"
)

type RestoreSession

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

	Spec   RestoreSessionSpec   `json:"spec,omitempty"`
	Status RestoreSessionStatus `json:"status,omitempty"`
}

RestoreSession represents one restore run for the targeted application

func (*RestoreSession) AllComponentsCompleted

func (rs *RestoreSession) AllComponentsCompleted() bool

func (*RestoreSession) CalculatePhase

func (rs *RestoreSession) CalculatePhase() RestorePhase

func (RestoreSession) CustomResourceDefinition

func (_ RestoreSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*RestoreSession) DeepCopy

func (in *RestoreSession) DeepCopy() *RestoreSession

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

func (*RestoreSession) DeepCopyInto

func (in *RestoreSession) DeepCopyInto(out *RestoreSession)

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

func (*RestoreSession) DeepCopyObject

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

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

func (*RestoreSession) FinalStepExecuted added in v0.2.0

func (rs *RestoreSession) FinalStepExecuted() bool

func (*RestoreSession) GetDataSourceNamespace added in v0.7.0

func (rs *RestoreSession) GetDataSourceNamespace() string

func (*RestoreSession) GetSummary added in v0.2.0

func (rs *RestoreSession) GetSummary(targetRef *kmapi.TypedObjectReference) *Summary

func (*RestoreSession) OffshootLabels added in v0.2.0

func (rs *RestoreSession) OffshootLabels() map[string]string

func (*RestoreSession) SetupWebhookWithManager

func (r *RestoreSession) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*RestoreSession) ValidateCreate

func (r *RestoreSession) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*RestoreSession) ValidateDataSource added in v0.2.0

func (r *RestoreSession) ValidateDataSource() error

func (*RestoreSession) ValidateDelete

func (r *RestoreSession) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*RestoreSession) ValidateUpdate

func (r *RestoreSession) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type RestoreSessionList

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

RestoreSessionList contains a list of RestoreSession

func (*RestoreSessionList) DeepCopy

func (in *RestoreSessionList) DeepCopy() *RestoreSessionList

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

func (*RestoreSessionList) DeepCopyInto

func (in *RestoreSessionList) DeepCopyInto(out *RestoreSessionList)

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

func (*RestoreSessionList) DeepCopyObject

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

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

type RestoreSessionSpec

type RestoreSessionSpec struct {
	// Target indicates the target application where the data will be restored.
	// The target must be in the same namespace as the RestoreSession CR.
	// +optional
	Target *kmapi.TypedObjectReference `json:"target,omitempty"`

	// DataSource specifies the information about the data that will be restored
	DataSource *RestoreDataSource `json:"dataSource,omitempty"`

	// Addon specifies addon configuration that will be used to restore the target.
	Addon *AddonInfo `json:"addon,omitempty"`

	// Hooks specifies the restore hooks that should be executed before and/or after the restore.
	// +optional
	Hooks *RestoreHooks `json:"hooks,omitempty"`

	// Timeout specifies a duration that KubeStash should wait for the session execution to be completed.
	// If the session execution does not finish within this time period, KubeStash will consider this session as a failure.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// ManifestOptions provide options to select particular manifest object to restore
	// +optional
	ManifestOptions *ManifestRestoreOptions `json:"manifestOptions,omitempty"`
}

RestoreSessionSpec specifies the necessary configurations for restoring data into a target

func (*RestoreSessionSpec) DeepCopy

func (in *RestoreSessionSpec) DeepCopy() *RestoreSessionSpec

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

func (*RestoreSessionSpec) DeepCopyInto

func (in *RestoreSessionSpec) DeepCopyInto(out *RestoreSessionSpec)

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

type RestoreSessionStatus

type RestoreSessionStatus struct {
	// Phase represents the current state of the restore process
	// +optional
	Phase RestorePhase `json:"phase,omitempty"`

	// TargetFound specifies whether the restore target exist or not
	// +optional
	TargetFound *bool `json:"targetFound,omitempty"`

	// Duration specifies the total time taken to complete the restore process
	// +optional
	Duration string `json:"duration,omitempty"`

	// Deadline specifies a timestamp till this session is valid. If the session does not complete within this deadline,
	// it will be considered as failed.
	// +optional
	Deadline *metav1.Time `json:"deadline,omitempty"`

	// TotalComponents represents the number of total components for this RestoreSession
	// +optional
	TotalComponents int32 `json:"totalComponents,omitempty"`

	// Components represents the individual component restore status
	// +optional
	// +mapType=granular
	Components map[string]ComponentRestoreStatus `json:"components,omitempty"`

	// Hooks represents the hook execution status
	// +optional
	Hooks HookStatus `json:"hooks,omitempty"`

	// Dependencies specifies whether the objects required by this RestoreSession exist or not
	// +optional
	Dependencies []ResourceFoundStatus `json:"dependencies,omitempty"`

	// PausedBackups represents the list of backups that have been paused before restore.
	// +optional
	PausedBackups []kmapi.TypedObjectReference `json:"pausedBackups,omitempty"`

	// Conditions specifies a list of conditions related to this restore session
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

RestoreSessionStatus defines the observed state of RestoreSession

func (*RestoreSessionStatus) DeepCopy

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

func (*RestoreSessionStatus) DeepCopyInto

func (in *RestoreSessionStatus) DeepCopyInto(out *RestoreSessionStatus)

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

type RetentionPolicyApplyPhase

type RetentionPolicyApplyPhase string

RetentionPolicyApplyPhase represents the state of the retention policy apply process +kubebuilder:validation:Enum=Pending;Applied;FailedToApply

const (
	RetentionPolicyPending       RetentionPolicyApplyPhase = "Pending"
	RetentionPolicyApplied       RetentionPolicyApplyPhase = "Applied"
	RetentionPolicyFailedToApply RetentionPolicyApplyPhase = "FailedToApply"
)

type RetentionPolicyApplyStatus

type RetentionPolicyApplyStatus struct {
	// Ref points to the RetentionPolicy CR that is being used to cleanup the old Snapshots for this session.
	Ref kmapi.ObjectReference `json:"ref,omitempty"`

	// Repository specifies the name of the Repository on which the RetentionPolicy has been applied.
	Repository string `json:"repository,omitempty"`
	// Phase specifies the state of retention policy apply process
	// +optional
	Phase RetentionPolicyApplyPhase `json:"phase,omitempty"`

	// Error represents the reason if the retention policy applying fail
	// +optional
	Error string `json:"error,omitempty"`
}

RetentionPolicyApplyStatus represents the state of the applying retention policy

func (*RetentionPolicyApplyStatus) DeepCopy

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

func (*RetentionPolicyApplyStatus) DeepCopyInto

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

type RetentionPolicyStatus

type RetentionPolicyStatus struct {
	// Ref indicates the RetentionPolicy object reference.
	Ref kmapi.ObjectReference `json:"ref,omitempty"`

	// Found indicates whether the RetentionPolicy is Found or not
	// +optional
	Found *bool `json:"found,omitempty"`

	// Reason specifies the error messages found while checking the RetentionPolicy
	// +optional
	Reason string `json:"reason,omitempty"`
}

func (*RetentionPolicyStatus) DeepCopy

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

func (*RetentionPolicyStatus) DeepCopyInto

func (in *RetentionPolicyStatus) DeepCopyInto(out *RetentionPolicyStatus)

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

type RetryConfig

type RetryConfig struct {
	// MaxRetry specifies the maximum number of times KubeStash should retry the backup/restore process.
	// By default, KubeStash will retry only 1 time.
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=1
	MaxRetry int32 `json:"maxRetry,omitempty"`

	// The amount of time to wait before next retry. If you don't specify this field, KubeStash will retry immediately.
	// Format: 30s, 2m, 1h etc.
	// +optional
	Delay metav1.Duration `json:"delay,omitempty"`
}

RetryConfig specifies the behavior of retry

func (*RetryConfig) DeepCopy

func (in *RetryConfig) DeepCopy() *RetryConfig

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

func (*RetryConfig) DeepCopyInto

func (in *RetryConfig) DeepCopyInto(out *RetryConfig)

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

type SchedulerSpec

type SchedulerSpec struct {
	// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
	Schedule string `json:"schedule"`

	// Optional deadline in seconds for starting the job if it misses scheduled
	// time for any reason.  Missed jobs executions will be counted as failed ones.
	// +optional
	StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`

	// Specifies how to treat concurrent executions of a Job.
	// Valid values are:
	// - "Allow" (default): allows CronJobs to run concurrently;
	// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
	// - "Replace": cancels currently running job and replaces it with a new one
	// +optional
	ConcurrencyPolicy batchv1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`

	// This flag tells the controller to suspend subsequent executions, it does
	// not apply to already started executions.  Defaults to false.
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// Specifies the job that will be created when executing a CronJob.
	JobTemplate JobTemplate `json:"jobTemplate"`

	// The number of successful finished jobs to retain. Value must be non-negative integer.
	// Defaults to 3.
	// +optional
	SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"`

	// The number of failed finished jobs to retain. Value must be non-negative integer.
	// Defaults to 1.
	// +optional
	FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`
}

SchedulerSpec specifies the configuration for the backup triggering CronJob for a session.

func (*SchedulerSpec) DeepCopy

func (in *SchedulerSpec) DeepCopy() *SchedulerSpec

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

func (*SchedulerSpec) DeepCopyInto

func (in *SchedulerSpec) DeepCopyInto(out *SchedulerSpec)

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

type Session

type Session struct {
	*SessionConfig `json:",inline"`

	// Addon specifies addon configuration that will be used to backup the target.
	Addon *AddonInfo `json:"addon,omitempty"`

	// Repositories specifies a list of repository information where the backed up data will be stored.
	// KubeStash will create the respective Repository CRs using this information.
	Repositories []RepositoryInfo `json:"repositories,omitempty"`
}

Session specifies a backup session configuration for the target

func (*Session) DeepCopy

func (in *Session) DeepCopy() *Session

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

func (*Session) DeepCopyInto

func (in *Session) DeepCopyInto(out *Session)

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

type SessionConfig

type SessionConfig struct {
	// Name specifies the name of the session
	Name string `json:"name,omitempty"`

	// Scheduler specifies the configuration for backup triggering CronJob
	Scheduler *SchedulerSpec `json:"scheduler,omitempty"`

	// Hooks specifies the backup hooks that should be executed before and/or after the backup.
	// +optional
	Hooks *BackupHooks `json:"hooks,omitempty"`

	// RetryConfig specifies the behavior of retry in case of a backup failure.
	// +optional
	RetryConfig *RetryConfig `json:"retryConfig,omitempty"`

	// Timeout specifies the maximum duration of backup. BackupSession will be considered Failed
	// if backup does not complete within this time limit. By default, KubeStash don't set any timeout for backup.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// SessionHistoryLimit specifies how many backup Jobs and associate resources KubeStash should keep for debugging purpose.
	// The default value is 1.
	// +kubebuilder:default=1
	// +optional
	SessionHistoryLimit int32 `json:"sessionHistoryLimit,omitempty"`
}

SessionConfig specifies common session configurations

func (*SessionConfig) DeepCopy

func (in *SessionConfig) DeepCopy() *SessionConfig

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

func (*SessionConfig) DeepCopyInto

func (in *SessionConfig) DeepCopyInto(out *SessionConfig)

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

type SessionStatus

type SessionStatus struct {
	// Name indicates the name of the session
	Name string `json:"name,omitempty"`

	// NextSchedule specifies when the next backup will execute for this session
	// +optional
	NextSchedule string `json:"nextSchedule,omitempty"`

	// Conditions specifies a list of conditions related to this session
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

SessionStatus specifies the status of a session specific fields.

func (*SessionStatus) DeepCopy

func (in *SessionStatus) DeepCopy() *SessionStatus

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

func (*SessionStatus) DeepCopyInto

func (in *SessionStatus) DeepCopyInto(out *SessionStatus)

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

type SnapshotStatus

type SnapshotStatus struct {
	// Name indicates to the name of the Snapshot
	Name string `json:"name,omitempty"`

	// Phase indicate the phase of the Snapshot
	// +optional
	Phase storage.SnapshotPhase `json:"phase,omitempty"`

	// AppRef points to the application that is being backed up in this Snapshot
	AppRef *kmapi.TypedObjectReference `json:"appRef,omitempty"`

	// Repository indicates the name of the Repository where the Snapshot is being stored.
	Repository string `json:"repository,omitempty"`
}

SnapshotStatus represents the current state of respective the Snapshot

func (*SnapshotStatus) DeepCopy

func (in *SnapshotStatus) DeepCopy() *SnapshotStatus

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

func (*SnapshotStatus) DeepCopyInto

func (in *SnapshotStatus) DeepCopyInto(out *SnapshotStatus)

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

type StorageStatus

type StorageStatus struct {
	// Ref indicates to the BackupStorage object.
	Ref kmapi.ObjectReference `json:"ref,omitempty"`

	// Phase indicates the current phase of the respective BackupStorage.
	// +optional
	Phase v1alpha1.BackupStoragePhase `json:"phase,omitempty"`

	// Reason specifies the error messages found while checking the BackupStorage phase
	// +optional
	Reason string `json:"reason,omitempty"`
}

func (*StorageStatus) DeepCopy

func (in *StorageStatus) DeepCopy() *StorageStatus

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

func (*StorageStatus) DeepCopyInto

func (in *StorageStatus) DeepCopyInto(out *StorageStatus)

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

type Summary added in v0.2.0

type Summary struct {
	// Name of the respective BackupSession/RestoreSession
	Name string `json:"name,omitempty"`
	// Namespace of the respective invoker
	Namespace string `json:"namespace,omitempty"`

	// Invoker specifies the information about the invoker which resulted this session
	Invoker *kmapi.TypedObjectReference `json:"invoker,omitempty"`
	// Target specifies the target information that has been backed up /restored in this session
	Target *kmapi.TypedObjectReference `json:"target,omitempty"`
	// Status specifies the backup/restore status for the respective target
	Status TargetStatus `json:"status,omitempty"`
}

func (*Summary) DeepCopy added in v0.2.0

func (in *Summary) DeepCopy() *Summary

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

func (*Summary) DeepCopyInto added in v0.2.0

func (in *Summary) DeepCopyInto(out *Summary)

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

type TargetBackupSpec

type TargetBackupSpec struct {
	// Name points to the identifier of the target that is being backed up.
	// It should match the name used as the identifier of a target in the `spec.targets` section.
	Name string `json:"name,omitempty"`

	// Addon specifies addon configuration that will be used to backup this target.
	Addon *AddonInfo `json:"addon,omitempty"`

	// Repositories specifies a list of repository information where the backed up data will be stored.
	// KubeStash will create the respective Repository CRs using this information.
	Repositories []RepositoryInfo `json:"repositories,omitempty"`
}

TargetBackupSpec specifies the information needed to backup a target.

func (*TargetBackupSpec) DeepCopy

func (in *TargetBackupSpec) DeepCopy() *TargetBackupSpec

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

func (*TargetBackupSpec) DeepCopyInto

func (in *TargetBackupSpec) DeepCopyInto(out *TargetBackupSpec)

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

type TargetReference

type TargetReference struct {
	// Name specifies an identifier for this target. This name will be used in the session to refer this target.
	Name string `json:"name,omitempty"`

	// AppRef points to the target that is subject to backup. The target should be in same namespace as the BackupBatch.
	AppRef *kmapi.TypedObjectReference `json:"appRef,omitempty"`
}

TargetReference specifies a reference to the target that is subject to backup

func (*TargetReference) DeepCopy

func (in *TargetReference) DeepCopy() *TargetReference

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

func (*TargetReference) DeepCopyInto

func (in *TargetReference) DeepCopyInto(out *TargetReference)

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

type TargetStatus added in v0.2.0

type TargetStatus struct {
	// Phase represents the backup/restore phase of the target
	Phase string `json:"phase,omitempty"`
	// Duration represents the amount of time it took to complete the backup/restore for this target.
	Duration string `json:"duration,omitempty"`
	// Error specifies the respective error message in case of backup/restore failure
	Error string `json:"error,omitempty"`
}

func (*TargetStatus) DeepCopy added in v0.2.0

func (in *TargetStatus) DeepCopy() *TargetStatus

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

func (*TargetStatus) DeepCopyInto added in v0.2.0

func (in *TargetStatus) DeepCopyInto(out *TargetStatus)

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

type TargetVolumeInfo

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

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

	// VolumeClaimTemplates specifies a template for the PersistentVolumeClaims that will be created for each Pod in a StatefulSet.
	VolumeClaimTemplates []ofst.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
}

TargetVolumeInfo specifies the volumes and their mounts of the targeted application that should be mounted in backup/restore Job/container.

func (*TargetVolumeInfo) DeepCopy

func (in *TargetVolumeInfo) DeepCopy() *TargetVolumeInfo

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

func (*TargetVolumeInfo) DeepCopyInto

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

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

type TaskReference

type TaskReference struct {
	// Name indicates to the name of the task
	Name string `json:"name,omitempty"`

	// Variables specifies a list of variables and their sources that will be used to resolve the task.
	// +optional
	Variables []core.EnvVar `json:"variables,omitempty"`

	// Params specifies parameters for the task. You must provide the parameter in the Addon desired structure.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Params *runtime.RawExtension `json:"params,omitempty"`

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

	// AddonVolumes lets you overwrite the volume sources used in the VolumeTemplate section of Addon.
	// Make sure that name of your volume matches with the name of the volume you want to overwrite.
	// +optional
	AddonVolumes []AddonVolumeInfo `json:"addonVolumes,omitempty"`
}

TaskReference specifies a task and its configuration parameters

func (*TaskReference) DeepCopy

func (in *TaskReference) DeepCopy() *TaskReference

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

func (*TaskReference) DeepCopyInto

func (in *TaskReference) DeepCopyInto(out *TaskReference)

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

type VerificationStatus

type VerificationStatus struct {
	// Name indicates the name of the respective verification strategy
	Name string `json:"name,omitempty"`

	// Phase represents the state of the verification process
	// +optional
	Phase BackupVerificationPhase `json:"phase,omitempty"`
}

VerificationStatus specifies the status of a backup verification

func (*VerificationStatus) DeepCopy

func (in *VerificationStatus) DeepCopy() *VerificationStatus

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

func (*VerificationStatus) DeepCopyInto

func (in *VerificationStatus) DeepCopyInto(out *VerificationStatus)

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

type VerificationStrategy

type VerificationStrategy struct {
	// Name indicate the name of this strategy
	Name string `json:"name,omitempty"`

	// Repository specifies the name of the repository which data will be verified
	Repository string `json:"repository,omitempty"`

	// Verifier refers to the BackupVerification CR that defines how to verify this particular data
	Verifier *kmapi.TypedObjectReference `json:"verifier,omitempty"`

	// Params specifies the parameters that will be used by the verifier
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Params *runtime.RawExtension `json:"params,omitempty"`

	// VerifyEvery specifies the frequency of backup verification
	// +kubebuilder:validation:Minimum=1
	VerifyEvery int32 `json:"verifyEvery,omitempty"`

	// OnFailure specifies what to do if the verification fail.
	// +optional
	OnFailure FailurePolicy `json:"onFailure,omitempty"`

	// RetryConfig specifies the behavior of the retry mechanism in case of a verification failure
	// +optional
	RetryConfig *RetryConfig `json:"retryConfig,omitempty"`
}

VerificationStrategy specifies a strategy to verify the backed up data.

func (*VerificationStrategy) DeepCopy

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

func (*VerificationStrategy) DeepCopyInto

func (in *VerificationStrategy) DeepCopyInto(out *VerificationStrategy)

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