constants

package
v0.0.0-...-9331f55 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package constants defines various constants used in the code.

Index

Constants

View Source
const (

	// AddonControllerManagerLeaderElectionResourceName is the name of the resource that leader election of
	// addons controller manager will use for holding the leader lock.
	AddonControllerManagerLeaderElectionResourceName = "tanzu-addons-manager-leader-lock"

	// CalicoAddonName is name of the Calico addon
	CalicoAddonName = "calico"

	// CalicoDefaultRefName is default refname for Calico addon
	CalicoDefaultRefName = CalicoAddonName + ".tanzu.vmware.com"

	// CPIAddonName is name of the cloud-provider-vsphere addon
	CPIAddonName = "vsphere-cpi"

	// CPIDefaultRefName is default refname for cloud-provider-vsphere addon addon
	CPIDefaultRefName = CPIAddonName + ".tanzu.vmware.com"

	// OracleCPIAddonName is name of the Oracle CPI & CSI addon
	OracleCPIAddonName = "oracle-cpi"

	// OracleCPIDefaultRefName is default refname for cloud-provider-oracle addon addon
	OracleCPIDefaultRefName = OracleCPIAddonName + ".tanzu.vmware.com"

	// PVCSIAddonName is name of the vsphere-pv-csi addon
	PVCSIAddonName = "vsphere-pv-csi"

	// CSIAddonName is name of the vsphere-csi addon
	CSIAddonName = "vsphere-csi"

	// CSIDefaultRefName is default refname for vsphere-csi addon
	CSIDefaultRefName = CSIAddonName + ".tanzu.vmware.com"

	// AzureDiskCSIAddonName is name of the azure-disk-csi addon
	AzureDiskCSIAddonName = "azuredisk-csi"

	// AwsEbsCSIAddonName is name of the aws-ebs-csi addon
	AwsEbsCSIAddonName = "aws-ebs-csi"
	// AzureFileCSIAddonName is name of the azurefile-csi addon
	AzureFileCSIAddonName = "azurefile-csi"

	// KubevipCloudProvider is name of the kube-vip-cloud-provider addon
	KubevipCloudProviderAddonName = "kube-vip-cloud-provider"

	// TKGBomNamespace is the TKG add on BOM namespace.
	TKGBomNamespace = "tkr-system"

	// TKGBomNamespaceClassyClusters is the TKG add on BOM namespace for ClusterClass or
	// ClusterClass capable management clusters.
	TKGBomNamespaceClassyClusters = "tkg-system"

	// TKRLabel is the TKR label.
	TKRLabel = "tanzuKubernetesRelease"

	// TKGVersionLabel is the TKG version label.
	TKGVersionLabel = "tkg.tanzu.vmware.com/version"

	// TKRLabelClassyClusters is the TKR label for the clusters created using cluster-class
	TKRLabelClassyClusters = "run.tanzu.vmware.com/tkr"

	// TKRLabelLegacyClusters is the TKR label for legacy clusters
	TKRLabelLegacyClusters = "run.tanzu.vmware.com/legacy-tkr"

	// TKGAnnotationTemplateConfig is the TKG annotation for addon config CRs used by ClusterBootstrapTemplate
	TKGAnnotationTemplateConfig = "tkg.tanzu.vmware.com/template-config"

	// TKRBomContent is the TKR BOM content.
	TKRBomContent = "bomContent"

	// TKGBomContent is the TKG BOM content.
	TKGBomContent = "bom.yaml"

	// ClusterMetadataNamespace is the namespace for ClusterMetadata
	ClusterMetadataNamespace = "tkg-system-public"

	// TkgBomConfigMapName is the name of TkgBomConfigMap
	TkgBomConfigMapName = "tkg-bom"

	// TkgMetadataConfigMapName is the name of TkgMetadataConfigMap
	TkgMetadataConfigMapName = "tkg-metadata"

	// ClusterMetadataNamespaceRoleName is the role name of ClusterMetadata
	ClusterMetadataNamespaceRoleName = "tkg-metadata-reader"

	// ClusterMetadataRolebindingSubjectName is the subjectName of ClusterMetadataRolebinding
	ClusterMetadataRolebindingSubjectName = "system:authenticated"

	// TKGCompatibility is the TKG compatibility content.
	TKGCompatibility = "compatibility"

	// TKRConfigmapName is the name of TKR config map
	TKRConfigmapName = "tkr-controller-config"

	// TKRRepoKey is the key for image repository in TKR config map data.
	TKRRepoKey = "imageRepository"

	// TKGPackageReconcilerKey is the log key for "name".
	TKGPackageReconcilerKey = "Package"

	// TKGAppReconcilerKey is the log key for "name".
	TKGAppReconcilerKey = "App"

	// TKGDataValueFormatString is required annotations for YTT data value file
	TKGDataValueFormatString = "#@data/values\n#@overlay/match-child-defaults missing_ok=True\n---\n"

	// TKGDataValueFileName is the default name of YTT data value file
	TKGDataValueFileName = "values.yaml"

	// TKGSDataValueFileName is the default name of YTT data value file for TKR info
	TKGSDataValueFileName = "tkgs-values.yaml"

	// TKGCorePackageRepositoryComponentName is the name of component that includes the package and repository images
	TKGCorePackageRepositoryComponentName = "tkg-core-packages"

	// TKGCorePackageRepositoryImageName is the name of core package repository image
	TKGCorePackageRepositoryImageName = "tanzuCorePackageRepositoryImage"

	// TKGSDeploymentUpdateStrategy is the update strategy used by TKGS deployments
	TKGSDeploymentUpdateStrategy = "RollingUpdate"

	// TKGSDeploymentUpdateMaxSurge is the MaxSurge used by TKGS deployments rollingUpdate
	TKGSDeploymentUpdateMaxSurge = 1

	// TKGSDeploymentUpdateMaxUnavailable is the MaxUnavailableused by TKGS deployments rollingUpdate
	TKGSDeploymentUpdateMaxUnavailable = 0

	// TKGSDaemonsetUpdateStrategy is the update strategy used by TKGS daemonsets
	TKGSDaemonsetUpdateStrategy = "OnDelete"

	// NameLogKey is the log key for "name".
	NameLogKey = "name"

	// NamespaceLogKey is the log key for "namespace".
	NamespaceLogKey = "namespace"

	// AddonSecretNameLogKey is the log key for "addon-secret-name".
	AddonSecretNameLogKey = "addon-secret-name"

	// AddonSecretNamespaceLogKey is the log key for "addon-secret-ns"
	AddonSecretNamespaceLogKey = "addon-secret-ns" // nolint:gosec

	// AddonNameLogKey is the log key for "addon-name"
	AddonNameLogKey = "addon-name"

	// ImageNameLogKey is the log key for "image-name".
	ImageNameLogKey = "image-name"

	// ImageURLLogKey is the log key for "image-url".
	ImageURLLogKey = "image-url"

	// ComponentNameLogKey is the log key for "component-name".
	ComponentNameLogKey = "component-name"

	// KCPNameLogKey is the log key for "kcp-name"
	KCPNameLogKey = "kcp-name"

	// KCPNamespaceLogKey is the log key for "kcp-ns"
	KCPNamespaceLogKey = "kcp-ns"

	// TKRNameLogKey is the log key for "tkr-name"
	TKRNameLogKey = "tkr-name"

	// ClusterNameLogKey is the log key for "cluster-name"
	ClusterNameLogKey = "cluster-name"

	// ClusterNamespaceLogKey is the log key for "cluster-ns"
	ClusterNamespaceLogKey = "cluster-ns"

	// BOMNameLogKey is the log key for "bom-name"
	BOMNameLogKey = "bom-name"

	// BOMNamespaceLogKey is the log key for "bom-ns"
	BOMNamespaceLogKey = "bom-ns"

	// PackageRepositoryLogKey is the log key for "core-package-repository"
	PackageRepositoryLogKey = "core-package-repository"

	// AddonControllerName is name of addon-controller
	AddonControllerName = "addon-controller"

	// CRDWaitPollInterval is poll interval for checking server resources
	CRDWaitPollInterval = time.Second * 5

	// CRDWaitPollTimeout is poll timeout for checking server resources
	CRDWaitPollTimeout = time.Minute * 10

	// ClusterBootstrapNameLogKey is the log key for "ClusterBootstrapNameLogKey"
	ClusterBootstrapNameLogKey = "clusterbootstrap-name"

	// TKGSystemNS is the TKG system namespace.
	TKGSystemNS = "tkg-system"

	// TKGbomMetadataConfigmapName is the confimap of bom-metadata
	TKGbomMetadataConfigmapName = "bom-metadata"

	// DiscoveryCacheInvalidateInterval is the interval for invalidating cache
	DiscoveryCacheInvalidateInterval = time.Minute * 10

	// AntreaAddonName is the name of Antrea Addon Controller
	AntreaAddonName = "antrea"

	// AntreaDefaultRefName is default refname for Antrea addon
	AntreaDefaultRefName = AntreaAddonName + ".tanzu.vmware.com"

	// KappControllerAddonName is the addon name of Kapp Controller
	KappControllerAddonName = "kapp-controller"

	// KappControllerDefaultRefName is default refname for Kapp Controller addon
	KappControllerDefaultRefName = KappControllerAddonName + ".tanzu.vmware.com"

	// SecretNameLogKey is the log key for Secrets
	SecretNameLogKey = "secret-name"

	// ClusterBootstrapManagedSecret is the name for the secrets that are managed by ClusterBootstrapController
	ClusterBootstrapManagedSecret = "clusterbootstrap-secret"

	// DefaultIPFamilyClusterClassVarName is the default cluster variable name for ip family
	DefaultIPFamilyClusterClassVarName = "tkg.tanzu.vmware.com/tkg-ip-family"

	// PackageInstallServiceAccount is service account name used for PackageInstall
	PackageInstallServiceAccount = "tanzu-cluster-bootstrap-sa"

	// PackageInstallClusterRole is cluster role name used for PackageInstall
	PackageInstallClusterRole = "tanzu-cluster-bootstrap-clusterrole"

	// PackageInstallClusterRoleBinding is cluster role binding name used for PackageInstall
	PackageInstallClusterRoleBinding = "tanzu-cluster-bootstrap-clusterrolebinding"

	// PackageInstallSyncPeriod is the sync period for kapp-controller to periodically reconcile a PackageInstall
	PackageInstallSyncPeriod = time.Minute * 10

	// RequeueAfterDuration determines the duration after which the Controller should requeue the reconcile key
	RequeueAfterDuration = time.Second * 10

	// WebhookCertDir is the directory where the certificate and key are stored for webhook server TLS handshake
	WebhookCertDir = "/tmp/k8s-webhook-server/serving-certs"

	// WebhookCertManagementFrequency is how often the certificates for webhook server TLS are managed
	WebhookCertManagementFrequency = time.Minute * 60

	// WebhookCertLifeTime is how long the webhook server TLS certificates are good for
	WebhookCertLifeTime = time.Hour * 24 * 7

	// WebhookServiceName is the name of the k8s service that serves the admission requests
	WebhookServiceName = "tanzu-addons-manager-webhook-service"

	// WebhookScrtName is the name of secret that holds certificates and key for webhook service
	WebhookScrtName = "webhook-tls"

	// AddonWebhookLabelKey is the key for the label for addon admission webhooks
	AddonWebhookLabelKey = "tkg.tanzu.vmware.com/addon-webhooks"

	// AddonWebhookLabelValue is the value for the label for addon admission webhooks
	AddonWebhookLabelValue = "addon-webhooks"

	// LocalObjectRefSuffix is the suffix of a field within the provider's CR. This suffix indicates that the field is a
	// K8S typed local object reference
	LocalObjectRefSuffix = "LocalObjRef"

	// AddCBMissingFieldsAnnotationKey is the annotation key used by ClusterBootstrap webhook to implement its defaulting
	// logic
	AddCBMissingFieldsAnnotationKey = "tkg.tanzu.vmware.com/add-missing-fields-from-tkr"

	// UnmanagedCNI is the label for clusters that use unmanaged CNI
	UnmanagedCNI = "tkg.tanzu.vmware.com/unmanaged-cni"

	// VsphereAntreaConfigProviderServiceAccountAggregatedClusterRole is the name of ClusterRole created by controllers that use ProviderServiceAccount
	VsphereAntreaConfigProviderServiceAccountAggregatedClusterRole = "addons-vsphere-antreaConfig-providerserviceaccount-aggregatedrole"

	// VsphereCPIProviderServiceAccountAggregatedClusterRole is the name of ClusterRole created by controllers that use ProviderServiceAccount
	VsphereCPIProviderServiceAccountAggregatedClusterRole = "addons-vsphere-cpi-providerserviceaccount-aggregatedrole"

	// VsphereCSIProviderServiceAccountAggregatedClusterRole is the name of ClusterRole created by controllers that use ProviderServiceAccount
	VsphereCSIProviderServiceAccountAggregatedClusterRole = "addons-vsphere-csi-providerserviceaccount-aggregatedrole"

	// CAPVClusterRoleAggregationRuleLabelSelectorKey is the label selector key used by aggregation rule in CAPV ClusterRole
	CAPVClusterRoleAggregationRuleLabelSelectorKey = "capv.infrastucture.cluster.x-k8s.io/aggregate-to-manager"

	// CAPVClusterRoleAggregationRuleLabelSelectorValue is the label selector value used by aggregation rule in CAPV ClusterRole
	CAPVClusterRoleAggregationRuleLabelSelectorValue = "true"

	// PackageInstallStatusControllerRateLimitBaseDelay is the base delay for rate limiting error requeues in PackageInstallStatusController
	PackageInstallStatusControllerRateLimitBaseDelay = time.Second * 10

	// PackageInstallStatusControllerRateLimitMaxDelay is the maximum delay for rate limiting error requeues in PackageInstallStatusController
	PackageInstallStatusControllerRateLimitMaxDelay = time.Minute * 30

	// ClusterPauseLabel is the label on the Cluster Object to indicate the cluster is paused by TKG
	ClusterPauseLabel = "tkg.tanzu.vmware.com/paused"

	// CustomClusterBootstrap is the annotation in the cluster object to indicate that a custom ClusterBootstrap object will be provided
	CustomClusterBootstrap = "tkg.tanzu.vmware.com/custom-clusterbootstrap"

	// ManagementClusterRoleLabel is the management cluster role label
	// It indicates the cluster object represents a mgmt cluster
	ManagementClusterRoleLabel = "cluster-role.tkg.tanzu.vmware.com/management"

	// InfrastructureProviderVSphere is the key for vsphere infrastructure
	InfrastructureProviderVSphere = "vsphere"

	// InfrastructureProviderTkgs is the key for vsphere infrastructure with supervisor
	InfrastructureProviderTkgs = "tkgs"

	// InfrastructureProviderAWS is the key for aws infrastructure
	InfrastructureProviderAWS = "aws"

	// InfrastructureProviderAzure is the key for azure infrastructure
	InfrastructureProviderAzure = "azure"

	// InfrastructureProviderDocker is the key for docker infrastructure
	InfrastructureProviderDocker = "docker"

	// InfrastructureProviderOCI is the key for Oracle Cloud Infrastructure
	InfrastructureProviderOCI = "oci"

	// InfrastructureRefVSphere is the vSphere infrastructure
	InfrastructureRefVSphere = "VSphereCluster"

	// InfrastructureRefVSphereMachineTemplate is the vSphere infrastructure
	InfrastructureRefVSphereMachineTemplate = "VSphereMachineTemplate"

	// InfrastructureRefAWS is the AWS infrastructure
	InfrastructureRefAWS = "AWSCluster"

	// InfrastructureRefAzure is the Azure infrastructure
	InfrastructureRefAzure = "AzureCluster"

	// InfrastructureRefDocker is the docker infrastructure
	InfrastructureRefDocker = "DockerCluster"

	// InfrastructureRefOCI is the Oracle Cloud infrastructure
	InfrastructureRefOCI = "OCICluster"

	// CAPVClusterSelectorKey is the selector key used by capv
	CAPVClusterSelectorKey = "capv.vmware.com/cluster.name"

	// KindTanzuKubernetesCluster is the owner name of cluster
	KindTanzuKubernetesCluster = "TanzuKubernetesCluster"

	// SkipDeletePackageInstallAnnotation is the annotation that contains a list of comma separated packageInstalls to skip
	// for example
	// "run.tanzu.vmware.com/skip-packageinstall-deletion": "vsphere-cpi,antrea,load-balancer-and-ingress-service"
	SkipDeletePackageInstallAnnotation = "run.tanzu.vmware.com/skip-packageinstall-deletion"

	// TKGPlanAnnotation is the annotation that contains the cluster plan
	// for example
	// "tkg/plan": "dev"
	TKGPlanAnnotation = "tkg/plan"

	// TKGDevPlan is the tkg plan name, mean that that cluster is in a dev env
	TKGDevPlan = "dev"
	// TKGDevCCPan is the tkg plan name, mean that that cluster is in a dev env
	TKGDevCCPan = "devcc"

	TKRAnnotationKey = "run.tanzu.vmware.com/tkr-spec"
)

Variables

View Source
var (
	// ClusterKind is the Kind for cluster-api Cluster object
	ClusterKind = reflect.TypeOf(clusterapiv1beta1.Cluster{}).Name()

	// AntreaConfigKind is the Kind for cni AntreaConfig object
	AntreaConfigKind = reflect.TypeOf(cniv1alpha2.AntreaConfig{}).Name()

	// CalicoConfigKind is the Kind for cni CalicoConfig object
	CalicoConfigKind = reflect.TypeOf(cniv1alpha1.CalicoConfig{}).Name()

	// VSphereCSIConfigKind is the Kind for csi VSphereCSIConfig object
	VSphereCSIConfigKind = reflect.TypeOf(csiv1alpha1.VSphereCSIConfig{}).Name()

	// AzureFileCSIConfigKind is the Kind for csi AzureFileCSIConfig object
	AzureFileCSIConfigKind = reflect.TypeOf(csiv1alpha1.AzureFileCSIConfig{}).Name()

	// VSphereCPIConfigKind is the Kind for cpi VSphereCPIConfig object
	VSphereCPIConfigKind = reflect.TypeOf(cpiv1alpha1.VSphereCPIConfig{}).Name()

	// OracleCPIConfigKind is the Kind for cpi OracleCPIConfig object
	OracleCPIConfigKind = reflect.TypeOf(cpiv1alpha1.OracleCPIConfig{}).Name()

	// KappControllerConfigKind is the Kind for KappControllerConfig object
	KappControllerConfigKind = reflect.TypeOf(runv1alpha3.KappControllerConfig{}).Name()

	// AwsEbsCSIConfigKind is the Kind for csi AwsEbsCSIConfig object
	AwsEbsCSIConfigKind = reflect.TypeOf(csiv1alpha1.AwsEbsCSIConfig{}).Name()

	// KubevipCPIConfigKind is the Kind for KubevipCPIConfigConfig object
	KubevipCPIConfigKind = reflect.TypeOf(cpiv1alpha1.KubevipCPIConfig{}).Name()

	// AzureDiskCSIConfigKind is the Kind for AzureDiskCSIConfig object
	AzureDiskCSIConfigKind = reflect.TypeOf(csiv1alpha1.AzureDiskCSIConfig{}).Name()
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳