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" // Default image registry for the fall-back mechanism in the image-parsing workflow // when installing backup-driver and data-manager-for-plug while installing velero-plugin-for-vsphere. // Make sure to update it accordingly if the official image registry gets migrated. DefaultImageRegistry = "vsphereveleroplugin" )
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" DecoupleVSphereCSIDriverFlag = "decouple-vsphere-csi-driver" VSphereLocalModeFeature = "EnableLocalMode" CSIMigratedVolumeSupportFlag = "csi-migrated-volume-support" )
feature flag 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 // Default maximum retry count for upload CR. // After upload CR retry reaches the maximum and still cannot upload the snapshot to durable storage. Upload CR will stop further retry and // try to delete the local snapshot. // If local snapshot is deleted successfully, the status of upload CR will change to "UploadFailedAfterRetry". // If local snapshot cannot be deleted, the status of upload CR will change to "CleanupFailed". // If the default maximum retry count does work for user, it can be overwritten by setting the "upload-cr-retry-max" // parameter in config map velero-vsphere-plugin-config. DefaultUploadCRRetryMaximum = 10 )
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 ( VSphereCSIDriverName = "csi.vsphere.vmware.com" VSphereCSIDriverMigrationAnnotation = "pv.kubernetes.io/migrated-to" )
const ( VddkConfig = "vddk-config" VddkConfigLabelKey = "velero.io/vddk-config" VixDiskLib = "vix-disk-lib" )
const ( ConfigClusterFlavorKey = "cluster_flavor" VeleroVSpherePluginConfig = "velero-vsphere-plugin-config" VSphereSecretNamespaceKey = "vsphere_secret_namespace" VSphereSecretNameKey = "vsphere_secret_name" DefaultSecretName = "velero-vsphere-config-secret" DefaultSecretNamespace = "velero" UploadCRRetryMaximumKey = "upload-cr-retry-max" )
const ( // AnnVolumeHealth is the key for HealthStatus annotation on volume claim // for vSphere CSI Driver. AnnVolumeHealth = "volumehealth.storage.kubernetes.io/health" // key for expressing timestamp for volume health annotation AnnVolumeHealthTS = "volumehealth.storage.kubernetes.io/health-timestamp" )
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 DefaultVeleroNamespace = "velero"
const (
ResourcesToBlockListName = "velero-vsphere-plugin-blocked-resources-list"
)
Name for skip resources list configmap
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 (
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, "vmware-system-network": true, "nsx.vmware.com/attachment": true, "nsx.vmware.com/mac": true, }
var ResourcesToBlock = map[string]bool{}/* 113 elements not displayed */
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