constants

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Duration at which lease expires on CRs.
	LeaseDuration = 60 * time.Second

	// Duration after which leader renews its lease.
	RenewDeadline = 15 * time.Second

	// Duration after which non-leader retries to acquire lease.
	RetryPeriod = 5 * time.Second
)
View Source
const (
	// Duration after which Reflector resyncs CRs and calls UpdateFunc on each of the existing CRs.
	ResyncPeriod = 10 * time.Minute

	DefaultSecretResyncPeriod = 5 * time.Minute
)
View Source
const (
	// The key of SnapshotManager mode for data movement. Specifically, boolean string values are expected.
	// By default, it is "false". No data movement from local to remote storage if "true" is set.
	VolumeSnapshotterLocalMode = "LocalMode"
	// The key of SnapshotManager location
	VolumeSnapshotterManagerLocation = "SnapshotManagerLocation"
	// Valid values for the config with the VolumeSnapshotterManagerLocation key
	VolumeSnapshotterPlugin     = "Plugin"
	VolumeSnapshotterDataServer = "DataServer"
)

configuration constants for the volume snapshot plugin

View Source
const (
	// Max retry limit for downloads.
	DOWNLOAD_MAX_RETRY = 5

	// Initial retry for both uploads and downloads.
	MIN_RETRY = 0

	// BACKOFF for downloads.
	DOWNLOAD_BACKOFF = 5

	// Max backoff limit for uploads.
	UPLOAD_MAX_BACKOFF = 60

	// Exceeds this number of retry, will give a warning message to ask user to fix network issue in cluster.
	RETRY_WARNING_COUNT = 8
)
View Source
const (
	DefaultS3RepoPrefix     = "plugins/vsphere-astrolabe-repo"
	DefaultS3BackupLocation = "default"
	AWS_ACCESS_KEY_ID       = "aws_access_key_id"
	AWS_SECRET_ACCESS_KEY   = "aws_secret_access_key"
)

configuration constants for the S3 repository

View Source
const (
	// DefaultNamespace is the Kubernetes namespace that is used by default for
	// the Velero server and API objects.
	DefaultNamespace          = "velero"
	CloudCredentialSecretName = "cloud-credentials"
)
View Source
const (
	DataManagerForPlugin          = "data-manager-for-plugin"
	BackupDriverForPlugin         = "backup-driver"
	BackupDriverNamespace         = "velero-vsphere-plugin-backupdriver"
	VeleroPluginForVsphere        = "velero-plugin-for-vsphere"
	VeleroDeployment              = "velero"
	VSphereCSIController          = "vsphere-csi-controller"
	KubeSystemNamespace           = "kube-system"
	VSphereCSIControllerNamespace = "vmware-system-csi"
)
View Source
const (
	VCSecretNs           = "kube-system"
	VCSystemCSINs        = "vmware-system-csi"
	VCSecretNsSupervisor = "vmware-system-csi"
	VCSecret             = "vsphere-config-secret"
	VCSecretTKG          = "csi-vsphere-config"
)
View Source
const (
	Unknown    ClusterFlavor = "Unknown"
	Supervisor               = "Supervisor Cluster"
	TkgGuest                 = "TKG Guest Cluster"
	VSphere                  = "vSphere Kubernetes Cluster"
)
View Source
const (
	CsiDevVersion    = "v0.0.0"
	CsiMinVersion    = "v1.0.2"
	Csi2_3_0_Version = "v2.3.0"
	Csi2_0_0_Version = "v2.0.0"
)
View Source
const (
	VSphereLocalModeFlag    = "local-mode"
	VSphereLocalModeFeature = "EnableLocalMode"
)

feature flog constants

View Source
const (
	PvApiEndpoint = "supervisor.default.svc" // TODO: get it from "kubectl get cm -n vmware-system-csi pvcsi-config"
	PvPort        = "6443"
	PvSecretName  = "pvbackupdriver-provider-creds"
)

Para Virtual Cluster access for Guest Cluster

View Source
const (
	WithoutBackupRepository = "without-backup-repository"
	WithoutDeleteSnapshot   = "without-delete-snapshot"
)
View Source
const (
	ItemSnapshotLabel   = "velero-plugin-for-vsphere/item-snapshot-blob"
	PluginVersionLabel  = "velero-plugin-for-vsphere/plugin-version"
	SnapshotBackupLabel = "velero.io/backup-name"
)
View Source
const (
	RetryInterval = 5
	RetryMaximum  = 5
)
View Source
const (
	VCuuidKey                 = "vCenterUUID"
	SupervisorClusterIdKey    = "SupervisorClusterId"
	SupervisorResourcePoolKey = "SupervisorResourcePool"
)

Keys for supervisor cluster parameters

View Source
const (
	SnapshotParamBackupName       = "BackupName"
	SnapshotParamSvcSnapshotName  = "SvcSnapshotName"
	SnapshotParamBackupRepository = "BackupRepository"
)
View Source
const (
	// Plugin kind name
	PluginKindRestoreItemAction = "RestoreItemAction"
	// This label key is used to identify the name and kind of plugin that configMap is for
	ChangeStorageClassLabelKey = "velero.io/change-storage-class"
	// This label key is used to identify the ConfigMap as config for a plugin.
	PluginConfigLabelKey = "velero.io/plugin-config"
	// This is the reserved name used to map from a non storage class to a new storage class
	// at restore time. Storage class is required for restore. If no storage class is specified
	// in the PVC during backup, user can specify "com.vmware.cnsdp.emptystorageclass" as the
	// old storage class name to map to a new existing storage class name at restore time.
	EmptyStorageClass = "com.vmware.cnsdp.emptystorageclass"
)

These label keys are used to identify configMap used for storage class mapping, format: velero.io/plugin-config: "" velero.io/change-storage-class: RestoreItemAction

View Source
const (
	DefaultRetryIntervalStart = time.Second
	DefaultRetryIntervalMax   = 5 * time.Minute
)
View Source
const (
	ImageRepositoryComponent = "Repository"
	ImageContainerComponent  = "Container"
	ImageVersionComponent    = "Version"
)
View Source
const (
	VddkConfig         = "vddk-config"
	VddkConfigLabelKey = "velero.io/vddk-config"
	VixDiskLib         = "vix-disk-lib"
)
View Source
const (
	// supported volume type in plugin
	CnsBlockVolumeType = "ivd"
)
View Source
const DefaultCRCleanUpWindow = 24

Default time window to clean up CR which is in terminal state

View Source
const (
	// Default port used to access vCenter.
	DefaultVCenterPort string = "443"
)
View Source
const (
	S3RepositoryDriver string = "s3repository.astrolabe.vmware-tanzu.com"
)
View Source
const (
	TkgSupervisorService = "supervisor"
)
View Source
const VMwareSystemVMUUID = "vmware-system-vm-uuid"

UUID of the VM on Supervisor Cluster

View Source
const (
	VSphereCSIDriverName = "csi.vsphere.vmware.com"
)
View Source
const (
	VSpherePluginFeatureStates = "velero-vsphere-plugin-feature-states"
)
View Source
const VeleroExcludeLabel = "velero.io/exclude-from-backup"

Label to set for Velero to ignore resources

View Source
const (
	// Minimum velero version number to meet velero plugin requirement
	VeleroMinVersion = "v1.5.1"
)
View Source
const VsphereVolumeSnapshotLocationProvider = "velero.io/vsphere"

Variables

View Source
var PodAnnotationsToSkip = map[string]bool{

	"kubernetes.io/psp":                 true,
	"mac":                               true,
	"vlan":                              true,
	"vmware-system-ephemeral-disk-uuid": true,
	"vmware-system-image-references":    true,
	"vmware-system-vm-moid":             true,
	"vmware-system-vm-uuid":             true,
}
View Source
var ResourcesToBlock = map[string]bool{

	"agentinstalls.installers.tmc.cloud.vmware.com":      true,
	"aviloadbalancerconfigs.netoperator.vmware.com":      true,
	"blockaffinities.crd.projectcalico.org":              true,
	"certificaterequests.cert-manager.io":                true,
	"certificates.cert-manager.io":                       true,
	"challenges.acme.cert-manager.io":                    true,
	"clusterissuers.cert-manager.io":                     true,
	"clusterresourcesetbindings.addons.cluster.x-k8s.io": true,
	"clusterresourcesets.addons.cluster.x-k8s.io":        true,
	"clusters.cluster.x-k8s.io":                          true,
	"cnsnodevmattachments.cns.vmware.com":                true,
	"cnsregistervolumes.cns.vmware.com":                  true,
	"cnsvolumemetadatas.cns.vmware.com":                  true,
	"compatibilities.run.tanzu.vmware.com":               true,
	"contentlibraryproviders.vmoperator.vmware.com":      true,
	"contentsourcebindings.vmoperator.vmware.com":        true,
	"contentsources.vmoperator.vmware.com":               true,
	"gatewayclasses.networking.x-k8s.io":                 true,
	"gateways.networking.x-k8s.io":                       true,
	"haproxyloadbalancerconfigs.netoperator.vmware.com":  true,
	"httproutes.networking.x-k8s.io":                     true,
	"imagedisks.imagecontroller.vmware.com":              true,

	"installoptions.appplatform.wcp.vmware.com":          true,
	"installrequirements.appplatform.wcp.vmware.com":     true,
	"ipamblocks.crd.projectcalico.org":                   true,
	"ipamconfigs.crd.projectcalico.org":                  true,
	"ipamhandles.crd.projectcalico.org":                  true,
	"ippools.crd.projectcalico.org":                      true,
	"ippools.netoperator.vmware.com":                     true,
	"issuers.cert-manager.io":                            true,
	"kubeadmconfigs.bootstrap.cluster.x-k8s.io":          true,
	"kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io":  true,
	"kubeadmcontrolplanes.controlplane.cluster.x-k8s.io": true,
	"kuberneteslicenses.licenseoperator.vmware.com":      true,
	"loadbalancerconfigs.netoperator.vmware.com":         true,
	"loadbalancers.vmware.com":                           true,
	"machinedeployments.cluster.x-k8s.io":                true,
	"machinehealthchecks.cluster.x-k8s.io":               true,
	"machinepools.exp.cluster.x-k8s.io":                  true,
	"machines.cluster.x-k8s.io":                          true,
	"machinesets.cluster.x-k8s.io":                       true,
	"members.registryagent.vmware.com":                   true,
	"ncpconfigs.nsx.vmware.com":                          true,
	"network-attachment-definitions.k8s.cni.cncf.io":     true,
	"networkinterfaces.netoperator.vmware.com":           true,
	"networks.netoperator.vmware.com":                    true,
	"nsxerrors.nsx.vmware.com":                           true,

	"nsxlocks.nsx.vmware.com":                                 true,
	"nsxnetworkinterfaces.nsx.vmware.com":                     true,
	"orders.acme.cert-manager.io":                             true,
	"persistenceinstanceinfoes.psp.wcp.vmware.com":            true,
	"projects.registryagent.vmware.com":                       true,
	"providerserviceaccounts.run.tanzu.vmware.com":            true,
	"registries.registryagent.vmware.com":                     true,
	"resourcecheckreports.psp.wcp.vmware.com":                 true,
	"resourcechecks.psp.wcp.vmware.com":                       true,
	"storagepolicies.appplatform.wcp.vmware.com":              true,
	"storagepolicies.psp.wcp.vmware.com":                      true,
	"storagepools.cns.vmware.com":                             true,
	"supervisorservices.appplatform.wcp.vmware.com":           true,
	"tanzukubernetesaddons.run.tanzu.vmware.com":              true,
	"tanzukubernetesclusters.run.tanzu.vmware.com":            true,
	"tanzukubernetesreleases.run.tanzu.vmware.com":            true,
	"tcproutes.networking.x-k8s.io":                           true,
	"tkgserviceconfigurations.run.tanzu.vmware.com":           true,
	"vcuiplugins.appplatform.wcp.vmware.com":                  true,
	"veleroservices.veleroappoperator.vmware.com":             true,
	"virtualmachineclassbindings.vmoperator.vmware.com":       true,
	"virtualmachineclasses.vmoperator.vmware.com":             true,
	"virtualmachineimages.vmoperator.vmware.com":              true,
	"virtualmachineservices.vmoperator.vmware.com":            true,
	"virtualmachinesetresourcepolicies.vmoperator.vmware.com": true,
	"virtualmachines.vmoperator.vmware.com":                   true,
	"virtualnetworkinterfaces.vmware.com":                     true,
	"virtualnetworks.vmware.com":                              true,
	"vmxnet3networkinterfaces.netoperator.vmware.com":         true,
	"vspheredistributednetworks.netoperator.vmware.com":       true,
	"wcpclusters.infrastructure.cluster.vmware.com":           true,
	"wcpnamespaces.appplatform.wcp.vmware.com":                true,
	"wcpmachines.infrastructure.cluster.vmware.com":           true,
	"wcpmachinetemplates.infrastructure.cluster.vmware.com":   true,

	"backuprepositories.backupdriver.cnsdp.vmware.com":     true,
	"backuprepositoryclaims.backupdriver.cnsdp.vmware.com": true,
	"clonefromsnapshots.backupdriver.cnsdp.vmware.com":     true,
	"deletesnapshots.backupdriver.cnsdp.vmware.com":        true,
	"downloads.datamover.cnsdp.vmware.com":                 true,
	"snapshots.backupdriver.cnsdp.vmware.com":              true,
	"uploads.datamover.cnsdp.vmware.com":                   true,
}

We are currently translating Group + Kind -> the names below. This involves a singular to plural conversion. When adding new resources, ensure that they work with the singular to plural rule of words ending in "y" the "y" becomes "ies" and other words get an "s" attached.

View Source
var ResourcesToBlockOnRestore = map[string]bool{

	"pods": true,

	"images.imagecontroller.vmware.com": true,

	"nsxlbmonitors.vmware.com":           true,
	"nsxloadbalancermonitors.vmware.com": true,
}
View Source
var ResourcesToHandle = map[string]bool{
	"persistentvolumeclaims": true,
}

Functions

This section is empty.

Types

type ClusterFlavor

type ClusterFlavor string

Indicates the type of cluster where Plugin is installed

Jump to

Keyboard shortcuts

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