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

Example YAML Contents

The following YAML demonstrates how to provision a Tanzu Kubernetes cluster with custom network ranges for the Antrea CNI.

apiVersion: run.tanzu.vmware.com/v1alpha1
kind: TanzuKubernetesCluster
metadata:
  name: tkg-cluster-3-antrea
  namespace: tkgs-cluster-ns
spec:
  distribution:
    version: v1.18
  settings:
    network:
      cni:
        name: antrea
      pods:
        cidrBlocks:
        - 193.0.2.0/16
      serviceDomain: managedcluster.local
      services:
        cidrBlocks:
        - 195.51.100.0/12
  topology:
    controlPlane:
      class: guaranteed-small
      count: 3
      storageClass: pacific-storage-policy
    workers:
      class: guaranteed-small
      count: 5
      storageClass: atlantic-storage-policy

Example YAML Notes

The example YAML for provisioning a Tanzu Kubernetes cluster with custom network ranges for Antrea 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 v1.18.5+vmware.1-tkg.1.xxxxxxx.
  • Antrea is specified as the CNI with custom network settings. To use Antrea networking, the version must support Antrea networking. See Supported Update Path.
  • Because the following custom network settings are applied, the cni.name parameter is required even though the default Antrea is used.
    • Default CNI name: antrea
    • Custom Pods network CIDR: 193.0.2.0/16
    • Default Services CIDR: 195.51.100.0/12
    • Default Service Domain: managedcluster.local
  • The custom CIDR blocks specified cannot 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-<size> has full reservations. For more information, see Virtual Machine Class Types for Tanzu Kubernetes Clusters.