This topic describes how to use compute profiles using the VMware Tanzu Kubernetes Grid Integrated Edition (TKGI) Command Line Interface (TKGI CLI).
A compute profile enables TKGI cluster managers to configure TKGI-provisioned Kubernetes clusters with custom settings:
pks.clusters.admin
accounts.pks.cluster.manage
accounts.TKGI supports creating and managing compute profiles for Linux- and Windows-based Kubernetes clusters on vSphere with NSX networking and for Linux-based Kubernetes clusters on vSphere without NSX networking.
For an overview of how compute profile are created, see How Compute Profiles are Created below.
For information about using compute profiles, see:
TKGI cluster administrators can create and delete compute profiles. For information on how cluster administrators create and delete compute profiles, see Creating and Managing Compute Profiles with the CLI (vSphere).
To list available compute profiles, run the following command:
tkgi compute-profiles
For example:
$ tkgi compute-profiles
Name Description
custom-nodes-compute-profile custom-nodes-compute-profile
custom-node-pools-compute-profile custom-node-pools-compute-profile
Dc-east-single-node-pool A profile for the east datacenter with a single node pool
dc-east-mixed A profile for the east datacenter with heterogeneous workers
You can assign a compute profile to a TKGI-provisioned Kubernetes cluster at the time of cluster creation.
To create a cluster with a compute profile:
Review the following strict validation rules for the tkgi create-cluster --compute-profile
command:
tkgi create-cluster --compute-profile
ignores the --num-nodes
argument.--node-pool-instances
must match the name
property of a node pool in the compute profile.To create the cluster, run the following command:
tkgi create-cluster CLUSTER-NAME --external-hostname HOSTNAME --plan PLAN-NAME --compute-profile COMPUTE-PROFILE-NAME --node-pool-instances "NODE-POOL-NAME:INSTANCES"
Where:
CLUSTER-NAME
is a unique name for your cluster.Note: Use only lowercase characters when naming your cluster if you manage your clusters with Tanzu Mission Control (TMC). Clusters with names that include an uppercase character cannot be attached to TMC.
HOSTNAME
is your external hostname used for accessing the Kubernetes API.PLAN-NAME
is the name of the TKGI plan you want to use for your cluster.COMPUTE-PROFILE-NAME
is the name of the compute profile you want to use for your cluster.--node-pool-instances "NODE-POOL-NAME:INSTANCES"
overrides a compute profile’s configured node pool worker node instance count:
NODE-POOL-NAME
is the name of the node pool to configure. The node pool name must match the name
property of a node pool in the compute profile.INSTANCES
is the number of worker node instances to create for the node pool.For example:
tkgi create-cluster custom-node-pools -e test.tkgi.shep.api.com --compute-profile custom-node-pools-compute-profile -p "small" --node-pool-instances "tiny-1:3"
TKGI Version: 1.18.5-build.10
Name: test
K8s Version: 1.27.15
Plan Name: small
UUID: <UUID of deployment>1
Last Action: CREATE
Last Action State: in progress
Last Action Description: Creating cluster
Kubernetes Master Host: test.tkgi.shep.api.com
Kubernetes Master Port: 8443
Worker Nodes: 4
Kubernetes Master IP(s): In Progress
Network Profile Name:
Kubernetes Profile Name:
Compute Profile Name: custom-node-pools-compute-profile
Tags:
TKGI supports changing the compute profile for an already created cluster.
You can use this procedure to:
To assign a compute profile to an existing cluster, complete the following:
The following are not supported when modifying an existing compute profile:
name
property.Before assigning a compute profile to an existing cluster:
Review the following strict validation rules for the tkgi update-cluster --compute-profile
command:
tkgi update-cluster --compute-profile
ignores the --num-nodes
argument.--node-pool-instances
must match a name
property of the node pools in the compute profile.Review the following precautions and warnings:
Warning: Do not scale out or scale in existing control plane nodes by reconfiguring the TKGI tile. Reducing a cluster’s number of control plane nodes might remove a control plane node and cause the cluster to become inactive.
Warning: If cluster update fails while applying a new compute profile with revised node pool names, do not reapply the previous compute profile: the cluster’s worker nodes will be deleted. If you encounter this scenario, fix the new compute profile configuration without modifying the node pool names, and retry your cluster update. For more information, see tkgi update-cluster compute profile failure in the VMware Tanzu Knowledge Base.
Note: Compute profiles do not support moving a cluster’s nodes to different Availability Zones.
Resolve any conditions matching the listed concerns, precautions or warnings.
To assign a compute profile to an existing cluster:
Select the compute profile to apply to the cluster:
If you are updating a cluster that uses a public cloud CSI driver, see Limitations on Using a Public Cloud CSI Driver in Release Notes for additional requirements.
Run the following command to update the cluster with the new compute profile:
tkgi update-cluster CLUSTER-NAME --compute-profile NEW-COMPUTE-PROFILE-NAME --node-pool-instances "NODE-POOL-NAME:INSTANCES"
Where:
CLUSTER-NAME
is the name of the existing Kubernetes cluster.NEW-COMPUTE-PROFILE-NAME
is the name of the new compute profile you want to apply to the cluster.--node-pool-instances "NODE-POOL-NAME:INSTANCES"
overrides a compute profile’s configured node pool worker node instance count:
NODE-POOL-NAME
is the name of the node pool to configure. The node pool name must match the name
property of a node pool in the compute profile.INSTANCES
is the number of worker node instances to create for the node pool.For example:
tkgi update-cluster test --compute-profile new-compute-profile
Update summary for cluster test:
Compute Profile Name: new-compute-profile
Are you sure you want to continue? (y/n): y
Use 'tkgi cluster test' to monitor the state of your cluster
(Optional) To bypass compute profile validation, include the --enforce-compute-profile-update
parameter in your tkgi update-cluster
command line. VMware recommends that you always allow validation when updating clusters in production environments.
For example:
tkgi update-cluster test --compute-profile bad-compute-profile --enforce-compute-profile-update
Update summary for cluster test:
Compute Profile Name: bad-compute-profile
Are you sure you want to continue? (y/n): y
Use 'tkgi cluster test' to monitor the state of your cluster
WARNING: Updating a cluster with a compute profile is not supported on a TKGI cluster that has not been upgraded to the current TKGI version. For more information, see Tasks Supported Following a TKGI Control Plane Upgrade in About Tanzu Kubernetes Grid Integrated Edition Upgrades.
TKGI supports using the CLI to resize a cluster already created or assigned with a compute profile, without having to create a new compute profile.
To resize a cluster:
If you are updating a cluster that uses a public cloud CSI driver, see Limitations on Using a Public Cloud CSI Driver in Release Notes for additional requirements.
Run the tkgi update-cluster
command with the --node-pool-instances
option:
For example, to resize a cluster custom-node-pools-cluster
to use three nodes from the node pool named tiny-1
and seven from the pool named medium-2
:
tkgi update-cluster custom-node-pools-cluster --node-pool-instances "tiny-1:3,medium-2:7"