This topic describes the different types of workload clusters created by Tanzu Kubernetes Grid (TKG) and how they are configured and created.
Tanzu Kubernetes Grid hosts three different types of workload clusters:
Cluster
spec.topology
block
spec.topology.class
value
ClusterClass
objectclass
is tanzukubernetescluster
class
is tkg-INFRASTRUCTURE-default-VERSION
, for example, tkg-vsphere-default-v1.0.0
.TanzuKubernetesCluster
Cluster
Note that Class-based clusters with class: tanzukubernetescluster
, all lowercase, are different from TKC-based clusters, which have object type TanzuKubernetesCluster
.
Class-based clusters are designed to replace the other two cluster types, by presenting the same API to both types of management cluster: Supervisors and standalone management clusters.
To create and manage workload clusters, management clusters run Cluster API software:
The following table maps management and workload cluster types to the Cluster API providers that they use:
TKG with… | uses Cluster API Provider… | on… | to create and manage workload clusters of type… | in product versions… |
---|---|---|---|---|
Supervisor | CAPW (proprietary) | vSphere | Class-based Cluster objects |
TKG 2.1 and vSphere with Tanzu 8 |
TanzuKubernetesCluster objects |
vSphere with Tanzu 7 & 8 | |||
Standalone management cluster | CAPA (OSS) | AWS | Class-based Cluster objects |
TKG v2.1 |
Plan-based AWSCluster objects |
TKG v2.1 and v1.x | |||
CAPZ (OSS) | Azure | Class-based Cluster objects |
TKG v2.1 | |
Plan-based AzureCluster objects |
TKG v2.1 and v1.x | |||
CAPV (OSS) | vSphere | Class-based Cluster objects |
TKG v2.1 | |
Plan-based VSphereCluster objects |
TKG v2.1 and v1.x |
The different versions of the Tanzu CLI that ship with different versions of Tanzu Kubernetes Grid allow you to create different types of cluster depending on whether you are using Supervisor on vSphere 8, a Supervisor Cluster on vSphere 7, or a standalone management cluster on vSphere 6.7, 7, and 8 without a Supervisor, on AWS, or on Azure.
CLI Version | TKG Version | Create class-based clusters with … | Create plan-based clusters with … | Create TanzuKubernetesClusters with … |
||||||
---|---|---|---|---|---|---|---|---|---|---|
Standalone Management Cluster | Supervisor on vSphere 8 | Supervisor Cluster on vSphere 7 | Standalone Management Cluster | Supervisor on vSphere 8 | Supervisor Cluster on vSphere 7 | Standalone Management Cluster | Supervisor on vSphere 8 | Supervisor Cluster on vSphere 7 | ||
v0.28.0 | 2.1 | ✓ | ✓ | x | ✓ | ✓ | x | x | ✓ | x |
v0.25.4 | 1.6.1 | x | ✓ | x | ✓ | ✓ | x | x | ✓ | ✓ |
v0.25.0 | 1.6.0 | x | ✓ | x | ✓ | ✓ | x | x | ✓ | ✓ |
v0.11.x | 1.5.x | x | x | x | ✓ | x | ✓ | x | x | ✓ |
Class-based clusters have the following high-level hierarchy of object types. The objects underlying KubeAdmControlPlane
and MachineDeployment
have the same types, but are typically different objects:
Cluster
- number and type of control plane and worker nodes set by topology
block in spec
KubeAdmControlPlane
- defines the control plane nodes
vSphereMachine
, AWSMachine
, DockerMachine
Machine
- generic object for node VMKubeAdmConfig
- Kubernetes configuration, including Kubernetes version, image repository, pre- and post- deploy hooks, etc.MachineDeployment
- defines the worker nodes
Machine
KubeAdmConfig
For more information, see CustomResourceDefinitions relationships in The Cluster API Book.
Depending on your installed environment, you can create Tanzu Kubernetes Grid workload clusters in multiple ways: with the Tanzu CLI, Tanzu Mission Control, and kubectl
.
The following chart outlines how users can create different types of workload clusters on different infrastructures:
Using the… | to create a… | takes config values from… | and config templates from… | Instructions |
---|---|---|---|---|
Tanzu CLI:tanzu cluster create |
Class-based workload cluster (vSphere) | Cluster and underlying object specs |
User, for example classycluster.yaml | Create a Class-based Cluster |
TanzuKubernetesCluster workload cluster (vSphere) |
Cluster configuration file, local environment, (advanced) ytt overlays |
infrastructure-tkg-service-vsphere * |
(Legacy) Create a Plan-Based or a TKC Cluster | |
Plan-based workload cluster (vSphere, AWS, Azure) | infrastructure-vsphere , infrastructure-aws , infrastructure-azure * |
|||
Tanzu Mission Control (TMC) | TanzuKubernetesCluster or plan-based workload cluster |
TMC UI | Registered management cluster | Provisioning Workload Clusters |
kubectl apply |
Class-based or TanzuKubernetesCluster workload clusters (vSphere) |
Cluster and underlying object specs |
User, for example classycluster.yaml, tkc.yaml | Creating Workload Clusters Declaratively |
*Local directories under .config/tanzu/tkg/providers/
When the Tanzu CLI creates a TKC-based workload cluster, it combines configuration values from the following:
~/.config/tanzu/tkg/cluster-config.yaml
or other file passed to the CLI --file
option~/.config/tanzu/tkg/providers/infrastructure-tkg-service-vsphere
, as described in Plan Configuration Files below.~/.config/tanzu/tkg/providers
Live input applies configuration values that are unique to each invocation, environment variables persist them over a terminal session, and configuration files and overlays persist them indefinitely. You can customize clusters through any of these sources, with recommendations and caveats described below.
See Configuration Value Precedence for how the tanzu
CLI derives specific cluster configuration values from these multiple sources where they may conflict.
The ~/.config/tanzu/tkg/providers/infrastructure-tkg-service-vsphere
directory contains TKC workload cluster plan configuration files that are named cluster-template-definition-PLAN.yaml
. The configuration values for each plan come from these files and from the files that they list under spec.paths
:
tanzu
CLIspec.paths
listTo customize cluster plans via YAML, you edit files under ~/.config/tanzu/tkg/providers/infrastructure-tkg-service-vsphere
, but you should avoid changing other files.
Files to Edit
Workload cluster plan configuration file paths follow the form ~/.config/tanzu/tkg/providers/infrastructure-infrastructure-tkg-service-vsphere/VERSION/cluster-template-definition-PLAN.yaml
, where:
VERSION
is the version of the Cluster API Provider module that the configuration uses.PLAN
is dev
, prod
, or a custom plan.Each plan configuration file has a spec.paths
section that lists source files and ytt
directories that configure the cluster plan. For example:
apiVersion: providers.tanzu.vmware.com/v1alpha1
kind: TemplateDefinition
spec:
paths:
- path: providers/infrastructure-tkg-service-vsphere/v1.1.0/ytt
- path: providers/ytt
- path: bom
filemark: text-plain
- path: providers/config_default.yaml
These files are processed in the order listed. If the same configuration field is set in multiple files, the last-processed setting is the one that the tanzu
CLI uses.
To customize your cluster configuration, you can:
spec.paths
list.
ytt
overlay files.
ytt
.Files to Leave Alone
VMware discourages changing the following files under ~/.config/tanzu/tkg/providers
, except as directed:
base-template.yaml
files, in ytt
directories
ytt
to set values in the overlay.yaml
file in the same ytt
directory.~/.config/tanzu/tkg/providers/config_default.yaml
- Append only
User Customizations
section at the end.--file
option of tanzu cluster create
.~/.config/tanzu/tkg/providers/config.yaml
tanzu
CLI uses this file as a reference for all providers present in the /providers
directory, and their default versions.When the Tanzu CLI creates a TKC-based workload cluster, it it combines configuration values from multiple sources. If those sources conflict, it resolves conflicts in the following order of descending precedence:
Processing layers, ordered by descending precedence | Source | Examples |
---|---|---|
1. Cluster configuration variables set in your local environment | Set in shell. | export WORKER_VM_CLASS=best-effort-large |
2. Cluster configuration variables set in the Tanzu CLI, with tanzu config set env. |
Set in shell; saved in the global Tanzu CLI configuration file, /.config/tanzu/config.yaml . |
tanzu config set env.WORKER_VM_CLASS best-effort-large |
3. Cluster configuration variables set in the cluster configuration file | Set in the file passed to the –file option of tanzu cluster create . File defaults to /.config/tanzu/tkg/cluster-config.yaml . |
WORKER_VM_CLASS: best-effort-large |
4. Factory default configuration values | Set in providers/config_default.yaml , but some fields are listed without default values. Do not modify this file. |
WORKER_VM_CLASS: |