Documentation ¶
Index ¶
- Constants
- type Backup
- type BackupHooks
- type BackupList
- type BackupPhase
- type BackupProgress
- type BackupResourceHook
- type BackupResourceHookSpec
- type BackupSpec
- type BackupStatus
- type ConditionStatus
- type Duration
- type ExecHook
- type ExecRestoreHook
- type HookErrorMode
- type HookStatus
- type LabelSelector
- type LabelSelectorRequirement
- type ListMeta
- type Metadata
- type NodeCondition
- type NodeConditionType
- type ObjectMeta
- type ObjectReference
- type OwnerReference
- type PolicyType
- type Restore
- type RestoreHooks
- type RestoreList
- type RestorePhase
- type RestoreProgress
- type RestoreResourceHookSpec
- type RestoreSpec
- type RestoreStatus
- type RestoreStatusSpec
- type Schedule
- type ScheduleList
- type SchedulePhase
- type ScheduleSpec
- type ScheduleStatus
- type Time
- type TypeMeta
- type TypedLocalObjectReference
- type UploaderConfigForBackup
- type UploaderConfigForRestore
Constants ¶
const ( // RestorePhaseNew means the restore has been created but not // yet processed by the RestoreController RestorePhaseNew RestorePhase = "New" // RestorePhaseFailedValidation means the restore has failed // the controller's validations and therefore will not run. RestorePhaseFailedValidation RestorePhase = "FailedValidation" // RestorePhaseInProgress means the restore is currently executing. RestorePhaseInProgress RestorePhase = "InProgress" // RestorePhaseWaitingForPluginOperations means the restore of // Kubernetes resources and other async plugin operations was // successful and plugin operations are still ongoing. The // restore is not complete yet. RestorePhaseWaitingForPluginOperations RestorePhase = "WaitingForPluginOperations" // RestorePhaseWaitingForPluginOperationsPartiallyFailed means // the restore of Kubernetes resources and other async plugin // operations partially failed (final phase will be // PartiallyFailed) and other plugin operations are still // ongoing. The restore is not complete yet. RestorePhaseWaitingForPluginOperationsPartiallyFailed RestorePhase = "WaitingForPluginOperationsPartiallyFailed" // RestorePhaseCompleted means the restore has run successfully // without errors. RestorePhaseCompleted RestorePhase = "Completed" // RestorePhasePartiallyFailed means the restore has run to completion // but encountered 1+ errors restoring individual items. RestorePhasePartiallyFailed RestorePhase = "PartiallyFailed" // RestorePhaseFailed means the restore was unable to execute. // The failing error is recorded in status.FailureReason. RestorePhaseFailed RestorePhase = "Failed" // PolicyTypeNone means velero will not overwrite the resource // in cluster with the one in backup whether changed/unchanged. PolicyTypeNone PolicyType = "none" // PolicyTypeUpdate means velero will try to attempt a patch on // the changed resources. PolicyTypeUpdate PolicyType = "update" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct { TypeMeta `json:",inline"` // +optional ObjectMeta `json:"metadata,omitempty"` // +optional Spec BackupSpec `json:"spec,omitempty"` // +optional Status BackupStatus `json:"status,omitempty"` }
Backup is a Velero resource that represents the capture of Kubernetes cluster state at a point in time (API objects and associated volume state).
type BackupHooks ¶
type BackupHooks struct { // Resources are hooks that should be executed when backing up individual instances of a resource. // +optional // +nullable Resources []BackupResourceHookSpec `json:"resources,omitempty"` }
BackupHooks contains custom behaviors that should be executed at different phases of the backup.
type BackupList ¶
type BackupList struct { TypeMeta `json:",inline"` // +optional ListMeta `json:"metadata,omitempty"` Items []Backup `json:"items"` }
BackupList is a list of Backups.
type BackupPhase ¶
type BackupPhase string
BackupPhase is a string representation of the lifecycle phase
const ( // BackupPhaseNew means the backup has been created but not // yet processed by the BackupController. BackupPhaseNew BackupPhase = "New" // BackupPhaseFailedValidation means the backup has failed // the controller's validations and therefore will not run. BackupPhaseFailedValidation BackupPhase = "FailedValidation" // BackupPhaseInProgress means the backup is currently executing. BackupPhaseInProgress BackupPhase = "InProgress" // BackupPhaseWaitingForPluginOperations means the backup of // Kubernetes resources, creation of snapshots, and other // async plugin operations was successful and snapshot data is // currently uploading or other plugin operations are still // ongoing. The backup is not usable yet. BackupPhaseWaitingForPluginOperations BackupPhase = "WaitingForPluginOperations" // BackupPhaseWaitingForPluginOperationsPartiallyFailed means // the backup of Kubernetes resources, creation of snapshots, // and other async plugin operations partially failed (final // phase will be PartiallyFailed) and snapshot data is // currently uploading or other plugin operations are still // ongoing. The backup is not usable yet. BackupPhaseWaitingForPluginOperationsPartiallyFailed BackupPhase = "WaitingForPluginOperationsPartiallyFailed" // BackupPhaseFinalizing means the backup of // Kubernetes resources, creation of snapshots, and other // async plugin operations were successful and snapshot upload and // other plugin operations are now complete, but the Backup is awaiting // final update of resources modified during async operations. // The backup is not usable yet. BackupPhaseFinalizing BackupPhase = "Finalizing" // BackupPhaseFinalizingPartiallyFailed means the backup of // Kubernetes resources, creation of snapshots, and other // async plugin operations were successful and snapshot upload and // other plugin operations are now complete, but one or more errors // occurred during backup or async operation processing, and the // Backup is awaiting final update of resources modified during async // operations. The backup is not usable yet. BackupPhaseFinalizingPartiallyFailed BackupPhase = "FinalizingPartiallyFailed" // BackupPhaseCompleted means the backup has run successfully without // errors. BackupPhaseCompleted BackupPhase = "Completed" // BackupPhasePartiallyFailed means the backup has run to completion // but encountered 1+ errors backing up individual items. BackupPhasePartiallyFailed BackupPhase = "PartiallyFailed" // BackupPhaseFailed means the backup ran but encountered an error that // prevented it from completing successfully. BackupPhaseFailed BackupPhase = "Failed" // BackupPhaseDeleting means the backup and all its associated data are being deleted. BackupPhaseDeleting BackupPhase = "Deleting" )
type BackupProgress ¶
type BackupProgress struct { // TotalItems is the total number of items to be backed up. This number may change // throughout the execution of the backup due to plugins that return additional related // items to back up, the backup.cce.cloud.baidu.com/exclude-from-backup label, and various other // filters that happen as items are processed. // +optional TotalItems int `json:"totalItems,omitempty"` // ItemsBackedUp is the number of items that have actually been written to the // backup tarball so far. // +optional ItemsBackedUp int `json:"itemsBackedUp,omitempty"` }
BackupProgress stores information about the progress of a Backup's execution.
type BackupResourceHook ¶
type BackupResourceHook struct { // Exec defines an exec hook. Exec *ExecHook `json:"exec"` }
BackupResourceHook defines a hook for a resource.
type BackupResourceHookSpec ¶
type BackupResourceHookSpec struct { // Name is the name of this hook. Name string `json:"name"` // IncludedNamespaces specifies the namespaces to which this hook spec applies. If empty, it applies // to all namespaces. // +optional // +nullable IncludedNamespaces []string `json:"includedNamespaces,omitempty"` // ExcludedNamespaces specifies the namespaces to which this hook spec does not apply. // +optional // +nullable ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"` // IncludedResources specifies the resources to which this hook spec applies. If empty, it applies // to all resources. // +optional // +nullable IncludedResources []string `json:"includedResources,omitempty"` // ExcludedResources specifies the resources to which this hook spec does not apply. // +optional // +nullable ExcludedResources []string `json:"excludedResources,omitempty"` // LabelSelector, if specified, filters the resources to which this hook spec applies. // +optional // +nullable LabelSelector *LabelSelector `json:"labelSelector,omitempty"` // PreHooks is a list of BackupResourceHooks to execute prior to storing the item in the backup. // These are executed before any "additional items" from item actions are processed. // +optional PreHooks []BackupResourceHook `json:"pre,omitempty"` // PostHooks is a list of BackupResourceHooks to execute after storing the item in the backup. // These are executed after all "additional items" from item actions are processed. // +optional PostHooks []BackupResourceHook `json:"post,omitempty"` }
BackupResourceHookSpec defines one or more BackupResourceHooks that should be executed based on the rules defined for namespaces, resources, and label selector.
type BackupSpec ¶
type BackupSpec struct { // +optional Metadata `json:"metadata,omitempty"` // IncludedNamespaces is a slice of namespace names to include objects // from. If empty, all namespaces are included. // +optional // +nullable IncludedNamespaces []string `json:"includedNamespaces,omitempty"` // ExcludedNamespaces contains a list of namespaces that are not // included in the backup. // +optional // +nullable ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"` // IncludedResources is a slice of resource names to include // in the backup. If empty, all resources are included. // +optional // +nullable IncludedResources []string `json:"includedResources,omitempty"` // ExcludedResources is a slice of resource names that are not // included in the backup. // +optional // +nullable ExcludedResources []string `json:"excludedResources,omitempty"` // IncludedClusterScopedResources is a slice of cluster-scoped // resource type names to include in the backup. // If set to "*", all cluster-scoped resource types are included. // The default value is empty, which means only related // cluster-scoped resources are included. // +optional // +nullable IncludedClusterScopedResources []string `json:"includedClusterScopedResources,omitempty"` // ExcludedClusterScopedResources is a slice of cluster-scoped // resource type names to exclude from the backup. // If set to "*", all cluster-scoped resource types are excluded. // The default value is empty. // +optional // +nullable ExcludedClusterScopedResources []string `json:"excludedClusterScopedResources,omitempty"` // IncludedNamespaceScopedResources is a slice of namespace-scoped // resource type names to include in the backup. // The default value is "*". // +optional // +nullable IncludedNamespaceScopedResources []string `json:"includedNamespaceScopedResources,omitempty"` // ExcludedNamespaceScopedResources is a slice of namespace-scoped // resource type names to exclude from the backup. // If set to "*", all namespace-scoped resource types are excluded. // The default value is empty. // +optional // +nullable ExcludedNamespaceScopedResources []string `json:"excludedNamespaceScopedResources,omitempty"` // LabelSelector is a LabelSelector to filter with // when adding individual objects to the backup. If empty // or nil, all objects are included. Optional. // +optional // +nullable LabelSelector *LabelSelector `json:"labelSelector,omitempty"` // OrLabelSelectors is list of LabelSelector to filter with // when adding individual objects to the backup. If multiple provided // they will be joined by the OR operator. LabelSelector as well as // OrLabelSelectors cannot co-exist in backup request, only one of them // can be used. // +optional // +nullable OrLabelSelectors []*LabelSelector `json:"orLabelSelectors,omitempty"` // SnapshotVolumes specifies whether to take snapshots // of any PV's referenced in the set of objects included // in the Backup. // +optional // +nullable SnapshotVolumes *bool `json:"snapshotVolumes,omitempty"` // TTL is a time.Duration-parseable string describing how long // the Backup should be retained for. // +optional TTL string `json:"ttl,omitempty"` // IncludeClusterResources specifies whether cluster-scoped resources // should be included for consideration in the backup. // +optional // +nullable IncludeClusterResources *bool `json:"includeClusterResources,omitempty"` // Hooks represent custom behaviors that should be executed at different phases of the backup. // +optional Hooks BackupHooks `json:"hooks,omitempty"` // StorageLocation is a string containing the name of a BackupStorageLocation where the backup should be stored. // +optional StorageLocation string `json:"storageLocation,omitempty"` // VolumeSnapshotLocations is a list containing names of VolumeSnapshotLocations associated with this backup. // +optional VolumeSnapshotLocations []string `json:"volumeSnapshotLocations,omitempty"` // DefaultVolumesToRestic specifies whether restic should be used to take a // backup of all pod volumes by default. // // Deprecated: this field is no longer used and will be removed entirely in future. Use DefaultVolumesToFsBackup instead. // +optional // +nullable DefaultVolumesToRestic *bool `json:"defaultVolumesToRestic,omitempty"` // DefaultVolumesToFsBackup specifies whether pod volume file system backup should be used // for all volumes by default. // +optional // +nullable DefaultVolumesToFsBackup *bool `json:"defaultVolumesToFsBackup,omitempty"` // OrderedResources specifies the backup order of resources of specific Kind. // The map key is the resource name and value is a list of object names separated by commas. // Each resource name has format "namespace/objectname". For cluster resources, simply use "objectname". // +optional // +nullable OrderedResources map[string]string `json:"orderedResources,omitempty"` // CSISnapshotTimeout specifies the time used to wait for CSI VolumeSnapshot status turns to // ReadyToUse during creation, before returning error as timeout. // The default value is 10 minute. // +optional CSISnapshotTimeout string `json:"csiSnapshotTimeout,omitempty"` // ItemOperationTimeout specifies the time used to wait for asynchronous BackupItemAction operations // The default value is 1 hour. // +optional ItemOperationTimeout string `json:"itemOperationTimeout,omitempty"` // ResourcePolicy specifies the referenced resource policies that backup should follow // +optional ResourcePolicy *TypedLocalObjectReference `json:"resourcePolicy,omitempty"` // SnapshotMoveData specifies whether snapshot data should be moved // +optional // +nullable SnapshotMoveData *bool `json:"snapshotMoveData,omitempty"` // DataMover specifies the data mover to be used by the backup. // If DataMover is "" or "velero", the built-in data mover will be used. // +optional DataMover string `json:"datamover,omitempty"` // UploaderConfig specifies the configuration for the uploader. // +optional // +nullable UploaderConfig *UploaderConfigForBackup `json:"uploaderConfig,omitempty"` }
BackupSpec defines the specification for a Velero backup.
type BackupStatus ¶
type BackupStatus struct { // Version is the backup format major version. // Deprecated: Please see FormatVersion // +optional Version int `json:"version,omitempty"` // FormatVersion is the backup format version, including major, minor, and patch version. // +optional FormatVersion string `json:"formatVersion,omitempty"` // Expiration is when this Backup is eligible for garbage-collection. // +optional // +nullable Expiration *Time `json:"expiration,omitempty"` // Phase is the current state of the Backup. // +optional Phase BackupPhase `json:"phase,omitempty"` // ValidationErrors is a slice of all validation errors (if // applicable). // +optional // +nullable ValidationErrors []string `json:"validationErrors,omitempty"` // StartTimestamp records the time a backup was started. // Separate from CreationTimestamp, since that value changes // on restores. // The server's time is used for StartTimestamps // +optional // +nullable StartTimestamp *Time `json:"startTimestamp,omitempty"` // CompletionTimestamp records the time a backup was completed. // Completion time is recorded even on failed backups. // Completion time is recorded before uploading the backup object. // The server's time is used for CompletionTimestamps // +optional // +nullable CompletionTimestamp *Time `json:"completionTimestamp,omitempty"` // VolumeSnapshotsAttempted is the total number of attempted // volume snapshots for this backup. // +optional VolumeSnapshotsAttempted int `json:"volumeSnapshotsAttempted,omitempty"` // VolumeSnapshotsCompleted is the total number of successfully // completed volume snapshots for this backup. // +optional VolumeSnapshotsCompleted int `json:"volumeSnapshotsCompleted,omitempty"` // FailureReason is an error that caused the entire backup to fail. // +optional FailureReason string `json:"failureReason,omitempty"` // Warnings is a count of all warning messages that were generated during // execution of the backup. The actual warnings are in the backup's log // file in object storage. // +optional Warnings int `json:"warnings,omitempty"` // Errors is a count of all error messages that were generated during // execution of the backup. The actual errors are in the backup's log // file in object storage. // +optional Errors int `json:"errors,omitempty"` // Progress contains information about the backup's execution progress. Note // that this information is best-effort only -- if Velero fails to update it // during a backup for any reason, it may be inaccurate/stale. // +optional // +nullable Progress *BackupProgress `json:"progress,omitempty"` // CSIVolumeSnapshotsAttempted is the total number of attempted // CSI VolumeSnapshots for this backup. // +optional CSIVolumeSnapshotsAttempted int `json:"csiVolumeSnapshotsAttempted,omitempty"` // CSIVolumeSnapshotsCompleted is the total number of successfully // completed CSI VolumeSnapshots for this backup. // +optional CSIVolumeSnapshotsCompleted int `json:"csiVolumeSnapshotsCompleted,omitempty"` // BackupItemOperationsAttempted is the total number of attempted // async BackupItemAction operations for this backup. // +optional BackupItemOperationsAttempted int `json:"backupItemOperationsAttempted,omitempty"` // BackupItemOperationsCompleted is the total number of successfully completed // async BackupItemAction operations for this backup. // +optional BackupItemOperationsCompleted int `json:"backupItemOperationsCompleted,omitempty"` // BackupItemOperationsFailed is the total number of async // BackupItemAction operations for this backup which ended with an error. // +optional BackupItemOperationsFailed int `json:"backupItemOperationsFailed,omitempty"` // HookStatus contains information about the status of the hooks. // +optional // +nullable HookStatus *HookStatus `json:"hookStatus,omitempty"` }
BackupStatus captures the current status of a Velero backup.
type ConditionStatus ¶
type ConditionStatus string
type ExecHook ¶
type ExecHook struct { // Container is the container in the pod where the command should be executed. If not specified, // the pod's first container is used. // +optional Container string `json:"container,omitempty"` // Command is the command and arguments to execute. // +kubebuilder:validation:MinItems=1 Command []string `json:"command"` // OnError specifies how Velero should behave if it encounters an error executing this hook. // +optional OnError HookErrorMode `json:"onError,omitempty"` // Timeout defines the maximum amount of time Velero should wait for the hook to complete before // considering the execution a failure. // +optional Timeout Duration `json:"timeout,omitempty"` }
ExecHook is a hook that uses the pod exec API to execute a command in a container in a pod.
type ExecRestoreHook ¶
type ExecRestoreHook struct { // Container is the container in the pod where the command should be executed. If not specified, // the pod's first container is used. // +optional Container string `json:"container,omitempty"` // Command is the command and arguments to execute from within a container after a pod has been restored. // +kubebuilder:validation:MinItems=1 Command []string `json:"command"` // OnError specifies how Velero should behave if it encounters an error executing this hook. // +optional OnError HookErrorMode `json:"onError,omitempty"` // ExecTimeout defines the maximum amount of time Velero should wait for the hook to complete before // considering the execution a failure. // +optional ExecTimeout string `json:"execTimeout,omitempty"` // WaitTimeout defines the maximum amount of time Velero should wait for the container to be Ready // before attempting to run the command. // +optional WaitTimeout string `json:"waitTimeout,omitempty"` // WaitForReady ensures command will be launched when container is Ready instead of Running. // +optional // +nullable WaitForReady *bool `json:"waitForReady,omitempty"` }
ExecRestoreHook is a hook that uses pod exec API to execute a command inside a container in a pod
type HookErrorMode ¶
type HookErrorMode string
HookErrorMode defines how Velero should treat an error from a hook. +kubebuilder:validation:Enum=Continue;Fail
const ( // HookErrorModeContinue means that an error from a hook is acceptable and the backup/restore can // proceed with the rest of hooks' execution. This backup/restore should be in `PartiallyFailed` status. HookErrorModeContinue HookErrorMode = "Continue" // HookErrorModeFail means that an error from a hook is problematic and Velero should stop executing following hooks. // This backup/restore should be in `PartiallyFailed` status. HookErrorModeFail HookErrorMode = "Fail" )
type HookStatus ¶
type HookStatus struct { // HooksAttempted is the total number of attempted hooks // Specifically, HooksAttempted represents the number of hooks that failed to execute // and the number of hooks that executed successfully. // +optional HooksAttempted int `json:"hooksAttempted,omitempty"` // HooksFailed is the total number of hooks which ended with an error // +optional HooksFailed int `json:"hooksFailed,omitempty"` }
HookStatus stores information about the status of the hooks.
type LabelSelector ¶
type LabelSelector struct { MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"` MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"` }
type ListMeta ¶
type ListMeta struct { SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"` ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"` Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"` // remainingItemCount is the number of subsequent items in the list which are not included in this RemainingItemCount *int64 `json:"remainingItemCount,omitempty" protobuf:"bytes,4,opt,name=remainingItemCount"` }
ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
type NodeCondition ¶
type NodeCondition struct { // Type of node condition. Type NodeConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeConditionType"` // Status of the condition, one of True, False, Unknown. Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` LastHeartbeatTime Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"` LastTransitionTime Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` }
NodeCondition contains condition information for a node.
type NodeConditionType ¶
type NodeConditionType string
type ObjectMeta ¶
type ObjectMeta struct { // Name must be unique within a namespace. Is required when creating resources, although Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // GenerateName is an optional prefix, used by the server, to generate a unique GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` // Namespace defines the space within which each name must be unique. An empty namespace is Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` // Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. // +optional SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"` // UID is the unique in time and space value for this object. It is typically generated by UID string `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` // CreationTimestamp is a timestamp representing the server time when this object was CreationTimestamp Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"` // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This DeletionTimestamp *Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` // Number of seconds allowed for this object to gracefully terminate before DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` // Map of string keys and values that can be used to organize and categorize Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` // Annotations is an unstructured key value map stored with a resource that may be Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` }
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
type ObjectReference ¶
type ObjectReference struct { // Kind of the referent. Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` // Namespace of the referent. Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` // Name of the referent. Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"` UID string `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"` ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,7,opt,name=fieldPath"` }
type OwnerReference ¶
type OwnerReference struct { APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` Name string `json:"name" protobuf:"bytes,3,opt,name=name"` UID string `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` Controller *bool `json:"controller,omitempty" protobuf:"varint,6,opt,name=controller"` BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"` }
type Restore ¶
type Restore struct { TypeMeta `json:",inline"` // +optional ObjectMeta `json:"metadata,omitempty"` // +optional Spec RestoreSpec `json:"spec,omitempty"` // +optional Status RestoreStatus `json:"status,omitempty"` }
Restore is a Velero resource that represents the application of resources from a Velero backup to a target Kubernetes cluster.
type RestoreHooks ¶
type RestoreHooks struct {
Resources []RestoreResourceHookSpec `json:"resources,omitempty"`
}
RestoreHooks contains custom behaviors that should be executed during or post restore.
type RestoreList ¶
type RestoreList struct { TypeMeta `json:",inline"` // +optional ListMeta `json:"metadata"` Items []Restore `json:"items"` }
RestoreList is a list of Restores.
type RestorePhase ¶
type RestorePhase string
RestorePhase is a string representation of the lifecycle phase
type RestoreProgress ¶
type RestoreProgress struct { // TotalItems is the total number of items to be restored. This number may change // throughout the execution of the restore due to plugins that return additional related // items to restore // +optional TotalItems int `json:"totalItems,omitempty"` // ItemsRestored is the number of items that have actually been restored so far // +optional ItemsRestored int `json:"itemsRestored,omitempty"` }
RestoreProgress stores information about the restore's execution progress
type RestoreResourceHookSpec ¶
type RestoreResourceHookSpec struct { // Name is the name of this hook. Name string `json:"name"` // IncludedNamespaces specifies the namespaces to which this hook spec applies. If empty, it applies // to all namespaces. // +optional // +nullable IncludedNamespaces []string `json:"includedNamespaces,omitempty"` // ExcludedNamespaces specifies the namespaces to which this hook spec does not apply. // +optional // +nullable ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"` // IncludedResources specifies the resources to which this hook spec applies. If empty, it applies // to all resources. // +optional // +nullable IncludedResources []string `json:"includedResources,omitempty"` // ExcludedResources specifies the resources to which this hook spec does not apply. // +optional // +nullable ExcludedResources []string `json:"excludedResources,omitempty"` // LabelSelector, if specified, filters the resources to which this hook spec applies. // +optional // +nullable LabelSelector *LabelSelector `json:"labelSelector,omitempty"` }
RestoreResourceHookSpec defines one or more RestoreResrouceHooks that should be executed based on the rules defined for namespaces, resources, and label selector.
type RestoreSpec ¶
type RestoreSpec struct { // BackupName is the unique name of the Velero backup to restore // from. BackupName string `json:"backupName"` // ScheduleName is the unique name of the Velero schedule to restore // from. If specified, and BackupName is empty, Velero will restore // from the most recent successful backup created from this schedule. // +optional ScheduleName string `json:"scheduleName,omitempty"` // IncludedNamespaces is a slice of namespace names to include objects // from. If empty, all namespaces are included. // +optional // +nullable IncludedNamespaces []string `json:"includedNamespaces,omitempty"` // ExcludedNamespaces contains a list of namespaces that are not // included in the restore. // +optional // +nullable ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"` // IncludedResources is a slice of resource names to include // in the restore. If empty, all resources in the backup are included. // +optional // +nullable IncludedResources []string `json:"includedResources,omitempty"` // ExcludedResources is a slice of resource names that are not // included in the restore. // +optional // +nullable ExcludedResources []string `json:"excludedResources,omitempty"` // NamespaceMapping is a map of source namespace names // to target namespace names to restore into. Any source // namespaces not included in the map will be restored into // namespaces of the same name. // +optional NamespaceMapping map[string]string `json:"namespaceMapping,omitempty"` // LabelSelector is a LabelSelector to filter with // when restoring individual objects from the backup. If empty // or nil, all objects are included. Optional. // +optional // +nullable LabelSelector *LabelSelector `json:"labelSelector,omitempty"` // OrLabelSelectors is list of LabelSelector to filter with // when restoring individual objects from the backup. If multiple provided // they will be joined by the OR operator. LabelSelector as well as // OrLabelSelectors cannot co-exist in restore request, only one of them // can be used // +optional // +nullable OrLabelSelectors []*LabelSelector `json:"orLabelSelectors,omitempty"` // RestorePVs specifies whether to restore all included // PVs from snapshot // +optional // +nullable RestorePVs *bool `json:"restorePVs,omitempty"` // RestoreStatus specifies which resources we should restore the status // field. If nil, no objects are included. Optional. // +optional // +nullable RestoreStatus *RestoreStatusSpec `json:"restoreStatus,omitempty"` // PreserveNodePorts specifies whether to restore old nodePorts from backup. // +optional // +nullable PreserveNodePorts *bool `json:"preserveNodePorts,omitempty"` // IncludeClusterResources specifies whether cluster-scoped resources // should be included for consideration in the restore. If null, defaults // to true. // +optional // +nullable IncludeClusterResources *bool `json:"includeClusterResources,omitempty"` // Hooks represent custom behaviors that should be executed during or post restore. // +optional Hooks RestoreHooks `json:"hooks,omitempty"` // ExistingResourcePolicy specifies the restore behavior for the Kubernetes resource to be restored // +optional // +nullable ExistingResourcePolicy PolicyType `json:"existingResourcePolicy,omitempty"` // ItemOperationTimeout specifies the time used to wait for RestoreItemAction operations // The default value is 1 hour. // +optional ItemOperationTimeout string `json:"itemOperationTimeout,omitempty"` // ResourceModifier specifies the reference to JSON resource patches that should be applied to resources before restoration. // +optional // +nullable ResourceModifier *TypedLocalObjectReference `json:"resourceModifier,omitempty"` // UploaderConfig specifies the configuration for the restore. // +optional // +nullable UploaderConfig *UploaderConfigForRestore `json:"uploaderConfig,omitempty"` }
RestoreSpec defines the specification for a Velero restore.
type RestoreStatus ¶
type RestoreStatus struct { // Phase is the current state of the Restore // +optional Phase RestorePhase `json:"phase,omitempty"` // ValidationErrors is a slice of all validation errors (if // applicable) // +optional // +nullable ValidationErrors []string `json:"validationErrors,omitempty"` // Warnings is a count of all warning messages that were generated during // execution of the restore. The actual warnings are stored in object storage. // +optional Warnings int `json:"warnings,omitempty"` // Errors is a count of all error messages that were generated during // execution of the restore. The actual errors are stored in object storage. // +optional Errors int `json:"errors,omitempty"` // FailureReason is an error that caused the entire restore to fail. // +optional FailureReason string `json:"failureReason,omitempty"` // StartTimestamp records the time the restore operation was started. // The server's time is used for StartTimestamps // +optional // +nullable StartTimestamp *Time `json:"startTimestamp,omitempty"` // CompletionTimestamp records the time the restore operation was completed. // Completion time is recorded even on failed restore. // The server's time is used for StartTimestamps // +optional // +nullable CompletionTimestamp *Time `json:"completionTimestamp,omitempty"` // Progress contains information about the restore's execution progress. Note // that this information is best-effort only -- if Velero fails to update it // during a restore for any reason, it may be inaccurate/stale. // +optional // +nullable Progress *RestoreProgress `json:"progress,omitempty"` // RestoreItemOperationsAttempted is the total number of attempted // async RestoreItemAction operations for this restore. // +optional RestoreItemOperationsAttempted int `json:"restoreItemOperationsAttempted,omitempty"` // RestoreItemOperationsCompleted is the total number of successfully completed // async RestoreItemAction operations for this restore. // +optional RestoreItemOperationsCompleted int `json:"restoreItemOperationsCompleted,omitempty"` // RestoreItemOperationsFailed is the total number of async // RestoreItemAction operations for this restore which ended with an error. // +optional RestoreItemOperationsFailed int `json:"restoreItemOperationsFailed,omitempty"` // HookStatus contains information about the status of the hooks. // +optional // +nullable HookStatus *HookStatus `json:"hookStatus,omitempty"` }
RestoreStatus captures the current status of a Velero restore
type RestoreStatusSpec ¶
type RestoreStatusSpec struct { // IncludedResources specifies the resources to which will restore the status. // If empty, it applies to all resources. // +optional // +nullable IncludedResources []string `json:"includedResources,omitempty"` // ExcludedResources specifies the resources to which will not restore the status. // +optional // +nullable ExcludedResources []string `json:"excludedResources,omitempty"` }
type Schedule ¶
type Schedule struct { TypeMeta `json:",inline"` // +optional ObjectMeta `json:"metadata"` // +optional Spec ScheduleSpec `json:"spec,omitempty"` // +optional Status ScheduleStatus `json:"status,omitempty"` }
Schedule is a Velero resource that represents a pre-scheduled or periodic Backup that should be run.
type ScheduleList ¶
type ScheduleList struct { TypeMeta `json:",inline"` // +optional ListMeta `json:"metadata,omitempty"` Items []Schedule `json:"items"` }
ScheduleList is a list of Schedules.
type SchedulePhase ¶
type SchedulePhase string
SchedulePhase is a string representation of the lifecycle phase of a Velero schedule +kubebuilder:validation:Enum=New;Enabled;FailedValidation
const ( // SchedulePhaseNew means the schedule has been created but not // yet processed by the ScheduleController SchedulePhaseNew SchedulePhase = "New" // SchedulePhaseEnabled means the schedule has been validated and // will now be triggering backups according to the schedule spec. SchedulePhaseEnabled SchedulePhase = "Enabled" // SchedulePhaseFailedValidation means the schedule has failed // the controller's validations and therefore will not trigger backups. SchedulePhaseFailedValidation SchedulePhase = "FailedValidation" )
type ScheduleSpec ¶
type ScheduleSpec struct { // Template is the definition of the Backup to be run // on the provided schedule Template BackupSpec `json:"template"` // Schedule is a Cron expression defining when to run // the Backup. Schedule string `json:"schedule"` // UseOwnerReferencesBackup specifies whether to use // OwnerReferences on backups created by this Schedule. // +optional // +nullable UseOwnerReferencesInBackup *bool `json:"useOwnerReferencesInBackup,omitempty"` // Paused specifies whether the schedule is paused or not // +optional Paused bool `json:"paused,omitempty"` SkipImmediately *bool `json:"skipImmediately,omitempty"` }
ScheduleSpec defines the specification for a Velero schedule
type ScheduleStatus ¶
type ScheduleStatus struct { // Phase is the current phase of the Schedule // +optional Phase SchedulePhase `json:"phase,omitempty"` // LastBackup is the last time a Backup was run for this // Schedule schedule // +optional // +nullable LastBackup *Time `json:"lastBackup,omitempty"` // LastSkipped is the last time a Schedule was skipped // +optional // +nullable LastSkipped *Time `json:"lastSkipped,omitempty"` // ValidationErrors is a slice of all validation errors (if // applicable) // +optional ValidationErrors []string `json:"validationErrors,omitempty"` }
ScheduleStatus captures the current state of a Velero schedule
type TypeMeta ¶
type TypeMeta struct { // Kind is a string value representing the REST resource this object represents. Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` // APIVersion defines the versioned schema of this representation of an object. APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"` }
type TypedLocalObjectReference ¶
type TypedLocalObjectReference struct { APIGroup *string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` // Kind is the type of resource being referenced Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` // Name is the name of resource being referenced Name string `json:"name" protobuf:"bytes,3,opt,name=name"` }
type UploaderConfigForBackup ¶
type UploaderConfigForBackup struct { // ParallelFilesUpload is the number of files parallel uploads to perform when using the uploader. // +optional ParallelFilesUpload int `json:"parallelFilesUpload,omitempty"` }
UploaderConfigForBackup defines the configuration for the uploader when doing backup.
type UploaderConfigForRestore ¶
type UploaderConfigForRestore struct { // WriteSparseFiles is a flag to indicate whether write files sparsely or not. // +optional // +nullable WriteSparseFiles *bool `json:"writeSparseFiles,omitempty"` }
UploaderConfigForRestore defines the configuration for the restore.