Documentation ¶
Index ¶
Constants ¶
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 )
const ( // Duration after which Reflector resyncs CRs and calls UpdateFunc on each of the existing CRs. ResyncPeriod = 10 * time.Minute DefaultSecretResyncPeriod = 5 * time.Minute )
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
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 )
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
const ( // DefaultNamespace is the Kubernetes namespace that is used by default for // the Velero server and API objects. DefaultNamespace = "velero" CloudCredentialSecretName = "cloud-credentials" )
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" )
const ( VCSecretNs = "kube-system" VCSystemCSINs = "vmware-system-csi" VCSecretNsSupervisor = "vmware-system-csi" VCSecret = "vsphere-config-secret" VCSecretTKG = "csi-vsphere-config" )
const ( Unknown ClusterFlavor = "Unknown" Supervisor = "Supervisor Cluster" TkgGuest = "TKG Guest Cluster" VSphere = "vSphere Kubernetes Cluster" )
const ( CsiDevVersion = "v0.0.0" CsiMinVersion = "v1.0.2" Csi2_3_0_Version = "v2.3.0" Csi2_0_0_Version = "v2.0.0" )
const ( VSphereLocalModeFlag = "local-mode" VSphereLocalModeFeature = "EnableLocalMode" )
feature flog constants
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
const ( WithoutBackupRepository = "without-backup-repository" WithoutDeleteSnapshot = "without-delete-snapshot" )
const ( ItemSnapshotLabel = "velero-plugin-for-vsphere/item-snapshot-blob" PluginVersionLabel = "velero-plugin-for-vsphere/plugin-version" SnapshotBackupLabel = "velero.io/backup-name" )
const ( RetryInterval = 5 RetryMaximum = 5 )
const ( VCuuidKey = "vCenterUUID" SupervisorClusterIdKey = "SupervisorClusterId" SupervisorResourcePoolKey = "SupervisorResourcePool" )
Keys for supervisor cluster parameters
const ( SnapshotParamBackupName = "BackupName" SnapshotParamSvcSnapshotName = "SvcSnapshotName" SnapshotParamBackupRepository = "BackupRepository" )
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
const ( DefaultRetryIntervalStart = time.Second DefaultRetryIntervalMax = 5 * time.Minute )
const ( ImageRepositoryComponent = "Repository" ImageContainerComponent = "Container" ImageVersionComponent = "Version" )
const ( VddkConfig = "vddk-config" VddkConfigLabelKey = "velero.io/vddk-config" VixDiskLib = "vix-disk-lib" )
const (
// supported volume type in plugin
CnsBlockVolumeType = "ivd"
)
const DefaultCRCleanUpWindow = 24
Default time window to clean up CR which is in terminal state
const ( // Default port used to access vCenter. DefaultVCenterPort string = "443" )
const (
S3RepositoryDriver string = "s3repository.astrolabe.vmware-tanzu.com"
)
const (
TkgSupervisorService = "supervisor"
)
const VMwareSystemVMUUID = "vmware-system-vm-uuid"
UUID of the VM on Supervisor Cluster
const (
VSphereCSIDriverName = "csi.vsphere.vmware.com"
)
const (
VSpherePluginFeatureStates = "velero-vsphere-plugin-feature-states"
)
const VeleroExcludeLabel = "velero.io/exclude-from-backup"
Label to set for Velero to ignore resources
const (
// Minimum velero version number to meet velero plugin requirement
VeleroMinVersion = "v1.5.1"
)
const VsphereVolumeSnapshotLocationProvider = "velero.io/vsphere"
Variables ¶
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, }
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.
var ResourcesToBlockOnRestore = map[string]bool{ "pods": true, "images.imagecontroller.vmware.com": true, "nsxlbmonitors.vmware.com": true, "nsxloadbalancermonitors.vmware.com": true, }
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