Follow these steps to expose a Tanzu Kubernetes Grid cluster using VMware Cloud Director Container Service Extension.

To expose a TKGm cluster, it is necessary to edit the specification section in the TKGm cluster configuration file before cluster creation.
Note: It is not possible to expose the cluster after cluster creation.

Procedure

  1. To generate a sample TKGm cluster configuration file, open vcd cse and enter the following command:
    vcd cse cluster apply -s --tkg        

    The following code is an example of a TKGm cluster configuration YAML file:

    apiVersion: cse.vmware.com/v2.1
    kind: TKGm
    metadata:
      name: tkgm1
      orgName: org1
      site: https://vcd.com
      virtualDataCenterName: ovdc1
    spec:
      distribution:
        templateName: ubuntu-2004-kube-v1.21.8+vmware.1-tkg.2-ed3c93616a02968be452fe1934a1d37c
        templateRevision: 1
      settings:
        network:
          expose: true
        ovdcNetwork: ovdc1_nw
        rollbackOnFailure: true
        sshKey: 'ssh-key'
        csi:
        - defaultK8sStorageClass:
            filesystem: ext4
            k8sStorageClassName: my-storage-class
            useDeleteReclaimPolicy: true
            vcdStorageProfileName: '*'
      topology:
        controlPlane:
          count: 1
          storageProfile: '*'
        workers:
          count: 1
          storageProfile: '*'
  2. In the spec section of the TKGm cluster configuration file, set expose to True.
    expose : True
  3. To create a TKGm cluster, enter the following command in vcd cse:
    vcd cse cluster apply <tkgm_cluster.yaml>

Hide a Tanzu Kubernetes Grid Cluster

Follow these steps to deactivate the expose functionality and hide a Tanzu Kubernetes Grid cluster.

Procedure

  1. In vcd cse, in the spec section in the TKGm cluster configuration file, set expose to False:
    expose : False
  2. Enter the following command to apply updates:
    vcd cse cluster apply <tkgm_cluster.yaml>