You can specify a default storage class when you provision a Tanzu Kubernetes cluster.

Example YAML

The following example YAML shows how to provision a cluster with a default storage class.
apiVersion: run.tanzu.vmware.com/v1alpha1
kind: TanzuKubernetesCluster
metadata:
  name: default-storage-spec
  namespace: tkgs-cluster-ns
spec:
  topology:
    controlPlane:
      count: 3
      class: best-effort-small
      storageClass: vwt-storage-policy
    workers:
      count: 3
      class: best-effort-small
      storageClass: vwt-storage-policy
  distribution:
    version: v1.18.10+vmware.1-tkg.1.823ac9b
  settings:
    storage:
      classes:
      - vwt-storage-policy
      defaultClass: vwt-storage-policy
    network:
      cni:
        name: antrea
      services:
        cidrBlocks: ["198.51.100.0/12"]
      pods:
        cidrBlocks: ["192.0.2.0/16"]
      serviceDomain: "tanzukubernetescluster.local"       

Example YAML Notes

The example YAML for provisioning a Tanzu Kubernetes cluster with separate volumes for the control plane etcd database and the worker node container images:

  • A storage policy named vwt-storage-policy was created to enable the vSphere with Tanzu platform.
  • This storage policy is used for the control plane and worker nodes.
  • The spec.settings.storage.classes setting identifies the vwt-storage-policy as the storage class and specifies to be the defaultClass.