Version: v1.8.1 Latest Latest

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 24 Imported by: 6



Package install provides public functions for easily creating and installing resources necessary for Velero to operate. Some default settings are assumed with these functions.



This section is empty.


View Source
var (
	DefaultVeleroPodCPURequest = "500m"
	DefaultVeleroPodMemRequest = "128Mi"
	DefaultVeleroPodCPULimit   = "1000m"
	DefaultVeleroPodMemLimit   = "512Mi"
	DefaultResticPodCPURequest = "500m"
	DefaultResticPodMemRequest = "512Mi"
	DefaultResticPodCPULimit   = "1000m"
	DefaultResticPodMemLimit   = "1Gi"
	DefaultVeleroNamespace     = "velero"


func AllCRDs added in v1.2.0

func AllCRDs() *unstructured.UnstructuredList

func AllResources added in v1.0.0

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 DaemonSet

func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1.DaemonSet

func DaemonSetIsReady added in v1.2.0

func DaemonSetIsReady(factory client.DynamicFactory, namespace string) (bool, error)

DaemonSetIsReady will poll the kubernetes API server to ensure the restic daemonset is ready, i.e. that pods are scheduled and available on all of the the desired nodes.

func Deployment

func Deployment(namespace string, opts ...podTemplateOption) *appsv1.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 Labels added in v1.6.0

func Labels() map[string]string

func Namespace

func Namespace(namespace string) *corev1.Namespace

func Secret added in v1.0.0

func Secret(namespace string, data []byte) *corev1.Secret

func ServiceAccount

func ServiceAccount(namespace string, annotations map[string]string) *corev1.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 WithAnnotations(annotations map[string]string) podTemplateOption

func WithDefaultResticMaintenanceFrequency added in v1.2.0

func WithDefaultResticMaintenanceFrequency(val time.Duration) podTemplateOption

func WithDefaultVolumesToRestic added in v1.5.0

func WithDefaultVolumesToRestic() podTemplateOption

func WithEnvFromSecretKey

func WithEnvFromSecretKey(varName, secret, key string) podTemplateOption

func WithFeatures added in v1.4.0

func WithFeatures(features []string) podTemplateOption

func WithImage

func WithImage(image string) podTemplateOption

func WithPlugins added in v1.2.0

func WithPlugins(plugins []string) podTemplateOption

func WithResources added in v1.0.1

func WithResources(resources corev1.ResourceRequirements) podTemplateOption

func WithRestoreOnly

func WithRestoreOnly() podTemplateOption

func WithSecret added in v1.0.1

func WithSecret(secretPresent bool) podTemplateOption


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
	ServiceAccountAnnotations         map[string]string
	VeleroPodResources                corev1.ResourceRequirements
	ResticPodResources                corev1.ResourceRequirements
	SecretData                        []byte
	RestoreOnly                       bool
	UseRestic                         bool
	UseVolumeSnapshots                bool
	BSLConfig                         map[string]string
	VSLConfig                         map[string]string
	DefaultResticMaintenanceFrequency time.Duration
	Plugins                           []string
	NoDefaultBackupLocation           bool
	CACertData                        []byte
	Features                          []string
	DefaultVolumesToRestic            bool

Jump to

Keyboard shortcuts

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