This example YAML provides the minimal configuration for provisioning a Tanzu Kubernetes cluster that uses all of the default settings.

Example YAML Contents

The following example YAML is the minimal configuration required to invoke the Tanzu Kubernetes Grid Service and provision a Tanzu Kubernetes cluster. All available default settings are used.

apiVersion:      #TKGS API endpoint
kind: TanzuKubernetesCluster                   #required parameter
  name: tkgs-cluster-1                         #cluster name, user defined
  namespace: tgks-cluster-ns                   #vsphere namespace
    version: v1.18                             #Resolves to the latest v1.18 image
      count: 1                                 #number of control plane nodes
      class: best-effort-small                 #vmclass for control plane nodes
      storageClass: tkgs-storage-policy        #storageclass for control plane
      count: 3                                 #number of worker nodes
      class: best-effort-small                 #vmclass for worker nodes
      storageClass: tkgs-storage-policy        #storageclass for worker nodes

Example YAML Notes

  • This YAML provisions a cluster with a single control plane node and three worker nodes.
  • The apiVersion and kind parameter values are constants.
  • 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.xxxxxx.
  • The VM class best-effort-<size> has no reservations. For more information, see Virtual Machine Class Types for Tanzu Kubernetes Clusters.
  • If you want to use Helm or Kubeapps as the defaultClass, which is referenced by many charts, add to the minimal YAML.
  • Runtime parameters for are not specified because the defaults are used.
  • Runtime parameters for are not needed because the defaults are used. For reference, the following are the default network settings. For more information, see Configuration Parameters for Tanzu Kubernetes Clusters.
    • Default CNI: antrea
    • Default Pod CIDR:
    • Default Services CIDR:
    • Default Service Domain: cluster.local
  • To use the default Antrea CNI, you must use an image that supports Antrea. See Supported Update Path.
  • To change the default CNI, see Configure the Default CNI for Tanzu Kubernetes Clusters.
  • Because pod security policy is enforced, after creating a Tanzu Kubernetes cluster using the example YAML, you will be able to run pods but not deployments. To create a deployment, define a binding to one off the default pod security policies. For more information, see Using Pod Security Policies with Tanzu Kubernetes Clusters.