install

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultImage                = imageRegistry() + "/data-manager-for-plugin:" + imageVersion()
	DefaultImageLocalMode       = imageLocalMode()
	DefaultDatamgrPodCPURequest = "0"
	DefaultDatamgrPodMemRequest = "0"
	DefaultDatamgrPodCPULimit   = "0"
	DefaultDatamgrPodMemLimit   = "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",
}

Functions

func AllCRDs

func AllCRDs() *unstructured.UnstructuredList

func AllResources

func AllResources(o *DatamgrOptions, withCRDs bool) (*unstructured.UnstructuredList, error)

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 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 restic daemonset is ready, i.e. that pods are scheduled and available on all of the the desired nodes.

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 WithDefaultResticMaintenanceFrequency

func WithDefaultResticMaintenanceFrequency(val time.Duration) podTemplateOption

func WithImage

func WithImage(image string) podTemplateOption

func WithResources

func WithResources(resources corev1.ResourceRequirements) podTemplateOption

func WithRestoreOnly

func WithRestoreOnly() podTemplateOption

func WithSecret

func WithSecret(secretPresent bool) podTemplateOption

Types

type DatamgrOptions

type DatamgrOptions struct {
	Namespace           string
	Image               string
	ProviderName        string
	Bucket              string
	Prefix              string
	PodAnnotations      map[string]string
	DatamgrPodResources corev1.ResourceRequirements
	SecretData          []byte
}

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