Follow this workflow to provision a v1beta1 TKG cluster using the Tanzu CLI.
Prerequisites
Verify or complete the following prerequisites before starting the provisioning workflow:
- Install or update your environment to the latest Supervisor version. See Running TKG Service Clusters.
- Create or update a content library with the latest Tanzu Kubernetes releases. See Administering Kubernetes Releases for TKG Service Clusters.
- Create and configure a vSphere Namespace for hosting TKG 2.0 clusters. See Configuring vSphere Namespaces for Hosting TKG Service Clusters.
Provision a Default TKG Cluster
Complete these steps to provision a default v1beta1 Cluster using the Tanzu CLI. For additional guidance or troubleshooting, see
Create Workload Clusters in the standalone TKG documentation.
- Install the Tanzu CLI.
See Install the Tanzu CLI for Use with TKG Service Clusters.
- Connect to Supervisor using the Tanzu CLI.
- List the available TKrs.
tanzu kubernetes-release get
- Create a Cluster manifest with the desired configurations.
With TKG on vSphere 8 Supervisor, you can use a Kubernetes-style object specification with the Tanzu CLI to create a Cluster based on a ClusterClass.
- Start with the v1beta1 Example: Default Cluster.
- Populate
spec.clusterNetwork
with the requiredcidrBlocks
. - Populate
spec.topology
with the expected values listed in the table.- TKR NAME string, such as
v1.26.13---vmware.1-fips.1-tkg.3
- Number of control plane nodes, such as
3
- Name of each worker node pool, such as
node-pool-1
- Number of worker nodes, such as
3
- VM class, such as
guaranteed-medium
- Storage class, such as
tkg2-storage-policy
- TKR NAME string, such as
- Save the Cluster manifest as
cluster-default.yaml
and validate it using a YAML checker. - Create the TKG cluster.
tanzu cluster create -f cluster-default.yaml
Note: Append-v 8
for verbose output. - Verify that the TKG cluster is created.
Workload cluster 'cluster-default' created
- After the cluster is created, run the following command to check the status of the cluster.
tanzu cluster get cluster-default
- List the cluster.
tanzu cluster list
- Check cluster nodes.
tanzu cluster machinehealthcheck node get cluster-default
tanzu cluster machinehealthcheck control-plane get cluster-default
- Get the configuration context for the TKG cluster.
tanzu cluster kubeconfig get cluster-default -n tkg2-cluster-ns
- Access the cluster.
kubectl config use-context tanzu-cli-cluster-default@cluster-default
- Exercise the TKG 2.0 cluster by deploying a test pod and verify that it works as expected.
Provision a Custom TKG Cluster on Supervisor
To provision a custom v1beta1 Cluster, such as v1beta1 Example: Cluster with Calico CNI, you can put all the specs into a single YAML as provided in the example, change certain values to match your environment, and run kubectl apply -f cluster-calico.yaml
, for example.
To provision the same custom v1beta1 Cluster using the Tanzu CLI, the configuration objects CalicoConfig
and ClusterBootstrap
should exist before you create the cluster.
To provision the Cluster with Calico CNI:
- Create the YAML for the
CalicoConfig
andClusterBootstrap
configuration objects, with the desired cluster name and namespace in each. - Run
kubectl apply -f
for each of the three configuration objects, or put them into a single YAML and runkubectl apply -f
. - Create the Cluster spec
cluster-calico.yaml
, with the name and namespace matching those in the configuration objects, and any other desired parameters. - Create the cluster.
tanzu cluster create -f cluster-calico.yaml