Documentation
¶
Overview ¶
Package install provides public functions for easily creating and installing resources necessary for Velero to operate. Some default settings are assumed with these functions.
Index ¶
- Variables
- func AllCRDs() *unstructured.UnstructuredList
- func AllResources(o *VeleroOptions) *unstructured.UnstructuredList
- func BackupStorageLocation(namespace, provider, bucket, prefix string, config map[string]string, ...) *velerov1api.BackupStorageLocation
- func ClusterRoleBinding(namespace string) *rbacv1.ClusterRoleBinding
- func CreateClient(r *unstructured.Unstructured, factory client.DynamicFactory, w io.Writer) (client.Dynamic, error)
- func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1api.DaemonSet
- func Deployment(namespace string, opts ...podTemplateOption) *appsv1api.Deployment
- func DeploymentIsReady(factory client.DynamicFactory, namespace string) (bool, error)
- func Install(dynamicFactory client.DynamicFactory, kbClient kbclient.Client, ...) error
- func Labels() map[string]string
- func Namespace(namespace string) *corev1api.Namespace
- func NodeAgentIsReady(factory client.DynamicFactory, namespace string) (bool, error)
- func NodeAgentWindowsIsReady(factory client.DynamicFactory, namespace string) (bool, error)
- func Secret(namespace string, data []byte) *corev1api.Secret
- func ServiceAccount(namespace string, annotations map[string]string) *corev1api.ServiceAccount
- func VolumeSnapshotLocation(namespace, provider string, config map[string]string) *velerov1api.VolumeSnapshotLocation
- func WithAnnotations(annotations map[string]string) podTemplateOption
- func WithBackupRepoConfigMap(backupRepoConfigMap string) podTemplateOption
- func WithDefaultRepoMaintenanceFrequency(val time.Duration) podTemplateOption
- func WithDefaultSnapshotMoveData(b bool) podTemplateOption
- func WithDefaultVolumesToFsBackup(b bool) podTemplateOption
- func WithDisableInformerCache(b bool) podTemplateOption
- func WithEnvFromSecretKey(varName, secret, key string) podTemplateOption
- func WithFeatures(features []string) podTemplateOption
- func WithForWindows() podTemplateOption
- func WithGarbageCollectionFrequency(val time.Duration) podTemplateOption
- func WithImage(image string) podTemplateOption
- func WithItemBlockWorkerCount(itemBlockWorkerCount int) podTemplateOption
- func WithKeepLatestMaintenanceJobs(keepLatestMaintenanceJobs int) podTemplateOption
- func WithKubeletRootDir(kubeletRootDir string) podTemplateOption
- func WithLabels(labels map[string]string) podTemplateOption
- func WithNodeAgentConfigMap(nodeAgentConfigMap string) podTemplateOption
- func WithNodeAgentDisableHostPath(disable bool) podTemplateOption
- func WithPlugins(plugins []string) podTemplateOption
- func WithPodResources(podResources kube.PodResources) podTemplateOption
- func WithPodVolumeOperationTimeout(val time.Duration) podTemplateOption
- func WithPriorityClassName(priorityClassName string) podTemplateOption
- func WithPrivilegedNodeAgent(b bool) podTemplateOption
- func WithRepoMaintenanceJobConfigMap(repoMaintenanceJobConfigMap string) podTemplateOption
- func WithResources(resources corev1api.ResourceRequirements) podTemplateOption
- func WithRestoreOnly(b bool) podTemplateOption
- func WithScheduleSkipImmediately(b bool) podTemplateOption
- func WithSecret(secretPresent bool) podTemplateOption
- func WithServiceAccountName(sa string) podTemplateOption
- func WithUploaderType(t string) podTemplateOption
- type ResourceGroup
- type VeleroOptions
Constants ¶
This section is empty.
Variables ¶
var ( // default values for Velero server pod resource request/limit DefaultVeleroPodCPURequest = "500m" DefaultVeleroPodMemRequest = "128Mi" DefaultVeleroPodCPULimit = "1000m" DefaultVeleroPodMemLimit = "512Mi" // default values for node-agent pod resource request/limit, // "0" means no request/limit is set, so as to make the QoS as BestEffort DefaultNodeAgentPodCPURequest = "0" DefaultNodeAgentPodMemRequest = "0" DefaultNodeAgentPodCPULimit = "0" DefaultNodeAgentPodMemLimit = "0" DefaultVeleroNamespace = "velero" DefaultKubeletRootDir = "/var/lib/kubelet" )
Functions ¶
func AllCRDs ¶ added in v1.2.0
func AllCRDs() *unstructured.UnstructuredList
func AllResources ¶ added in v1.0.0
func AllResources(o *VeleroOptions) *unstructured.UnstructuredList
AllResources returns a list of all resources necessary to install Velero, in the appropriate order, into a Kubernetes cluster. Items are unstructured, since there are different data types returned.
func BackupStorageLocation ¶ added in v1.0.0
func BackupStorageLocation(namespace, provider, bucket, prefix string, config map[string]string, caCert []byte) *velerov1api.BackupStorageLocation
func ClusterRoleBinding ¶
func ClusterRoleBinding(namespace string) *rbacv1.ClusterRoleBinding
func CreateClient ¶ added in v1.6.0
func CreateClient(r *unstructured.Unstructured, factory client.DynamicFactory, w io.Writer) (client.Dynamic, error)
CreateClient creates a client for an unstructured resource
func Deployment ¶
func Deployment(namespace string, opts ...podTemplateOption) *appsv1api.Deployment
func DeploymentIsReady ¶ added in v1.0.0
func DeploymentIsReady(factory client.DynamicFactory, namespace string) (bool, error)
DeploymentIsReady will poll the Kubernetes API server to see if the velero deployment is ready to service user requests.
func Install ¶ added in v1.0.0
func Install(dynamicFactory client.DynamicFactory, kbClient kbclient.Client, resources *unstructured.UnstructuredList, w io.Writer) error
Install creates resources on the Kubernetes cluster. An unstructured list of resources is sent, one at a time, to the server. These are assumed to be in the preferred order already. Resources will be sorted into CustomResourceDefinitions and any other resource type, and the function will wait up to 1 minute for CRDs to be ready before proceeding. An io.Writer can be used to output to a log or the console.
func NodeAgentIsReady ¶ added in v1.16.0
func NodeAgentIsReady(factory client.DynamicFactory, namespace string) (bool, error)
NodeAgentIsReady will poll the Kubernetes API server to ensure the node-agent daemonset is ready, i.e. that pods are scheduled and available on all of the desired nodes.
func NodeAgentWindowsIsReady ¶ added in v1.16.0
func NodeAgentWindowsIsReady(factory client.DynamicFactory, namespace string) (bool, error)
NodeAgentWindowsIsReady will poll the Kubernetes API server to ensure the node-agent-windows daemonset is ready, i.e. that pods are scheduled and available on all of the desired nodes.
func ServiceAccount ¶
func ServiceAccount(namespace string, annotations map[string]string) *corev1api.ServiceAccount
func VolumeSnapshotLocation ¶ added in v1.0.0
func VolumeSnapshotLocation(namespace, provider string, config map[string]string) *velerov1api.VolumeSnapshotLocation
func WithAnnotations ¶ added in v1.0.1
func WithBackupRepoConfigMap ¶ added in v1.15.0
func WithBackupRepoConfigMap(backupRepoConfigMap string) podTemplateOption
func WithDefaultRepoMaintenanceFrequency ¶ added in v1.10.0
func WithDefaultSnapshotMoveData ¶ added in v1.12.1
func WithDefaultSnapshotMoveData(b bool) podTemplateOption
func WithDefaultVolumesToFsBackup ¶ added in v1.10.0
func WithDefaultVolumesToFsBackup(b bool) podTemplateOption
func WithDisableInformerCache ¶ added in v1.12.1
func WithDisableInformerCache(b bool) podTemplateOption
func WithEnvFromSecretKey ¶
func WithEnvFromSecretKey(varName, secret, key string) podTemplateOption
func WithFeatures ¶ added in v1.4.0
func WithFeatures(features []string) podTemplateOption
func WithForWindows ¶ added in v1.16.0
func WithForWindows() podTemplateOption
func WithGarbageCollectionFrequency ¶ added in v1.9.0
func WithItemBlockWorkerCount ¶ added in v1.16.0
func WithItemBlockWorkerCount(itemBlockWorkerCount int) podTemplateOption
func WithKeepLatestMaintenanceJobs ¶ added in v1.15.0
func WithKeepLatestMaintenanceJobs(keepLatestMaintenanceJobs int) podTemplateOption
func WithKubeletRootDir ¶ added in v1.17.0
func WithKubeletRootDir(kubeletRootDir string) podTemplateOption
func WithLabels ¶ added in v1.9.0
func WithNodeAgentConfigMap ¶ added in v1.15.0
func WithNodeAgentConfigMap(nodeAgentConfigMap string) podTemplateOption
func WithNodeAgentDisableHostPath ¶ added in v1.17.0
func WithNodeAgentDisableHostPath(disable bool) podTemplateOption
func WithPlugins ¶ added in v1.2.0
func WithPlugins(plugins []string) podTemplateOption
func WithPodResources ¶ added in v1.15.0
func WithPodResources(podResources kube.PodResources) podTemplateOption
func WithPriorityClassName ¶ added in v1.17.0
func WithPriorityClassName(priorityClassName string) podTemplateOption
func WithPrivilegedNodeAgent ¶ added in v1.12.1
func WithPrivilegedNodeAgent(b bool) podTemplateOption
func WithRepoMaintenanceJobConfigMap ¶ added in v1.15.0
func WithRepoMaintenanceJobConfigMap(repoMaintenanceJobConfigMap string) podTemplateOption
func WithResources ¶ added in v1.0.1
func WithResources(resources corev1api.ResourceRequirements) podTemplateOption
func WithRestoreOnly ¶
func WithRestoreOnly(b bool) podTemplateOption
func WithScheduleSkipImmediately ¶ added in v1.13.0
func WithScheduleSkipImmediately(b bool) podTemplateOption
func WithSecret ¶ added in v1.0.1
func WithSecret(secretPresent bool) podTemplateOption
func WithServiceAccountName ¶ added in v1.11.0
func WithServiceAccountName(sa string) podTemplateOption
func WithUploaderType ¶ added in v1.10.0
func WithUploaderType(t string) podTemplateOption
Types ¶
type ResourceGroup ¶ added in v1.0.0
type ResourceGroup struct {
CRDResources []*unstructured.Unstructured
OtherResources []*unstructured.Unstructured
}
ResourceGroup represents a collection of Kubernetes objects with a common ready condition
func GroupResources ¶ added in v1.0.0
func GroupResources(resources *unstructured.UnstructuredList) *ResourceGroup
GroupResources groups resources based on whether the resources are CustomResourceDefinitions or other types of Kubernetes objects This is useful to wait for readiness before creating CRD objects
type VeleroOptions ¶ added in v1.0.0
type VeleroOptions struct {
Namespace string
Image string
ProviderName string
Bucket string
Prefix string
PodAnnotations map[string]string
PodLabels map[string]string
ServiceAccountAnnotations map[string]string
ServiceAccountName string
VeleroPodResources corev1api.ResourceRequirements
NodeAgentPodResources corev1api.ResourceRequirements
SecretData []byte
RestoreOnly bool
UseNodeAgent bool
UseNodeAgentWindows bool
PrivilegedNodeAgent bool
UseVolumeSnapshots bool
BSLConfig map[string]string
VSLConfig map[string]string
DefaultRepoMaintenanceFrequency time.Duration
GarbageCollectionFrequency time.Duration
PodVolumeOperationTimeout time.Duration
Plugins []string
NoDefaultBackupLocation bool
CACertData []byte
Features []string
DefaultVolumesToFsBackup bool
UploaderType string
DefaultSnapshotMoveData bool
DisableInformerCache bool
ScheduleSkipImmediately bool
PodResources kube.PodResources
KeepLatestMaintenanceJobs int
BackupRepoConfigMap string
RepoMaintenanceJobConfigMap string
NodeAgentConfigMap string
ItemBlockWorkerCount int
KubeletRootDir string
NodeAgentDisableHostPath bool
ServerPriorityClassName string
NodeAgentPriorityClassName string
}