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:
- This YAML provisions a cluster with three control plane nodes and five worker nodes.
- The Kubernetes version, listed as v1.18, is resolved to the most recent distribution matching that minor version, which is
- Calico is not the default CNI, so it is explicitly named in the manifest. To change the default CNI, see Configure the Default CNI for Tanzu Kubernetes Clusters.
- The network settings are custom CIDR ranges, not the defaults. These ranges must not overlap with the Supervisor Cluster. For more information, see Configuration Parameters for Tanzu Kubernetes Clusters.
- Different storage classes are used for the control plane and worker nodes.
- The VM class
guaranteed-effort-<size>has full reservations. For more information, see Virtual Machine Class Types for Tanzu Kubernetes Clusters.