Provision a Tanzu Kubernetes cluster by using kubectl and a YAML file for input.

Procedure

  1. Log in to the Supervisor Cluster by using kubectl
    kubectl vsphere login --server 192.168.21.1 --vsphere-username Supervisor_Cluster_Admin --insecure-skip-tls-verify
  2. Switch the kubectl context to the sfo-w01-tkc01 namespace.
    kubectl config use-context sfo-w01-tkc01
  3. Create a sfo-w01-tkc01.yaml text file with the following specifications.
    Specifications differ in VMware Validated Design 6.0 and 6.0.1. Use the specification according to the version that you are deploying.
    Specification for Version 6.0 Specification for Version 6.0.1
    apiVersion: run.tanzu.vmware.com/v1alpha1
    kind: TanzuKubernetesCluster
    metadata:
      name: sfo-w01-tkc01
      namespace: sfo-w01-tkc01
    spec:
      topology:
        controlPlane:
          count: 3
          class: guaranteed-small
          storageClass: vsphere-with-kubernetes
        workers:
          count: 3
          class: guaranteed-small
          storageClass: vsphere-with-kubernetes
      distribution:
        version: v1.16.4+vmware.1-tkg.1.11140a8
      settings:
        network:
          cni:
            name: calico
          services:
            cidrBlocks: ["198.51.100.0/12"]
          pods:
            cidrBlocks: ["192.0.2.0/16"]
    apiVersion: run.tanzu.vmware.com/v1alpha1
    kind: TanzuKubernetesCluster
    metadata:
      name: sfo-w01-tkc01
      namespace: sfo-w01-tkc01
    spec:
      topology:
        controlPlane:
          count: 3
          class: guaranteed-small
          storageClass: vsphere-with-kubernetes
        workers:
          count: 3
          class: guaranteed-small
          storageClass: vsphere-with-kubernetes
      distribution:
        version: v1.16.8+vmware.1-tkg.3.60d2ffd
      settings:
        network:
          cni:
            name: calico
          services:
            cidrBlocks: ["198.51.100.0/12"]
          pods:
            cidrBlocks: ["192.0.2.0/16"]
  4. Use kubectl to deploy the Tanzu Kubernetes Cluster from your YAML file input.
    kubectl apply -f ./sfo-w01-tkc01.yaml
  5. After the deployment of the Tanzu Kubernetes Cluster completes, run kubectl to get the Tanzu Kubernetes cluster status.

    You see similar output that indicates that the cluster deployment is successful.

    kubectl describe tanzukubernetescluster sfo-w01-tkc01
    <snip>
      Node Status:
        Tk - Cluster - 01 - Control - Plane - 7 Q 2 Dk:                  ready
        Tk - Cluster - 01 - Control - Plane - Pt 87 M:                   ready
        Tk - Cluster - 01 - Control - Plane - Txjbm:                     ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - 2 Wtlk:   ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - 5 Qd 49:  ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - Bk 7 Db:  ready
      Phase:                                                             running
      Vm Status:
        Tk - Cluster - 01 - Control - Plane - 7 Q 2 Dk:                  ready
        Tk - Cluster - 01 - Control - Plane - Pt 87 M:                   ready
        Tk - Cluster - 01 - Control - Plane - Txjbm:                     ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - 2 Wtlk:   ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - 5 Qd 49:  ready
        Tk - Cluster - 01 - Workers - Mhmrx - 7 F 8794 D 878 - Bk 7 Db:  ready