constants

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 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"
	// 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"
)
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"
	DecoupleVSphereCSIDriverFlag = "decouple-vsphere-csi-driver"
	VSphereLocalModeFeature      = "EnableLocalMode"
	CSIMigratedVolumeSupportFlag = "csi-migrated-volume-support"
)

feature flag 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 (
	VSphereCSIDriverName                = "csi.vsphere.vmware.com"
	VSphereCSIDriverMigrationAnnotation = "pv.kubernetes.io/migrated-to"
)
View Source
const (
	VddkConfig         = "vddk-config"
	VddkConfigLabelKey = "velero.io/vddk-config"
	VixDiskLib         = "vix-disk-lib"
)
View Source
const (
	ConfigClusterFlavorKey    = "cluster_flavor"
	VeleroVSpherePluginConfig = "velero-vsphere-plugin-config"
	VSphereSecretNamespaceKey = "vsphere_secret_namespace"
	VSphereSecretNameKey      = "vsphere_secret_name"
	DefaultSecretName         = "velero-vsphere-config-secret"
	DefaultSecretNamespace    = "velero"
)
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 DefaultVeleroNamespace = "velero"
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 (
	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{}/* 105 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.

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