Documentation ¶
Index ¶
- Variables
- func AllBackupDriverResources(o *PodOptions, withCRDs bool) (*unstructured.UnstructuredList, error)
- func AllCRDs() *unstructured.UnstructuredList
- func AllDatamgrResources(o *PodOptions, withCRDs bool) (*unstructured.UnstructuredList, error)
- func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1.DaemonSet
- func DaemonSetIsReady(factory client.DynamicFactory, namespace string, nNodes int) (bool, error)
- func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment
- func DeploymentIsReady(factory client.DynamicFactory, namespace string) (bool, error)
- func Install(factory client.DynamicFactory, resources *unstructured.UnstructuredList, ...) error
- func WithAnnotations(annotations map[string]string) podTemplateOption
- func WithEnvFromSecretKey(varName, secret, key string) podTemplateOption
- func WithHostNetwork(hostNetwork bool) podTemplateOption
- func WithImage(image string) podTemplateOption
- func WithMasterNodeAffinity(affinity bool) podTemplateOption
- func WithResources(resources corev1.ResourceRequirements) podTemplateOption
- func WithRestoreOnly() podTemplateOption
- func WithSecret(secretPresent bool) podTemplateOption
- type PodOptions
- type ResourceGroup
Constants ¶
This section is empty.
Variables ¶
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.
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 DaemonSetIsReady ¶
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 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 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 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