install

package
v1.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDatamgrImage         = imageRegistry() + "/" + constants.DataManagerForPlugin + ":" + imageVersion()
	DefaultDatamgrPodCPURequest = "0"
	DefaultDatamgrPodMemRequest = "0"
	DefaultDatamgrPodCPULimit   = "0"
	DefaultDatamgrPodMemLimit   = "0"

	DefaultBackupDriverImage         = imageRegistry() + "/" + constants.BackupDriverForPlugin + ":" + imageVersion()
	DefaultBackupDriverPodCPURequest = "0"
	DefaultBackupDriverPodMemRequest = "0"
	DefaultBackupDriverPodCPULimit   = "0"
	DefaultBackupDriverPodMemLimit   = "0"
)

DefaultImage is the default image to use for the Velero deployment and restic daemonset containers.

View Source
var CRDsList = []string{
	"backupstoragelocations.velero.io",
	"volumesnapshotlocations.velero.io",
}

TODO: Update this list with plugin CRDs

Functions

func AllBackupDriverResources added in v1.1.0

func AllBackupDriverResources(o *PodOptions, withCRDs bool) (*unstructured.UnstructuredList, error)

AllBackupDriverResources returns a list of all resources necessary to install Datamgr, in the appropriate order, into a Kubernetes cluster. Items are unstructured, since there are different data types returned.

func AllCRDs

func AllCRDs() *unstructured.UnstructuredList

TODO: Split CRDs, or only install when backup driver is installed?

func AllDatamgrResources added in v1.1.0

func AllDatamgrResources(o *PodOptions, withCRDs bool) (*unstructured.UnstructuredList, error)

AllDatamgrResources returns a list of all resources necessary to install Datamgr, in the appropriate order, into a Kubernetes cluster. Items are unstructured, since there are different data types returned.

func DaemonSet

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

func DaemonSetIsReady

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

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

func Deployment added in v1.1.0

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

func DeploymentIsReady added in v1.1.0

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

DeploymentIsReady will poll the kubernetes API server to see if the backup-driver deployment is ready to service user requests.

func Install

func Install(factory client.DynamicFactory, 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 WithAnnotations

func WithAnnotations(annotations map[string]string) podTemplateOption

func WithEnvFromSecretKey added in v1.1.0

func WithEnvFromSecretKey(varName, secret, key string) podTemplateOption

func WithHostNetwork added in v1.1.0

func WithHostNetwork(hostNetwork bool) podTemplateOption

func WithImage

func WithImage(image string) podTemplateOption

func WithMasterNodeAffinity added in v1.1.0

func WithMasterNodeAffinity(affinity bool) podTemplateOption

func WithResources

func WithResources(resources corev1.ResourceRequirements) podTemplateOption

func WithRestoreOnly

func WithRestoreOnly() podTemplateOption

func WithSecret

func WithSecret(secretPresent bool) podTemplateOption

Types

type PodOptions added in v1.1.0

type PodOptions struct {
	Namespace      string
	Image          string
	ProviderName   string
	Bucket         string
	Prefix         string
	PodAnnotations map[string]string
	PodResources   corev1.ResourceRequirements
	SecretData     []byte
	SecretAdd      bool
	MasterAffinity bool
	HostNetwork    bool
	Features       []string
}

type ResourceGroup

type ResourceGroup struct {
	CRDResources   []*unstructured.Unstructured
	OtherResources []*unstructured.Unstructured
}

ResourceGroup represents a collection of kubernetes objects with a common ready conditon

func GroupResources

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

Jump to

Keyboard shortcuts

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