Enable-WMCluster
Enables the workload management feature on the specified cluster. As a prerequisite, you must establish a connection to a vCenter Server system by using the Connect-VIServer cmdlet. Starting with vSphere 7.0 Update 1, you can use two options for network backing: the NXT-T Container Plugin and the vSphere networking stack. For more information, see Configuring and Managing a Supervisor Cluster (https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-21ABC792-0A23-40EF-8D37-0367B483585E.html)
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Cluster | Cluster | named |
|
Specifies the cluster where you want to enable the workload management feature. |
required
|
ContentLibrary | ContentLibrary | named |
|
Specifies the content library which holds the virtual machine images for the workload management feature. |
required
|
EphemeralStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with ephemeral disks of all the Kubernetes Pods in the cluster. |
required
|
ExternalEgressCIDRs | String[] | named |
|
Specifies the Classless Inter-Domain Routing (CIDR) blocks from which NSX assigns IP addresses used for performing Source Network Address Translation (SNAT) from container IPs to external IPs. These ranges should not overlap with those in PodCIDRs, ServiceCIDR, ExternalIngressCIDRs, or other services that run in the data center. The value is formatted as IPv4NetworkAddress/PrefixInteger. For example, you can use this to represent 256 IP addresses using the value of "10.10.10.0/24". |
required
|
ExternalIngressCIDRs | String[] | named |
|
Specifies CIDR blocks from which NSX assigns IP addresses for Kubernetes Ingresses and Kubernetes Services of type LoadBalancer. These ranges should not overlap with those in PodCIDRs, ServiceCIDR, ExternalEgressCIDRs, or other services that run in the data center. |
required
|
ImageStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with the storage that you want to use for container images. |
required
|
ManagementNetworkMode | WMNetworkMode | named |
|
Specifies the type of network configuration used for the network adapters attached to the management network. |
required
|
ManagementVirtualNetwork | Network | named |
|
Specifies the port group or opaque network to which the management network interface of the Kubernetes API server is attached. |
required
|
MasterStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with the Kubernetes API server. |
required
|
PodCIDRs | String[] | named |
|
Specifies CIDR blocks from which Kubernetes allocates Pod IP addresses. This range should not overlap with those in ServiceCIDRs, ExternalIngressCIDRs, ExternalEgressCIDRs, or other services that run in the data center. All Pod CIDR blocks must be of at least subnet size /23. |
required
|
ServiceCIDR | String | named |
|
Specifies a CIDR block from which Kubernetes allocates service cluster IP addresses. This range should not overlap with those in PodCIDRs, ExternalIngressCIDRs, ExternalEgressCIDRs, or other services that run in the data center. The value is formatted as IPv4NetworkAddress/PrefixInteger. For example, you can use this to represent 256 IP addresses using the value of "10.10.10.0/24". |
required
|
SizeHint | WMNamespaceManagementSizingHint | named |
|
Specifies the expected size and resources allocated to the Kubernetes API server and the worker nodes. |
optional | ConfigurationTimeoutSeconds | Int32 | named |
|
Specifies a timeout in seconds to wait for the operation to complete. The default timeout is 1 hour. |
optional | DefaultImageRegistryHostPort | Int32 | named |
|
Specifies the port of the container image registry that is used by the cluster. If not specified, the default one is 443. |
optional | DefaultImageRegistryHostname | String | named |
|
Specifies the IP address or the host name of the container image registry that is used by the cluster. |
optional | DefaultImageRepository | String | named |
|
Specifies the name of the default image repository in the specified registry that is used by the cluster. |
optional | DistributedSwitch | VDSwitch | named |
|
Specifies the vSphere distributed switch used to connect this cluster to the overlay transport zone. In order to run this command, you must configure the switch in NSX-T in advance. |
optional | LoginBanner | String | named |
|
Specifies the disclaimer that you want to be displayed before logging in through the Kubectl plugin. |
optional | ManagementNetworkAddressRangeSize | Int32 | named |
|
Specifies the length of the IP address range used for network interfaces on the management network. If not specified, the value of 5 is assumed. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkFloatingIPAddress | String | named |
|
Specifies the floating IP used by the HA master cluster in the DHCP case. This parameter is optional and it's only relevant when the value of the network mode is DHCP. |
optional | ManagementNetworkGateway | String | named |
|
Specifies the IPv4 address of the gateway for the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkStartIPAddress | String | named |
|
Specifies the starting IP address in the range of IP addresses used for network interfaces on the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkSubnetMask | String | named |
|
Specifies the subnet mask of the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | MasterDnsNames | String[] | named |
|
Specifies a list of additional DNS names to associate with the Kubernetes API server. These DNS names are embedded in the Transport Layer Security (TLS) certificate presented by the API server. If not specified, no additional DNS names are embedded in the TLS certificate. |
optional | MasterDnsSearchDomain | String[] | named |
|
Specifies a list of domains (for example "vmware.com") that you want to search when trying to look up a host name on Kubernetes API server specified in order of preference. If not specified, no default DNS search domains are set. |
optional | MasterDnsServerIPAddress | String[] | named |
|
Specifies a list of DNS server IP addresses that you want to use on the Kubernetes API server specified in order of preference. If not specified, no default DNS servers are set. |
optional | MasterNtpServer | String[] | named |
|
Specifies a list of NTP server DNS names or IP addresses that you want to use on the Kubernetes API server specified in order of preference. If not specified, VMware Tools based time synchronization is enabled. |
optional | NsxEdgeClusterId | String | named |
|
Specifies the ID of the NSX Edge cluster that you want to use for Kubernetes Services of type LoadBalancer, Kubernetes Ingresses, and NSX SNAT. |
optional | OpaqueSwitchName | String | named |
|
Specifies an NSX-T distributed switch used to connect this cluster to the overlay transport zone. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | RunAsync | SwitchParameter | named |
|
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console. |
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. |
optional | WorkerDnsServer | String[] | named |
|
Specifies external DNS servers that you want to expose to the workloads. These DNS servers serve as the default fallback DNS servers to resolve domain names hosted outside of the Supervisor Cluster. If not specified, no default DNS servers are set. |
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Cluster | Cluster | named |
|
Specifies the cluster where you want to enable the workload management feature. |
required
|
ContentLibrary | ContentLibrary | named |
|
Specifies the content library which holds the virtual machine images for the workload management feature. |
required
|
EphemeralStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with ephemeral disks of all the Kubernetes Pods in the cluster. |
required
|
HAProxyAddressRanges | String[] | named |
|
Specifies a list of IP address ranges that will be used to derive frontend IP addresses for L4 virtual servers in the format "192.169.10.100-192.169.10.150". You must provide at least one range. |
required
|
HAProxyDataPlaneAddresses | String[] | named |
|
Specifies a list of addresses for the data plane API servers used to configure virtual servers in the following formats: "FQDN:port" or "IPAddress:port". |
required
|
HAProxyName | String | named |
|
Specifies a unique name across all namespaces in a vCenter server system that is used to identify the load balancer configuration object to be created. This must be an alphanumeric (a-z and 0-9) string, with a maximum length of 63 characters. You can use the hyphen (-) anywhere except for the first or last symbol. |
required
|
HAProxyPassword | String | named |
|
Specifies the password for the HAProxy Data Plane administrator user. |
required
|
HAProxyServerCertificateChain | String | named |
|
Specifies a PEM-encoded Certificate Authority Chain which is used to verify x509 certificates received from the server. See the following example script that extracts the value for this parameter from the virtual machine where the HAProxy is deployed. [https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-8D7D292B-43E9-4CB8-9E20-E4039B80BF9B.html] $vc = "10.21.32.43" $vc_user = "[email protected]" $vc_password = "PASSWORD" Connect-VIServer -User $vc_user -Password $vc_password -Server $vc $VMname = "haproxy-demo" $AdvancedSettingName = "guestinfo.dataplaneapi.cacert" $Base64cert = get-vm $VMname |Get-AdvancedSetting -Name $AdvancedSettingName while ([string]::IsNullOrEmpty($Base64cert.Value)) { Write-Host "Waiting for CA Cert Generation... This may take a under 5-10 minutes as the VM needs to boot and generate the CA Cert (if you haven't provided one already)." $Base64cert = get-vm $VMname |Get-AdvancedSetting -Name $AdvancedSettingName Start-sleep -seconds 2 } Write-Host "CA Cert Found... Converting from BASE64"$cert = [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($Base64cert.Value)) Write-Host $cert |
required
|
HAProxyUsername | String | named |
|
Specifies an administrator user name to access the HAProxy Data Plane API server. |
required
|
ImageStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with the storage that you want to use for container images. |
required
|
ManagementNetworkMode | WMNetworkMode | named |
|
Specifies the type of network configuration used for the network adapters attached to the management network. |
required
|
ManagementVirtualNetwork | Network | named |
|
Specifies the port group or opaque network to which the management network interface of the Kubernetes API server is attached. |
required
|
MasterStoragePolicy | SpbmStoragePolicy | named |
|
Specifies the storage policy associated with the Kubernetes API server. |
required
|
PrimaryWorkloadNetworkSpecification | WMNamespaceNetworkSpec | named |
|
Indicates a specification for the primary workload network to be created. The primary network handles the traffic for the Kubernetes control plane VMs and for the Kubernetes workloads. Namespaces that do not have a different port group assigned as their network use the primary network. Tanzu Kubernetes clusters use only the network that is assigned to the namespace where they are deployed or the primary network if there is no network assigned to that namespace. |
required
|
ServiceCIDR | String | named |
|
Specifies a CIDR block from which Kubernetes allocates service cluster IP addresses. This range should not overlap with those in PodCIDRs, ExternalIngressCIDRs, ExternalEgressCIDRs, or other services that run in the data center. The value is formatted as IPv4NetworkAddress/PrefixInteger. For example, you can use this to represent 256 IP addresses using the value of "10.10.10.0/24". |
required
|
SizeHint | WMNamespaceManagementSizingHint | named |
|
Specifies the expected size and resources allocated to the Kubernetes API server and the worker nodes. |
optional | AdditionalWorkloadNetworkSpecifications | WMNamespaceNetworkSpec[] | named |
|
Indicates the specification(s) for the additional namespace network(s) to be created. The additional namespace networks can later be utilized by the workloads. |
optional | ConfigurationTimeoutSeconds | Int32 | named |
|
Specifies a timeout in seconds to wait for the operation to complete. The default timeout is 1 hour. |
optional | DefaultImageRegistryHostPort | Int32 | named |
|
Specifies the port of the container image registry that is used by the cluster. If not specified, the default one is 443. |
optional | DefaultImageRegistryHostname | String | named |
|
Specifies the IP address or the host name of the container image registry that is used by the cluster. |
optional | DefaultImageRepository | String | named |
|
Specifies the name of the default image repository in the specified registry that is used by the cluster. |
optional | LoginBanner | String | named |
|
Specifies the disclaimer that you want to be displayed before logging in through the Kubectl plugin. |
optional | ManagementNetworkAddressRangeSize | Int32 | named |
|
Specifies the length of the IP address range used for network interfaces on the management network. If not specified, the value of 5 is assumed. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkFloatingIPAddress | String | named |
|
Specifies the floating IP used by the HA master cluster in the DHCP case. This parameter is optional and it's only relevant when the value of the network mode is DHCP. |
optional | ManagementNetworkGateway | String | named |
|
Specifies the IPv4 address of the gateway for the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkStartIPAddress | String | named |
|
Specifies the starting IP address in the range of IP addresses used for network interfaces on the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | ManagementNetworkSubnetMask | String | named |
|
Specifies the subnet mask of the management network. This parameter is only relevant when the value of the network mode is StaticRange. |
optional | MasterDnsNames | String[] | named |
|
Specifies a list of additional DNS names to associate with the Kubernetes API server. These DNS names are embedded in the Transport Layer Security (TLS) certificate presented by the API server. If not specified, no additional DNS names are embedded in the TLS certificate. |
optional | MasterDnsSearchDomain | String[] | named |
|
Specifies a list of domains (for example "vmware.com") that you want to search when trying to look up a host name on Kubernetes API server specified in order of preference. If not specified, no default DNS search domains are set. |
optional | MasterDnsServerIPAddress | String[] | named |
|
Specifies a list of DNS server IP addresses that you want to use on the Kubernetes API server specified in order of preference. If not specified, no default DNS servers are set. |
optional | MasterNtpServer | String[] | named |
|
Specifies a list of NTP server DNS names or IP addresses that you want to use on the Kubernetes API server specified in order of preference. If not specified, VMware Tools based time synchronization is enabled. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | RunAsync | SwitchParameter | named |
|
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console. |
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. |
optional | WorkerDnsServer | String[] | named |
|
Specifies external DNS servers that you want to expose to the workloads. These DNS servers serve as the default fallback DNS servers to resolve domain names hosted outside of the Supervisor Cluster. If not specified, no default DNS servers are set. |
Output
VMware.VimAutomation.WorkloadManagement.Types.V1.WMClusterExamples
Example 1
Enable-WMCluster "MyCluster" ` -SizeHint Tiny ` -ManagementVirtualNetwork (Get-VirtualNetwork "ManagementNetwork") ` -ManagementNetworkMode Dhcp ` -DistributedSwitch "NsxSwitch" ` -NsxEdgeClusterId "a19ea5ea-3817-4394-83a7-55e4962c90f1" ` -ServiceCIDR "10.96.0.0/24" ` -PodCIDRs "10.244.0.0/21" ` -ExternalIngressCIDRs "10.23.80.0/27" ` -ExternalEgressCIDRs "10.23.80.0/27" ` -EphemeralStoragePolicy "MyStoragePolicy1" ` -ImageStoragePolicy "MyStoragePolicy2" ` -MasterStoragePolicy "MyStoragePolicy3"
Enables the workload management feature on the "MyCluster" cluster by using the NSX-T Container Plugin. The management interfaces is attached to the network "ManagementNetwork". The management interfaces use Dynamic Host Configuration Protocol (DHCP) to configure its network stack. The vSphere distributed switch "NsxSwitch" provides the overlay networking. You must configure that switch in NSX-T to provide that prior to executing the above example. The NSX edge cluster with ID "a19ea5ea-3817-4394-83a7-55e4962c90f1" provides any higher level network functions that the vCenter system consumes in order to host the workloads.
Example 2
Get-Cluster "MyCluster" | Enable-WMCluster ` -SizeHint Tiny ` -ManagementVirtualNetwork (Get-VirtualNetwork "ManagementNetwork") ` -ManagementNetworkMode StaticRange ` -ManagementNetworkStartIPAddress "10.23.83.89" ` -ManagementNetworkAddressRangeSize 5 ` -ManagementNetworkGateway "10.23.83.253" ` -ManagementNetworkSubnetMask "255.255.252.0" ` -OpaqueSwitchName "my-nvds" ` -NsxEdgeClusterId "a19ea5ea-3817-4394-83a7-55e4962c90f1" ` -ServiceCIDR "10.96.0.0/24" ` -PodCIDRs "10.244.0.0/21" ` -ExternalIngressCIDRs "10.23.87.0/27" ` -ExternalEgressCIDRs "10.23.88.0/27" ` -EphemeralStoragePolicy "MyStoragePolicy1" ` -ImageStoragePolicy "MyStoragePolicy2" ` -MasterStoragePolicy "MyStoragePolicy3" ` -ContentLibrary "MyContentLibrary" ` -WorkerDnsServer "10.23.108.1" ` -DefaultImageRegistryHostname "myrepository.example.com" ` -DefaultImageRepository "myrepo" ` -MasterDnsNames "myk8s.example.com" ` -MasterDnsServerIPAddress @("10.23.0.1","10.23.0.2") ` -MasterNtpServer @("10.23.0.3") ` -MasterDnsSearchDomain "example.com"
Enables the workload management feature on the "MyCluster" cluster by using the NSX-T Container Plugin. The management interfaces are attached to the network "ManagementNetwork". The management interfaces use static network configuration. The NSX-T distributed switch "my-nvds" provides the overlay networking. You must configure that switch in NSX-T in advance to provide that prior to executing the above example. The NSX edge cluster with ID "a19ea5ea-3817-4394-83a7-55e4962c90f1" provides any higher level network functions that the vCenter system consumes in order to host the workloads.
Example 3
Get-Cluster "MyCluster" | Enable-WMCluster ` -SizeHint Tiny ` -ManagementVirtualNetwork (Get-VirtualNetwork "ManagementNetwork" ) ` -ManagementNetworkMode Dhcp ` -ManagementNetworkFloatingIPAddress "10.23.78.20" ` -ServiceCIDR "10.96.0.0/24" ` -EphemeralStoragePolicy "MyStoragePolicy1" ` -ImageStoragePolicy "MyStoragePolicy2" ` -MasterStoragePolicy "MyStoragePolicy3" ` -ContentLibrary "MyContentLibrary" ` -HAProxyName "HAProxy1" ` -HAProxyAddressRanges "192.168.10.50-192.168.10.99" ` -HAProxyUsername "HAProxy1AdminUser" ` -HAProxyPassword "pass" ` -HAProxyDataPlaneAddresses "HAProxy1DataPlane:5556" ` -HAProxyServerCertificateChain "-----BEGIN CERTIFICATE-----...........-----END CERTIFICATE-----" ` -PrimaryWorkloadNetworkSpecification ( New-WMNamespaceNetworkSpec ` -Name "network-1" ` -Gateway "192.168.10.1" ` -Subnet "255.255.255.0" ` -AddressRanges "192.168.10.100-192.168.10.200" ` -DistributedPortGroup "MyPortgroup" ` )
Enables the workload management feature on the "MyCluster" cluster by using the vSphere networking stack.
Example 4
$primaryWorkloadNetwork = New-WMNamespaceNetworkSpec ` -Name "network-1" ` -Gateway "192.168.10.1" ` -Subnet "255.255.255.0" ` -AddressRanges "192.168.10.50-192.168.10.99" ` -DistributedPortGroup "WM-Management Network" $additionalWorkloadNetwork1 = New-WMNamespaceNetworkSpec ` -Name "network-1" ` -Gateway "192.168.10.1" ` -Subnet "255.255.255.0" ` -AddressRanges "192.168.10.100-192.168.10.149" ` -DistributedPortGroup "WM-Management Network" $additionalWorkloadNetwork2 = New-WMNamespaceNetworkSpec ` -Name "network-1" ` -Gateway "192.168.10.1" ` -Subnet "255.255.255.0" ` -AddressRanges "192.168.10.50-192.168.150.200" ` -DistributedPortGroup "WM-Management Network" Get-Cluster "MyCluster" | Enable-WMCluster ` -SizeHint Tiny ` -ManagementVirtualNetwork (Get-VirtualNetwork "ManagementNetwork" ) ` -ManagementNetworkMode Dhcp ` -ManagementNetworkFloatingIPAddress "10.23.78.20" ` -ServiceCIDR "10.96.0.0/24" ` -EphemeralStoragePolicy "MyStoragePolicy1" ` -ImageStoragePolicy "MyStoragePolicy2" ` -MasterStoragePolicy "MyStoragePolicy3" ` -ContentLibrary "MyContentLibrary" ` -HAProxyName "HAProxy1" ` -HAProxyAddressRanges "192.168.10.50-192.168.10.99" ` -HAProxyUsername "HAProxy1AdminUser" ` -HAProxyPassword "pass" ` -HAProxyDataPlaneAddresses "HAProxy1DataPlane:5556" ` -HAProxyServerCertificateChain "-----BEGIN CERTIFICATE-----...........-----END CERTIFICATE-----" ` -PrimaryWorkloadNetworkSpecification $primaryWorkloadNetwork ` -AdditionalWorkloadNetworkSpecifications $additionalWorkloadNetwork1, $additionalWorkloadNetwork2
Enables the workload management feature on the "MyCluster" cluster by using the vSphere networking stack. First, use the New-WMNamespaceNetworkSpec cmdlet to create specifications for the namespace networks. Second, use the Enable-WMCluster cmdlet to create the specified namespace networks - one primary and two additional ones - which can later be utilized by the workloads.
Related Commands
WMCluster
This cmdlet deactivates the workload management feature on the specified cluster.
Enables the workload management feature on the specified cluster.
This cmdlet retrieves the configuration for the workload management feature of the clusters in the vCenter Server system.
This cmdlet modifies the workload settings of a Tanzu Kubernetes Grid cluster.