This example YAML demonstrates how to provision a Tanzu Kubernetes cluster with custom network ranges for the Calico CNI.

Example YAML Contents

The following YAML demonstrates how to provision a Tanzu Kubernetes cluster with custom network ranges for the Calico CNI.
apiVersion: run.tanzu.vmware.com/v1alpha1    
kind: TanzuKubernetesCluster                 
metadata:
  name: tkgs-cluster-2                                
  namespace: tkgs-cluster-ns                     
spec:
  distribution:
    version: v1.18                             #Resolves to the latest v1.18 image 
  topology:
    controlPlane:
      count: 3                                 #3 control plane nodes                       
      class: guaranteed-large                  #large size VM
      storageClass: tkgs-storage-policy-yellow #Specific storage class for control plane       
    workers:
      count: 5                                 #5 worker nodes                     
      class: guaranteed-xlarge                 #extra large size VM          
      storageClass: tkgs-storage-policy-green  #Specific storage class for workers     
  settings:
    network:
      cni:
        name: calico 
      services:
        cidrBlocks: ["198.51.100.0/12"]        #Cannot overlap with Supervisor Cluster
      pods:
        cidrBlocks: ["192.0.2.0/16"]           #Cannot overlap with Supervisor Cluster
    storage:
      classes: ["gold", "silver"]              #Named PVC storage classes
      defaultClass: silver                     #Default PVC storage class

Example YAML Notes

The complete YAML configuration required to create a Tanzu Kubernetes cluster has the following characteristics: