constants

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package constants provides TKG constants

Index

Constants

View Source
const (
	KindCluster                 = "Cluster"
	KindTanzuKubernetesCluster  = "TanzuKubernetesCluster"
	KindClusterClass            = "ClusterClass"
	ClusterClassFeature         = "vmware-system-tkg-clusterclass"
	TKCAPIFeature               = "vmware-system-tkg-tkc-api"
	TKGSClusterClassNamespace   = "vmware-system-tkg"
	TKGSTKCAPINamespace         = "vmware-system-tkg"
	TKGStkcapiNamespace         = "vmware-system-tkg"
	CorePackagesNamespaceInTKGS = "vmware-system-tkg"
	CorePackagesNamespaceInTKGM = "tkg-system"

	ErrorMsgFeatureGateNotActivated = "vSphere with Tanzu environment detected, however, the feature '%v' is not activated in '%v' namespace"
	ErrorMsgFeatureGateStatus       = "error while checking feature '%v' status in namespace '%v'"
	ErrorMsgClusterExistsAlready    = "cluster with name %s already exists, please specify another name"
	ErrorMsgClusterListError        = "unable to get list of workload clusters managed by current management cluster"

	ErrorMsgCClassInputFeatureFlagDisabled = "" /* 132-byte string literal not displayed */

	PacificGCMControllerDeployment = "vmware-system-tkg-controller-manager"
	PacificGCMControllerNamespace  = "vmware-system-tkg"
	// PacificClusterKind vsphere-pacific provider work load cluster kind
	PacificClusterKind              = "TanzuKubernetesCluster"
	PacificClusterListKind          = "TanzuKubernetesClusterList"
	DefaultPacificClusterAPIVersion = "run.tanzu.vmware.com/v1alpha2"

	CronJobKind    = "CronJob"
	CeipNamespace  = "tkg-system-telemetry"
	CeipAPIVersion = "batch/v1beta1"
	CeipJobName    = "tkg-telemetry"

	AntreaDeploymentName      = "antrea-controller"
	AntreaDeploymentNamespace = "kube-system"
	CalicoDeploymentName      = "calico-kube-controllers"
	CalicoDeploymentNamespace = "kube-system"

	TanzuRunAPIGroupPath = "/apis/run.tanzu.vmware.com"

	PinnipedSupervisorNameSpace              = "pinniped-supervisor"
	PinnipedFederationDomainObjectName       = "pinniped-federation-domain"
	PinnipedFederationDomainObjectKind       = "FederationDomain"
	PinnipedFederationDomainObjectAPIVersion = "config.supervisor.pinniped.dev/v1alpha1"
	PinnipedSupervisorDefaultTLSSecretName   = "pinniped-supervisor-default-tls-certificate" // #nosec

	TkgNamespace = "tkg-system"

	TkrNamespace       = "tkr-system"
	TkrConfigMapName   = "tkr-controller-config"
	TkgPublicNamespace = "tkg-system-public"
	TmcNamespace       = "vmware-system-tmc"

	KappControllerNamespace     = "tkg-system"
	KappControllerConfigMapName = "kapp-controller-config"

	AddonsManagerDeploymentName      = "tanzu-addons-controller-manager"
	KappControllerDeploymentName     = "kapp-controller"
	TkrControllerDeploymentName      = "tkr-controller-manager"
	KappControllerPackageName        = "kapp-controller"
	CoreManagementPluginsPackageName = "tanzu-core-management-plugins"

	AkoStatefulSetName       = "ako"
	AkoAddonName             = "load-balancer-and-ingress-service"
	AkoNamespace             = "avi-system"
	AkoCleanUpAnnotationKey  = "AviObjectDeletionStatus"
	AkoCleanUpFinishedStatus = "Done"

	ServiceDNSSuffix             = ".svc"
	ServiceDNSClusterLocalSuffix = ".svc.cluster.local"

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

	CAPVClusterSelectorKey = "capv.vmware.com/cluster.name"
)

cluster related constants used internally

View Source
const (
	PlanDev    = "dev"
	PlanProd   = "prod"
	PlanDevCC  = "devcc"
	PlanProdCC = "prodcc"
)

deployment plan constants

View Source
const (
	InfrastructureProviderVSphere = "vsphere"
	InfrastructureProviderTkgs    = "tkgs"
	InfrastructureProviderAWS     = "aws"
	InfrastructureProviderAzure   = "azure"
	InfrastructureProviderDocker  = "docker"
)

infrastructure provider name constants

View Source
const (
	VSphereMachineTemplate = "VSphereMachineTemplate"
	AWSMachineTemplate     = "AWSMachineTemplate"
	AzureMachineTemplate   = "AzureMachineTemplate"
	DockerMachineTemplate  = "DockerMachineTemplate"
)

machine template name constants

View Source
const (
	// InfrastructureRefVSphere is the vSphere infrastructure
	InfrastructureRefVSphere = "VSphereCluster"
	// InfrastructureRefAWS is the AWS infrastructure
	InfrastructureRefAWS = "AWSCluster"
	// InfrastructureRefAzure is the Azure infrastructure
	InfrastructureRefAzure = "AzureCluster"
	// InfrastructureRefDocker is the docker infrastructure
	InfrastructureRefDocker = "DockerCluster"
)
View Source
const (
	IPv4Family                 = "ipv4"
	IPv6Family                 = "ipv6"
	DualStackPrimaryIPv4Family = "ipv4,ipv6"
	DualStackPrimaryIPv6Family = "ipv6,ipv4"

	LocalHost     = "localhost"
	LocalHostIP   = "127.0.0.1"
	LocalHostIPv6 = "::1"

	LinkLocalAddress = "169.254.0.0/16"
	AzurePublicVIP   = "168.63.129.16"
)

networking constants

View Source
const (
	// AddonSecretType is the add on Secret type
	AddonSecretType = "tkg.tanzu.vmware.com/addon" // nolint:gosec
	// AddonNameLabel is the label on the Secret to indicate the name of addon to be installed
	AddonNameLabel = "tkg.tanzu.vmware.com/addon-name"
	// ClusterNameLabel is the label on the Secret to indicate the cluster on which addon is to be installed
	ClusterNameLabel = "tkg.tanzu.vmware.com/cluster-name"
	// ClusterPauseLabel is the label on the Cluster Object to indicate the cluster is paused by TKG
	ClusterPauseLabel = "tkg.tanzu.vmware.com/paused"
	// PackageTypeLabel is the label on the PackageInstall which mentions type of the package
	PackageTypeLabel = "tkg.tanzu.vmware.com/package-type"
	// CLIPluginImageRepositoryOverrideLabel is the label on the configmap which specifies CLIPlugin image repository override
	CLIPluginImageRepositoryOverrideLabel = "cli.tanzu.vmware.com/cliplugin-image-repository-override"
)

addons related constants

View Source
const (
	TKGManagementPackageName           = "tkg.tanzu.vmware.com"
	TKGManagementPackageInstallName    = "tkg-pkg"
	TKGManagementPackageRepositoryName = "tanzu-management"
	PackageTypeManagement              = "management"
)

TKG management package related constants

View Source
const (
	RegexpMachineDeploymentsOverrides = `spec.topology.workers.machineDeployments.[0-9].variables.overrides`
	RegexpTopologyClassValue          = `tkg-(aws|azure|vsphere)-default`

	TopologyVariablesNetworkSubnets   = "spec.topology.variables.network.subnets"
	TopologyVariablesNodes            = "spec.topology.variables.nodes"
	TopologyVariablesTrust            = "spec.topology.variables.trust"
	TopologyWorkersMachineDeployments = "spec.topology.workers.machineDeployments"
	TopologyClass                     = "spec.topology.class"
	TopologyVariables                 = "spec.topology.variables"

	TopologyWorkersMachineDeploymentsClass0         = "spec.topology.workers.machineDeployments.0.class"
	TopologyWorkersMachineDeploymentsName0          = "spec.topology.workers.machineDeployments.0.name"
	TopologyWorkersMachineDeploymentsReplicas0      = "spec.topology.workers.machineDeployments.0.replicas"
	TopologyWorkersMachineDeploymentsFailureDomain0 = "spec.topology.workers.machineDeployments.0.failureDomain"

	TopologyWorkersMachineDeploymentsClass1         = "spec.topology.workers.machineDeployments.1.class"
	TopologyWorkersMachineDeploymentsName1          = "spec.topology.workers.machineDeployments.1.name"
	TopologyWorkersMachineDeploymentsReplicas1      = "spec.topology.workers.machineDeployments.1.replicas"
	TopologyWorkersMachineDeploymentsFailureDomain1 = "spec.topology.workers.machineDeployments.1.failureDomain"

	TopologyWorkersMachineDeploymentsClass2         = "spec.topology.workers.machineDeployments.2.class"
	TopologyWorkersMachineDeploymentsName2          = "spec.topology.workers.machineDeployments.2.name"
	TopologyWorkersMachineDeploymentsReplicas2      = "spec.topology.workers.machineDeployments.2.replicas"
	TopologyWorkersMachineDeploymentsFailureDomain2 = "spec.topology.workers.machineDeployments.2.failureDomain"

	SPEC = "spec"

	TopologyClassIncorrectValueErrMsg            = "cluster class missing in configuration or not following naming convention"
	ClusterResourceAsInputFileNotSupportedErrMsg = "input file with Cluster resource definition is not supported"
)

Cluster class variables constants

View Source
const (
	// OverrideFolderKey key for overrides folder to override the default overrides directory($HOME/.cluster-api/overrides)
	OverrideFolderKey          = "overridesFolder"
	ImagesConfigKey            = "images"
	ReleaseKey                 = "release"
	ProvidersConfigKey         = "providers"
	CertManagerConfigKey       = "cert-manager"
	InfrastructureProviderType = "InfrastructureProvider"

	KeyTkg                  = "tkg"
	KeyRegions              = "regions"
	KeyRegionName           = "name"
	KeyCurrentRegionContext = "current-region-context"
	KeyRegionContext        = "context"

	KeyCertManagerTimeout = "cert-manager-timeout"
)

config key name constants

View Source
const (
	ConfigVariableDefaultBomFile                      = "TKG_DEFAULT_BOM"
	ConfigVariableCustomImageRepository               = "TKG_CUSTOM_IMAGE_REPOSITORY"
	ConfigVariableDevImageRepository                  = "TKG_DEV_IMAGE_REPOSITORY"
	ConfigVariableCompatibilityCustomImagePath        = "TKG_CUSTOM_COMPATIBILITY_IMAGE_PATH"
	ConfigVariableCustomImageRepositorySkipTLSVerify  = "TKG_CUSTOM_IMAGE_REPOSITORY_SKIP_TLS_VERIFY"
	ConfigVariableCustomImageRepositoryCaCertificate  = "TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE"
	ConfigVariableDefaultStandaloneDiscoveryImagePath = "TKG_DEFAULT_STANDALONE_DISCOVERY_IMAGE_PATH"
	ConfigVariableDefaultStandaloneDiscoveryImageTag  = "TKG_DEFAULT_STANDALONE_DISCOVERY_IMAGE_TAG"
	ConfigVariableDefaultStandaloneDiscoveryType      = "TKG_DEFAULT_STANDALONE_DISCOVERY_TYPE"
	ConfigVariableDefaultStandaloneDiscoveryLocalPath = "TKG_DEFAULT_STANDALONE_DISCOVERY_LOCAL_PATH"
	ConfigVariableClusterAPIServerPort                = "CLUSTER_API_SERVER_PORT"
	ConfigVariableBastionHostEnabled                  = "BASTION_HOST_ENABLED"
	ConfigVariableVipNetworkInterface                 = "VIP_NETWORK_INTERFACE"

	ConfigVariableAWSRegion          = "AWS_REGION"
	ConfigVariableAWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY" //nolint:gosec
	ConfigVariableAWSAccessKeyID     = "AWS_ACCESS_KEY_ID"     //nolint:gosec
	ConfigVariableAWSSessionToken    = "AWS_SESSION_TOKEN"     //nolint:gosec
	ConfigVariableAWSProfile         = "AWS_PROFILE"
	ConfigVariableAWSB64Credentials  = "AWS_B64ENCODED_CREDENTIALS" //nolint:gosec
	ConfigVariableAWSVPCID           = "AWS_VPC_ID"
	ConfigVariableAWSSSHKeyName      = "AWS_SSH_KEY_NAME"

	ConfigVariableAWSPublicNodeCIDR             = "AWS_PUBLIC_NODE_CIDR"
	ConfigVariableAWSPrivateNodeCIDR            = "AWS_PRIVATE_NODE_CIDR"
	ConfigVariableAWSPublicNodeCIDR1            = "AWS_PUBLIC_NODE_CIDR_1"
	ConfigVariableAWSPrivateNodeCIDR1           = "AWS_PRIVATE_NODE_CIDR_1"
	ConfigVariableAWSPublicNodeCIDR2            = "AWS_PUBLIC_NODE_CIDR_2"
	ConfigVariableAWSPrivateNodeCIDR2           = "AWS_PRIVATE_NODE_CIDR_2"
	ConfigVariableAWSPublicSubnetID             = "AWS_PUBLIC_SUBNET_ID"
	ConfigVariableAWSPrivateSubnetID            = "AWS_PRIVATE_SUBNET_ID"
	ConfigVariableAWSPublicSubnetID1            = "AWS_PUBLIC_SUBNET_ID_1"
	ConfigVariableAWSPrivateSubnetID1           = "AWS_PRIVATE_SUBNET_ID_1"
	ConfigVariableAWSPublicSubnetID2            = "AWS_PUBLIC_SUBNET_ID_2"
	ConfigVariableAWSPrivateSubnetID2           = "AWS_PRIVATE_SUBNET_ID_2"
	ConfigVariableAWSVPCCIDR                    = "AWS_VPC_CIDR"
	ConfigVariableAWSNodeAz                     = "AWS_NODE_AZ"
	ConfigVariableAWSNodeAz1                    = "AWS_NODE_AZ_1"
	ConfigVariableAWSNodeAz2                    = "AWS_NODE_AZ_2"
	ConfigVariableAWSAMIID                      = "AWS_AMI_ID"
	ConfigVariableAWSLoadBalancerSchemeInternal = "AWS_LOAD_BALANCER_SCHEME_INTERNAL"
	ConfigVariableAWSNodeOsDiskSizeGib          = "AWS_NODE_OS_DISK_SIZE_GIB"

	ConfigVariableAWSIdentityRefKind           = "AWS_IDENTITY_REF_KIND"
	ConfigVariableAWSIdentityRefName           = "AWS_IDENTITY_REF_NAME"
	ConfigVariableAWSSecurityGroupNode         = "AWS_SECURITY_GROUP_NODE"
	ConfigVariableAWSSecurityGroupApiserverLb  = "AWS_SECURITY_GROUP_APISERVER_LB"
	ConfigVariableAWSSecurityGroupBastion      = "AWS_SECURITY_GROUP_BASTION"
	ConfigVariableAWSSecurityGroupControlplane = "AWS_SECURITY_GROUP_CONTROLPLANE"
	ConfigVariableAWSSecurityGroupLb           = "AWS_SECURITY_GROUP_LB"
	ConfigVariableAWSControlplaneOsDiskSizeGib = "AWS_CONTROL_PLANE_OS_DISK_SIZE_GIB"

	ConfigVariableVsphereAz0                       = "VSPHERE_AZ_0"
	ConfigVariableVsphereAz1                       = "VSPHERE_AZ_1"
	ConfigVariableVsphereAz2                       = "VSPHERE_AZ_2"
	ConfigVariableVsphereCloneMode                 = "VSPHERE_CLONE_MODE"
	ConfigVariableVsphereControlPlaneEndpoint      = "VSPHERE_CONTROL_PLANE_ENDPOINT"
	ConfigVariableVsphereServer                    = "VSPHERE_SERVER"
	ConfigVariableVsphereUsername                  = "VSPHERE_USERNAME"
	ConfigVariableVspherePassword                  = "VSPHERE_PASSWORD"
	ConfigVariableVsphereTLSThumbprint             = "VSPHERE_TLS_THUMBPRINT"
	ConfigVariableVsphereSSHAuthorizedKey          = "VSPHERE_SSH_AUTHORIZED_KEY"
	ConfigVariableVsphereTemplate                  = "VSPHERE_TEMPLATE"
	ConfigVariableVsphereTemplateMoid              = "VSPHERE_TEMPLATE_MOID"
	ConfigVariableVsphereDatacenter                = "VSPHERE_DATACENTER"
	ConfigVariableVsphereResourcePool              = "VSPHERE_RESOURCE_POOL"
	ConfigVariableVsphereStoragePolicyID           = "VSPHERE_STORAGE_POLICY_ID"
	ConfigVariableVsphereDatastore                 = "VSPHERE_DATASTORE"
	ConfigVariableVsphereFolder                    = "VSPHERE_FOLDER"
	ConfigVariableVsphereWorkerpciDevices          = "VSPHERE_WORKER_PCI_DEVICES"
	ConfigVariableVsphereControlPlanepciDevices    = "VSPHERE_CONTROL_PLANE_PCI_DEVICES"
	ConfigVariableVsphereControlPlaneCustomVMXKeys = "VSPHERE_CONTROL_PLANE_CUSTOM_VMX_KEYS"
	ConfigVariableVsphereWorkerCustomVMXKeys       = "VSPHERE_WORKER_CUSTOM_VMX_KEYS"
	ConfigVariableVsphereIgnorepciDevicesAllowList = "VSPHERE_IGNORE_PCI_DEVICES_ALLOW_LIST"
	ConfigVariableVsphereWorkerRolloutStrategy     = "WORKER_ROLLOUT_STRATEGY"
	ConfigVariableVsphereNumCpus                   = "VSPHERE_NUM_CPUS"
	ConfigVariableVsphereMemMib                    = "VSPHERE_MEM_MIB"
	ConfigVariableVsphereDiskGib                   = "VSPHERE_DISK_GIB"
	ConfigVariableVsphereWorkerNumCpus             = "VSPHERE_WORKER_NUM_CPUS"
	ConfigVariableVsphereWorkerMemMib              = "VSPHERE_WORKER_MEM_MIB"
	ConfigVariableVsphereWorkerDiskGib             = "VSPHERE_WORKER_DISK_GIB"
	ConfigVariableVsphereCPNumCpus                 = "VSPHERE_CONTROL_PLANE_NUM_CPUS"
	ConfigVariableVsphereCPMemMib                  = "VSPHERE_CONTROL_PLANE_MEM_MIB"
	ConfigVariableVsphereCPDiskGib                 = "VSPHERE_CONTROL_PLANE_DISK_GIB"
	ConfigVariableVsphereInsecure                  = "VSPHERE_INSECURE" // VCInsecure decides if the vc connection will skip the ssl validation or not.
	ConfigVariableVsphereVersion                   = "VSPHERE_VERSION"
	ConfigVariableVsphereNetwork                   = "VSPHERE_NETWORK"
	ConfigVariableVsphereHaProvider                = "AVI_CONTROL_PLANE_HA_PROVIDER"

	ConfigVariableAzureControlPlaneSubnet                    = "AZURE_CONTROL_PLANE_SUBNET_NAME"
	ConfigVariableAzureControlPlaneSubnetName                = "AZURE_CONTROL_PLANE_SUBNET_NAME"
	ConfigVariableAzureControlPlaneSubnetCidr                = "AZURE_CONTROL_PLANE_SUBNET_CIDR"
	ConfigVariableAzureCPMachineType                         = "AZURE_CONTROL_PLANE_MACHINE_TYPE"
	ConfigVariableAzureControlPlaneDataDiskSizeGib           = "AZURE_CONTROL_PLANE_DATA_DISK_SIZE_GIB"
	ConfigVariableAzureControlPlaneOsDiskStorageAccountType  = "AZURE_CONTROL_PLANE_OS_DISK_STORAGE_ACCOUNT_TYPE"
	ConfigVariableAzureControlPlaneOsDiskSizeGib             = "AZURE_CONTROL_PLANE_OS_DISK_SIZE_GIB"
	ConfigVariableAzureControlPlaneOutboundLbFrontendIPCount = "AZURE_CONTROL_PLANE_OUTBOUND_LB_FRONTEND_IP_COUNT"
	ConfigVariableAzureControlPlaneOutboundLb                = "AZURE_ENABLE_CONTROL_PLANE_OUTBOUND_LB"
	ConfigVariableAzureControlPlaneSubnetSecurityGroup       = "AZURE_CONTROL_PLANE_SUBNET_SECURITY_GROUP"

	ConfigVariableAzureCustomTags                  = "AZURE_CUSTOM_TAGS"
	ConfigVariableAzureEnableAcceleratedNetworking = "AZURE_ENABLE_ACCELERATED_NETWORKING"
	ConfigVariableAzureEnablePrivateCluster        = "AZURE_ENABLE_PRIVATE_CLUSTER"
	ConfigVariableAzureFrontendPrivateIP           = "AZURE_FRONTEND_PRIVATE_IP"
	ConfigVariableAzureLocation                    = "AZURE_LOCATION"
	ConfigVariableAzureIdentityName                = "AZURE_IDENTITY_NAME"
	ConfigVariableAzureIdentityNamespace           = "AZURE_IDENTITY_NAMESPACE"
	ConfigVariableAzureImageID                     = "AZURE_IMAGE_ID"
	ConfigVariableAzureImagePublisher              = "AZURE_IMAGE_PUBLISHER"
	ConfigVariableAzureImageOffer                  = "AZURE_IMAGE_OFFER"
	ConfigVariableAzureImageSku                    = "AZURE_IMAGE_SKU"
	ConfigVariableAzureImageVersion                = "AZURE_IMAGE_VERSION"
	ConfigVariableAzureImageThirdParty             = "AZURE_IMAGE_THIRD_PARTY"
	ConfigVariableAzureImageResourceGroup          = "AZURE_IMAGE_RESOURCE_GROUP"
	ConfigVariableAzureImageName                   = "AZURE_IMAGE_NAME"
	ConfigVariableAzureImageSubscriptionID         = "AZURE_IMAGE_SUBSCRIPTION_ID"
	ConfigVariableAzureImageGallery                = "AZURE_IMAGE_GALLERY"
	ConfigVariableAzureSubscriptionIDB64           = "AZURE_SUBSCRIPTION_ID_B64"
	ConfigVariableAzureTenantIDB64                 = "AZURE_TENANT_ID_B64"
	ConfigVariableAzureClientSecretB64             = "AZURE_CLIENT_SECRET_B64" //nolint:gosec
	ConfigVariableAzureClientIDB64                 = "AZURE_CLIENT_ID_B64"
	ConfigVariableAzureSubscriptionID              = "AZURE_SUBSCRIPTION_ID"
	ConfigVariableAzureTenantID                    = "AZURE_TENANT_ID"
	ConfigVariableAzureClientSecret                = "AZURE_CLIENT_SECRET" //nolint:gosec
	ConfigVariableAzureClientID                    = "AZURE_CLIENT_ID"
	ConfigVariableAzureResourceGroup               = "AZURE_RESOURCE_GROUP"
	ConfigVariableAzureVnetName                    = "AZURE_VNET_NAME"
	ConfigVariableAzureVnetResourceGroup           = "AZURE_VNET_RESOURCE_GROUP"
	ConfigVariableAzureVnetCidr                    = "AZURE_VNET_CIDR"

	ConfigVariableAzureWorkerSubnet                       = "AZURE_NODE_SUBNET_NAME"
	ConfigVariableAzureWorkerSubnetName                   = "AZURE_NODE_SUBNET_NAME"
	ConfigVariableAzureAZ                                 = "AZURE_NODE_AZ"
	ConfigVariableAzureAZ1                                = "AZURE_NODE_AZ_1"
	ConfigVariableAzureAZ2                                = "AZURE_NODE_AZ_2"
	ConfigVariableAzureNodeOsDiskSizeGib                  = "AZURE_NODE_OS_DISK_SIZE_GIB"
	ConfigVariableAzureNodeOsDiskStorageAccountType       = "AZURE_NODE_OS_DISK_STORAGE_ACCOUNT_TYPE"
	ConfigVariableAzureEnableNodeDataDisk                 = "AZURE_ENABLE_NODE_DATA_DISK"
	ConfigVariableAzureNodeDataDiskSizeGib                = "AZURE_NODE_DATA_DISK_SIZE_GIB"
	ConfigVariableAzureNodeSubnetSecurityGroup            = "AZURE_NODE_SUBNET_SECURITY_GROUP"
	ConfigVariableAzureEnableNodeOutboundLb               = "AZURE_ENABLE_NODE_OUTBOUND_LB"
	ConfigVariableAzureNodeOutboundLbFrontendIPCount      = "AZURE_NODE_OUTBOUND_LB_FRONTEND_IP_COUNT"
	ConfigVariableAzureNodeOutboundLbIdleTimeoutInMinutes = "AZURE_NODE_OUTBOUND_LB_IDLE_TIMEOUT_IN_MINUTES"
	ConfigVariableAzureWorkerNodeSubnetCidr               = "AZURE_NODE_SUBNET_CIDR"
	ConfigVariableAzureSSHPublicKeyB64                    = "AZURE_SSH_PUBLIC_KEY_B64"
	ConfigVariableAzureNodeMachineType                    = "AZURE_NODE_MACHINE_TYPE"
	ConfigVariableAzureEnvironment                        = "AZURE_ENVIRONMENT"

	ConfigVariableDockerMachineTemplateImage = "DOCKER_MACHINE_TEMPLATE_IMAGE"

	ConfigVariablePinnipedSupervisorIssuerURL          = "SUPERVISOR_ISSUER_URL"
	ConfigVariablePinnipedSupervisorIssuerCABundleData = "SUPERVISOR_ISSUER_CA_BUNDLE_DATA_B64"

	ConfigVariableClusterRole                = "TKG_CLUSTER_ROLE"
	ConfigVariableForceRole                  = "_TKG_CLUSTER_FORCE_ROLE"
	ConfigVariableProviderType               = "PROVIDER_TYPE"
	ConfigVariableTKGVersion                 = "TKG_VERSION"
	ConfigVariableBuildEdition               = "BUILD_EDITION"
	ConfigVariableFilterByAddonType          = "FILTER_BY_ADDON_TYPE"
	ConfigVaraibleDisableCRSForAddonType     = "DISABLE_CRS_FOR_ADDON_TYPE"
	ConfigVariableEnableAutoscaler           = "ENABLE_AUTOSCALER"
	ConfigVariableDisableTMCCloudPermissions = "DISABLE_TMC_CLOUD_PERMISSIONS"

	ConfigVariableControlPlaneMachineCount = "CONTROL_PLANE_MACHINE_COUNT"
	ConfigVariableControlPlaneMachineType  = "CONTROL_PLANE_MACHINE_TYPE"

	ConfigVariableWorkerMachineCount  = "WORKER_MACHINE_COUNT"
	ConfigVariableWorkerMachineCount0 = "WORKER_MACHINE_COUNT_0"
	ConfigVariableWorkerMachineCount1 = "WORKER_MACHINE_COUNT_1"
	ConfigVariableWorkerMachineCount2 = "WORKER_MACHINE_COUNT_2"
	ConfigVariableNodeMachineType     = "NODE_MACHINE_TYPE"
	ConfigVariableNodeMachineType1    = "NODE_MACHINE_TYPE_1"
	ConfigVariableNodeMachineType2    = "NODE_MACHINE_TYPE_2"
	ConfigVariableCPMachineType       = "CONTROL_PLANE_MACHINE_TYPE"

	ConfigVariableNamespace            = "NAMESPACE"
	ConfigVariableEnableClusterOptions = "ENABLE_CLUSTER_OPTIONS"

	TKGHTTPProxy        = "TKG_HTTP_PROXY"
	TKGHTTPSProxy       = "TKG_HTTPS_PROXY"
	TKGHTTPProxyEnabled = "TKG_HTTP_PROXY_ENABLED"
	TKGNoProxy          = "TKG_NO_PROXY"
	TKGProxyCACert      = "TKG_PROXY_CA_CERT"
	EnableAuditLogging  = "ENABLE_AUDIT_LOGGING"
	TKGIPFamily         = "TKG_IP_FAMILY"

	ConfigVariableOSName    = "OS_NAME"
	ConfigVariableOSVersion = "OS_VERSION"
	ConfigVariableOSArch    = "OS_ARCH"

	ConfigVariableClusterCIDR = "CLUSTER_CIDR"
	ConfigVariableServiceCIDR = "SERVICE_CIDR"

	ConfigVariableCoreDNSIP = "CORE_DNS_IP"

	ConfigVariableIPFamily = "TKG_IP_FAMILY"
	TKGIPV6Primary         = "TKG_IPV6_PRIMARY"

	ConfigVariableControlPlaneNodeNameservers = "CONTROL_PLANE_NODE_NAMESERVERS"
	ConfigVariableWorkerNodeNameservers       = "WORKER_NODE_NAMESERVERS"

	ConfigVariableClusterPlan             = "CLUSTER_PLAN"
	ConfigVariableClusterName             = "CLUSTER_NAME"
	ConfigVariableClusterClass            = "CLUSTER_CLASS"
	ConfigVariableInfraProvider           = "INFRASTRUCTURE_PROVIDER"
	ConfigVariableTkrName                 = "KUBERNETES_RELEASE"
	ConfigVariableKubernetesVersion       = "KUBERNETES_VERSION"
	ConfigVariableCNI                     = "CNI"
	ConfigVariableEnableCEIPParticipation = "ENABLE_CEIP_PARTICIPATION"
	ConfigVariableDeployTKGOnVsphere7     = "DEPLOY_TKG_ON_VSPHERE7"
	ConfigVariableEnableTKGSonVsphere7    = "ENABLE_TKGS_ON_VSPHERE7"
	ConfigVariableSize                    = "SIZE"
	ConfigVariableControlPlaneSize        = "CONTROLPLANE_SIZE"
	ConfigVariableWorkerSize              = "WORKER_SIZE"

	ConfigVariableNsxtPassword                     = "NSXT_PASSWORD"
	ConfigVariableAviPassword                      = "AVI_PASSWORD"
	ConfigVariableLDAPBindPassword                 = "LDAP_BIND_PASSWORD"                   //nolint:gosec
	ConfigVariableOIDCIdentiryProviderClientSecret = "OIDC_IDENTITY_PROVIDER_CLIENT_SECRET" //nolint:gosec

	// Config variables for image tags used for provider installation
	ConfigVariableInternalKubeRBACProxyImageTag   = "KUBE_RBAC_PROXY_IMAGE_TAG"
	ConfigVariableInternalCABPKControllerImageTag = "CABPK_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalCAPIControllerImageTag  = "CAPI_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalKCPControllerImageTag   = "KCP_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalCAPDManagerImageTag     = "CAPD_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalCAPAManagerImageTag     = "CAPA_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalCAPVManagerImageTag     = "CAPV_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalCAPZManagerImageTag     = "CAPZ_CONTROLLER_IMAGE_TAG"
	ConfigVariableInternalNMIImageTag             = "NMI_IMAGE_TAG"

	// Other variables related to provider installation
	ConfigVariableClusterTopology = "CLUSTER_TOPOLOGY"

	ConfigVariablePackageInstallTimeout = "PACKAGE_INSTALL_TIMEOUT"

	// Windows specific variables
	ConfigVariableIsWindowsWorkloadCluster = "IS_WINDOWS_WORKLOAD_CLUSTER"

	// AVI aka. NSX Advanced Load Balancer specific variables
	ConfigVariableAviEnable = "AVI_ENABLE"

	ConfigVariableAviControllerAddress  = "AVI_CONTROLLER"
	ConfigVariableAviControllerVersion  = "AVI_CONTROLLER_VERSION"
	ConfigVariableAviControllerUsername = "AVI_USERNAME"
	ConfigVariableAviControllerPassword = "AVI_PASSWORD"
	ConfigVariableAviControllerCA       = "AVI_CA_DATA_B64"

	ConfigVariableAviCloudName                           = "AVI_CLOUD_NAME"
	ConfigVariableAviServiceEngineGroup                  = "AVI_SERVICE_ENGINE_GROUP"
	ConfigVariableAviManagementClusterServiceEngineGroup = "AVI_MANAGEMENT_CLUSTER_SERVICE_ENGINE_GROUP"

	ConfigVariableAviDataPlaneNetworkName    = "AVI_DATA_NETWORK"
	ConfigVariableAviDataPlaneNetworkCIDR    = "AVI_DATA_NETWORK_CIDR"
	ConfigVariableAviControlPlaneNetworkName = "AVI_CONTROL_PLANE_NETWORK"
	ConfigVariableAviControlPlaneNetworkCIDR = "AVI_CONTROL_PLANE_NETWORK_CIDR"

	ConfigVariableAviManagementClusterDataPlaneNetworkName       = "AVI_MANAGEMENT_CLUSTER_VIP_NETWORK_NAME"
	ConfigVariableAviManagementClusterDataPlaneNetworkCIDR       = "AVI_MANAGEMENT_CLUSTER_VIP_NETWORK_CIDR"
	ConfigVariableAviManagementClusterControlPlaneVipNetworkName = "AVI_MANAGEMENT_CLUSTER_CONTROL_PLANE_VIP_NETWORK_NAME"
	ConfigVariableAviManagementClusterControlPlaneVipNetworkCIDR = "AVI_MANAGEMENT_CLUSTER_CONTROL_PLANE_VIP_NETWORK_CIDR"

	ConfigVariableFeatureFlagPackageBasedLCM = "FEATURE_FLAG_PACKAGE_BASED_LCM"
)

Configuration variable name constants

View Source
const (
	DefaultCNIType = "antrea"

	DefaultDevControlPlaneMachineCount  = 1
	DefaultProdControlPlaneMachineCount = 3
	DefaultDevWorkerMachineCount        = 1
	DefaultProdWorkerMachineCount       = 3

	DefaultOperationTimeout            = 30 * time.Second
	DefaultLongRunningOperationTimeout = 30 * time.Minute

	DefaultCertmanagerDeploymentTimeout = 40 * time.Minute

	DefaultNamespace = "default"

	// de-facto defaults initially chosen by kops: https://github.com/kubernetes/kops
	DefaultIPv4ClusterCIDR = "100.96.0.0/11"
	DefaultIPv4ServiceCIDR = "100.64.0.0/13"

	// chosen to match our IPv4 defaults
	// use /48 for cluster CIDR because each node gets a /64 by default in IPv6
	DefaultIPv6ClusterCIDR = "fd00:100:96::/48"
	// use /108 is the max allowed for IPv6
	DefaultIPv6ServiceCIDR = "fd00:100:64::/108"

	// dual stack IPv4,IPv6 defaults
	DefaultDualStackPrimaryIPv4ClusterCIDR = DefaultIPv4ClusterCIDR + "," + DefaultIPv6ClusterCIDR
	DefaultDualStackPrimaryIPv4ServiceCIDR = DefaultIPv4ServiceCIDR + "," + DefaultIPv6ServiceCIDR

	DefaultDualStackPrimaryIPv6ClusterCIDR = DefaultIPv6ClusterCIDR + "," + DefaultIPv4ClusterCIDR
	DefaultDualStackPrimaryIPv6ServiceCIDR = DefaultIPv6ServiceCIDR + "," + DefaultIPv4ServiceCIDR
	// DefaultIsWindowsWorkloadCluster is false, indicating that the normal thing to do is, is to make linux clusters.
	DefaultIsWindowsWorkloadCluster = false

	// Default maximum query per second for the rest config
	DefaultQPS = 200
	// Default maximum burst for throttle for the rest config
	DefaultBurst = 200
)

default value constants

View Source
const (
	NoProxy     = "NO_PROXY"
	HTTPProxy   = "HTTP_PROXY"
	HTTPSProxy  = "HTTPS_PROXY"
	ProxyCACert = "PROXY_CA_CERT"
)

environment variables for http proxy

View Source
const (
	ConfigFilePermissions       = 0o600
	DefaultDirectoryPermissions = 0o700
)

ConfigFilePermissions defines the permissions of the config file

View Source
const (
	LocalProvidersFolderName  = "providers"
	LocalProvidersZipFileName = "providers.zip"
	LocalTanzuFileLock        = ".tanzu.lock"

	LocalProvidersConfigFileName = "config.yaml"
	LocalBOMsFolderName          = "bom"
	LocalCompatibilityFolderName = "compatibility"

	LocalProvidersChecksumFileName = "providers.sha256sum"
	OverrideFolder                 = "overrides"

	TKGKubeconfigDir    = ".kube-tkg"
	TKGKubeconfigFile   = "config"
	TKGKubeconfigTmpDir = "tmp"

	TKGConfigFileName               = "config.yaml"
	TKGDefaultClusterConfigFileName = "cluster-config.yaml"
	TKGCompatibilityFileName        = "tkg-compatibility.yaml"
	TKGConfigDefaultFileName        = "config_default.yaml"

	TKGClusterConfigFileDirForUI           = "clusterconfigs"
	TKGRegistryCertFile                    = "registry_certs"
	TKGRegistryTrustedRootCAFileForWindows = ".registry_trusted_root_certs_win"

	LogFolderName = "logs"

	TKGPackageValuesFile = "tkgpackagevalues.yaml"
	TKGPackageValues     = "tkg-package-values"
)

File name related constants

View Source
const (
	AllowedRegistries = "ALLOWED_REGISTRY"
)
View Source
const AviControllerVersionRegex = `^\d+(\.\d+)*$`

Avi aka. NSX Advanced LoadBalancer version regex expression

View Source
const (
	SuppressProvidersUpdate = "SUPPRESS_PROVIDERS_UPDATE"
)

environment variables for internal development use

View Source
const (
	TKGRegistryContains = "registry.vmware.com/tkg"
)

registry related constants

View Source
const (
	TanzuCLISystemNamespace = "tanzu-cli-system"
)

Variables

View Source
var ClusterAttributesHigherPrecedenceToLowerMap = map[string]string{
	"spec.topology.workers.machineDeployments.1.variables.overrides.NODE_MACHINE_TYPE": "spec.topology.variables.nodes.1.machineType",
	"spec.topology.workers.machineDeployments.2.variables.overrides.NODE_MACHINE_TYPE": "spec.topology.variables.nodes.2.machineType",
}
View Source
var ClusterAttributesToLegacyVariablesMapAws = map[string]string{

	"spec.topology.variables.region":     ConfigVariableAWSRegion,
	"spec.topology.variables.sshKeyName": ConfigVariableAWSSSHKeyName,

	"spec.topology.variables.loadBalancerSchemeInternal": ConfigVariableAWSLoadBalancerSchemeInternal,

	"spec.topology.variables.network.subnets.0.az":           ConfigVariableAWSNodeAz,
	"spec.topology.variables.network.subnets.0.private.cidr": ConfigVariableAWSPrivateNodeCIDR,
	"spec.topology.variables.network.subnets.0.private.id":   ConfigVariableAWSPrivateSubnetID,
	"spec.topology.variables.network.subnets.0.public.cidr":  ConfigVariableAWSPublicNodeCIDR,
	"spec.topology.variables.network.subnets.0.public.id":    ConfigVariableAWSPublicSubnetID,
	"spec.topology.variables.network.subnets.1.az":           ConfigVariableAWSNodeAz1,
	"spec.topology.variables.network.subnets.1.private.cidr": ConfigVariableAWSPrivateNodeCIDR1,
	"spec.topology.variables.network.subnets.1.private.id":   ConfigVariableAWSPrivateSubnetID1,
	"spec.topology.variables.network.subnets.1.public.cidr":  ConfigVariableAWSPublicNodeCIDR1,
	"spec.topology.variables.network.subnets.1.public.id":    ConfigVariableAWSPublicSubnetID1,
	"spec.topology.variables.network.subnets.2.az":           ConfigVariableAWSNodeAz2,
	"spec.topology.variables.network.subnets.2.private.cidr": ConfigVariableAWSPrivateNodeCIDR2,
	"spec.topology.variables.network.subnets.2.private.id":   ConfigVariableAWSPrivateSubnetID2,
	"spec.topology.variables.network.subnets.2.public.cidr":  ConfigVariableAWSPublicNodeCIDR2,
	"spec.topology.variables.network.subnets.2.public.id":    ConfigVariableAWSPublicSubnetID2,

	"spec.topology.variables.network.vpc.cidr":       ConfigVariableAWSVPCCIDR,
	"spec.topology.variables.network.vpc.existingID": ConfigVariableAWSVPCID,

	"spec.topology.variables.network.securityGroupOverrides.bastion":      ConfigVariableAWSSecurityGroupBastion,
	"spec.topology.variables.network.securityGroupOverrides.apiServerLB":  ConfigVariableAWSSecurityGroupApiserverLb,
	"spec.topology.variables.network.securityGroupOverrides.lb":           ConfigVariableAWSSecurityGroupLb,
	"spec.topology.variables.network.securityGroupOverrides.controlPlane": ConfigVariableAWSSecurityGroupControlplane,
	"spec.topology.variables.network.securityGroupOverrides.node":         ConfigVariableAWSSecurityGroupNode,

	"spec.topology.variables.bastion.enabled": ConfigVariableBastionHostEnabled,

	"spec.topology.variables.identityRef.name": ConfigVariableAWSIdentityRefName,
	"spec.topology.variables.identityRef.kind": ConfigVariableAWSIdentityRefKind,

	"spec.topology.variables.worker.instanceType":       ConfigVariableNodeMachineType,
	"spec.topology.variables.worker.rootVolume.sizeGiB": ConfigVariableAWSNodeOsDiskSizeGib,

	"spec.topology.variables.controlPlane.instanceType":       ConfigVariableControlPlaneMachineType,
	"spec.topology.variables.controlPlane.rootVolume.sizeGiB": ConfigVariableAWSControlplaneOsDiskSizeGib,

	TopologyWorkersMachineDeploymentsClass0:         "",
	TopologyWorkersMachineDeploymentsName0:          "",
	TopologyWorkersMachineDeploymentsReplicas0:      ConfigVariableWorkerMachineCount0,
	TopologyWorkersMachineDeploymentsFailureDomain0: "",

	"spec.topology.workers.machineDeployments.0.metadata.annotations.run.tanzu.vmware.com/resolve-os-image": "",

	TopologyWorkersMachineDeploymentsClass1:         "",
	TopologyWorkersMachineDeploymentsName1:          "",
	TopologyWorkersMachineDeploymentsReplicas1:      ConfigVariableWorkerMachineCount1,
	TopologyWorkersMachineDeploymentsFailureDomain1: "",

	"spec.topology.workers.machineDeployments.1.variables.overrides.worker.instanceType": ConfigVariableNodeMachineType1,

	TopologyWorkersMachineDeploymentsClass2:         "",
	TopologyWorkersMachineDeploymentsName2:          "",
	TopologyWorkersMachineDeploymentsReplicas2:      ConfigVariableWorkerMachineCount2,
	TopologyWorkersMachineDeploymentsFailureDomain2: "",

	"spec.topology.workers.machineDeployments.2.variables.overrides.worker.instanceType": ConfigVariableNodeMachineType2,
}

ClusterAttributesToLegacyVariablesMapAws has, AWS Cluster object attributes path mapped to legacy variable names. spec.topology.variables.* mapped as per config_variable_association.star:get_aws_vars() other attributes mapped as per infrastructure-aws/v*.*.*/yttcc/overlay.yaml

View Source
var ClusterAttributesToLegacyVariablesMapAzure = map[string]string{

	"spec.topology.variables.network.vnet.cidrBlocks":    ConfigVariableAzureVnetCidr,
	"spec.topology.variables.network.vnet.name":          ConfigVariableAzureVnetName,
	"spec.topology.variables.network.vnet.resourceGroup": ConfigVariableAzureVnetResourceGroup,

	"spec.topology.variables.location":          ConfigVariableAzureLocation,
	"spec.topology.variables.resourceGroup":     ConfigVariableAzureResourceGroup,
	"spec.topology.variables.subscriptionID":    ConfigVariableAzureSubscriptionID,
	"spec.topology.variables.environment":       ConfigVariableAzureEnvironment,
	"spec.topology.variables.sshPublicKey":      ConfigVariableAzureSSHPublicKeyB64,
	"spec.topology.variables.frontendPrivateIP": ConfigVariableAzureFrontendPrivateIP,
	"spec.topology.variables.customTags":        ConfigVariableAzureCustomTags,

	"spec.topology.variables.acceleratedNetworking.enabled": ConfigVariableAzureEnableAcceleratedNetworking,
	"spec.topology.variables.privateCluster.enabled":        ConfigVariableAzureEnablePrivateCluster,

	"spec.topology.variables.identityRef.name":      ConfigVariableAzureIdentityName,
	"spec.topology.variables.identityRef.namespace": ConfigVariableAzureIdentityNamespace,

	"spec.topology.variables.controlPlane.vmSize":            ConfigVariableAzureCPMachineType,
	"spec.topology.variables.controlPlane.dataDisks.sizeGiB": ConfigVariableAzureControlPlaneDataDiskSizeGib,

	"spec.topology.variables.controlPlane.osDisk.sizeGiB":            ConfigVariableAzureControlPlaneOsDiskSizeGib,
	"spec.topology.variables.controlPlane.osDisk.storageAccountType": ConfigVariableAzureControlPlaneOsDiskStorageAccountType,

	"spec.topology.variables.controlPlane.subnet.name":          ConfigVariableAzureControlPlaneSubnetName,
	"spec.topology.variables.controlPlane.subnet.cidr":          ConfigVariableAzureControlPlaneSubnetCidr,
	"spec.topology.variables.controlPlane.subnet.securityGroup": ConfigVariableAzureControlPlaneSubnetSecurityGroup,

	"spec.topology.variables.controlPlane.outboundLB.enabled":         ConfigVariableAzureControlPlaneOutboundLb,
	"spec.topology.variables.controlPlane.outboundLB.frontendIPCount": ConfigVariableAzureControlPlaneOutboundLbFrontendIPCount,

	"spec.topology.variables.worker.vmSize":                    ConfigVariableAzureNodeMachineType,
	"spec.topology.variables.worker.osDisk.sizeGiB":            ConfigVariableAzureNodeOsDiskSizeGib,
	"spec.topology.variables.worker.osDisk.storageAccountType": ConfigVariableAzureNodeOsDiskStorageAccountType,
	"spec.topology.variables.worker.dataDisks.sizeGiB":         ConfigVariableAzureNodeDataDiskSizeGib,

	"spec.topology.variables.worker.subnet.cidr":          ConfigVariableAzureWorkerNodeSubnetCidr,
	"spec.topology.variables.worker.subnet.name":          ConfigVariableAzureWorkerSubnetName,
	"spec.topology.variables.worker.subnet.securityGroup": ConfigVariableAzureNodeSubnetSecurityGroup,

	"spec.topology.variables.worker.outboundLB.enabled":              ConfigVariableAzureEnableNodeOutboundLb,
	"spec.topology.variables.worker.outboundLB.frontendIPCount":      ConfigVariableAzureNodeOutboundLbFrontendIPCount,
	"spec.topology.variables.worker.outboundLB.idleTimeoutInMinutes": ConfigVariableAzureNodeOutboundLbIdleTimeoutInMinutes,

	TopologyWorkersMachineDeploymentsClass0:         "",
	TopologyWorkersMachineDeploymentsName0:          "",
	TopologyWorkersMachineDeploymentsReplicas0:      ConfigVariableWorkerMachineCount0,
	TopologyWorkersMachineDeploymentsFailureDomain0: ConfigVariableAzureAZ,

	"spec.topology.workers.machineDeployments.0.metadata.annotations.run.tanzu.vmware.com/resolve-os-image": "",

	TopologyWorkersMachineDeploymentsClass1:         "",
	TopologyWorkersMachineDeploymentsName1:          "",
	TopologyWorkersMachineDeploymentsReplicas1:      ConfigVariableWorkerMachineCount1,
	TopologyWorkersMachineDeploymentsFailureDomain1: ConfigVariableAzureAZ1,

	"spec.topology.workers.machineDeployments.1.variables.overrides.worker.vmSize": ConfigVariableNodeMachineType1,

	TopologyWorkersMachineDeploymentsClass2:         "",
	TopologyWorkersMachineDeploymentsName2:          "",
	TopologyWorkersMachineDeploymentsReplicas2:      ConfigVariableWorkerMachineCount2,
	TopologyWorkersMachineDeploymentsFailureDomain2: ConfigVariableAzureAZ2,

	"spec.topology.workers.machineDeployments.2.variables.overrides.worker.vmSize": ConfigVariableNodeMachineType2,
}

ClusterAttributesToLegacyVariablesMapAzure has, Azure Cluster object attributes path mapped to legacy variable names. spec.topology.variables.* mapped as per config_variable_association.star:get_azure_vars() other attributes mapped as per infrastructure-azure/v*.*.*/yttcc/overlay.yaml

View Source
var ClusterAttributesToLegacyVariablesMapCommon = map[string]string{
	"metadata.name":      ConfigVariableClusterName,
	"metadata.namespace": ConfigVariableNamespace,

	"spec.clusterNetwork.pods.cidrBlocks":     ConfigVariableClusterCIDR,
	"spec.clusterNetwork.services.cidrBlocks": ConfigVariableServiceCIDR,

	"spec.topology.class":   ConfigVariableClusterClass,
	"spec.topology.version": ConfigVariableKubernetesVersion,

	"spec.topology.controlPlane.replicas": ConfigVariableControlPlaneMachineCount,

	"spec.topology.controlPlane.metadata.annotations.run.tanzu.vmware.com/resolve-os-image": "",

	"spec.topology.variables.network.ipv6Primary":      TKGIPV6Primary,
	"spec.topology.variables.network.proxy":            TKGHTTPProxyEnabled,
	"spec.topology.variables.network.proxy.httpProxy":  TKGHTTPProxy,
	"spec.topology.variables.network.proxy.httpsProxy": TKGHTTPSProxy,
	"spec.topology.variables.network.proxy.noProxy":    TKGNoProxy,

	"spec.topology.variables.imageRepository.host":                     ConfigVariableCustomImageRepository,
	"spec.topology.variables.imageRepository.tlsCertificateValidation": ConfigVariableCustomImageRepositorySkipTLSVerify,

	"spec.topology.variables.clusterRole": ConfigVariableClusterRole,

	"spec.topology.variables.auditLogging.enabled": EnableAuditLogging,

	"spec.topology.variables.trust.proxy":           TKGProxyCACert,
	"spec.topology.variables.trust.imageRepository": ConfigVariableCustomImageRepositoryCaCertificate,

	"spec.topology.variables.apiServerPort": ConfigVariableClusterAPIServerPort,
}

ClusterAttributesToLegacyVariablesMapCommon has cluster class attributes to legacy variable names, are common for all infra providers.

View Source
var ClusterAttributesToLegacyVariablesMapDocker = map[string]string{}

ClusterAttributesToLegacyVariablesMapDocker has, Docker Cluster object attributes path mapped to legacy variable names.

View Source
var ClusterAttributesToLegacyVariablesMapVsphere = map[string]string{

	"spec.topology.variables.apiServerEndpoint":      ConfigVariableVsphereControlPlaneEndpoint,
	"spec.topology.variables.vipNetworkInterface":    ConfigVariableVipNetworkInterface,
	"spec.topology.variables.aviAPIServerHAProvider": ConfigVariableVsphereHaProvider,

	"spec.topology.variables.vcenter.cloneMode":     ConfigVariableVsphereCloneMode,
	"spec.topology.variables.vcenter.network":       ConfigVariableVsphereNetwork,
	"spec.topology.variables.vcenter.resourcePool":  ConfigVariableVsphereResourcePool,
	"spec.topology.variables.vcenter.template":      ConfigVariableVsphereTemplate,
	"spec.topology.variables.vcenter.tlsThumbprint": ConfigVariableVsphereTLSThumbprint,
	"spec.topology.variables.vcenter.datacenter":    ConfigVariableVsphereDatacenter,
	"spec.topology.variables.vcenter.datastore":     ConfigVariableVsphereDatastore,
	"spec.topology.variables.vcenter.folder":        ConfigVariableVsphereFolder,
	"spec.topology.variables.vcenter.server":        ConfigVariableVsphereServer,

	"spec.topology.variables.user.sshAuthorizedKeys": ConfigVariableVsphereSSHAuthorizedKey,

	"spec.topology.variables.controlPlane.machine.diskGiB":     ConfigVariableVsphereCPDiskGib,
	"spec.topology.variables.controlPlane.machine.memoryMiB":   ConfigVariableVsphereCPMemMib,
	"spec.topology.variables.controlPlane.machine.numCPUs":     ConfigVariableVsphereCPNumCpus,
	"spec.topology.variables.controlPlane.network.nameservers": ConfigVariableControlPlaneNodeNameservers,

	"spec.topology.variables.worker.machine.diskGiB":     ConfigVariableVsphereWorkerDiskGib,
	"spec.topology.variables.worker.machine.memoryMiB":   ConfigVariableVsphereWorkerMemMib,
	"spec.topology.variables.worker.machine.numCPUs":     ConfigVariableVsphereWorkerNumCpus,
	"spec.topology.variables.worker.network.nameservers": ConfigVariableWorkerNodeNameservers,

	TopologyWorkersMachineDeploymentsClass0:         "",
	TopologyWorkersMachineDeploymentsName0:          "",
	TopologyWorkersMachineDeploymentsReplicas0:      ConfigVariableWorkerMachineCount,
	TopologyWorkersMachineDeploymentsFailureDomain0: ConfigVariableVsphereAz0,

	TopologyWorkersMachineDeploymentsClass1:         "",
	TopologyWorkersMachineDeploymentsName1:          "",
	TopologyWorkersMachineDeploymentsReplicas1:      ConfigVariableWorkerMachineCount1,
	TopologyWorkersMachineDeploymentsFailureDomain1: ConfigVariableVsphereAz1,

	TopologyWorkersMachineDeploymentsClass2:         "",
	TopologyWorkersMachineDeploymentsName2:          "",
	TopologyWorkersMachineDeploymentsReplicas2:      ConfigVariableWorkerMachineCount2,
	TopologyWorkersMachineDeploymentsFailureDomain2: ConfigVariableVsphereAz2,
}

ClusterAttributesToLegacyVariablesMapVsphere has, Vsphere Cluster object attributes path mapped to legacy variable names. spec.topology.variables.* mapped as per config_variable_association.star:get_vsphere_vars() other attributes mapped as per infrastructure-vsphere/v*.*.*/yttcc/overlay.yaml

View Source
var ClusterAttributesWithArrayTypeValue = map[string]bool{
	"spec.clusterNetwork.pods.cidrBlocks":             true,
	"spec.clusterNetwork.services.cidrBlocks":         true,
	"spec.topology.variables.network.proxy.noProxy":   true,
	"spec.topology.variables.user.sshAuthorizedKeys":  true,
	"spec.topology.variables.network.vnet.cidrBlocks": true,
}

ClusterAttributesWithArrayTypeValue has, list of Cluster attributes paths, which value type is array list

View Source
var InfrastructureSpecificVariableMappingMap = map[string]map[string]string{
	InfrastructureProviderVSphere: ClusterAttributesToLegacyVariablesMapVsphere,
	InfrastructureProviderAWS:     ClusterAttributesToLegacyVariablesMapAws,
	InfrastructureProviderAzure:   ClusterAttributesToLegacyVariablesMapAzure,
	InfrastructureProviderDocker:  ClusterAttributesToLegacyVariablesMapDocker,
}

InfrastructureSpecificVariableMappingMap has, infra name to variable mapping map, which makes easy to get infra specific mapping map

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