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: run.tanzu.vmware.com/v1alpha1      #TKGS API endpoint
kind: TanzuKubernetesCluster                   #required parameter
metadata:
  name: tkgs-cluster-1                         #cluster name, user defined
  namespace: tgks-cluster-ns                   #vsphere namespace
spec:
  distribution:
    version: v1.18                             #Resolves to the latest v1.18 image
  topology:
    controlPlane:
      count: 1                                 #number of control plane nodes
      class: best-effort-small                 #vmclass for control plane nodes
      storageClass: tkgs-storage-policy        #storageclass for control plane
    workers:
      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 spec.settings.storage.defaultClass to the minimal YAML.
  • Runtime parameters for settings.storage are not specified because the defaults are used.
  • Runtime parameters for settings.network 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: 192.168.0.0/16
    • Default Services CIDR: 10.96.0.0/12
    • 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.