Step #5: Create a GPU Accelerated TKG Cluster

We will create a YAML file to create a GPU accelerated cluster within this document. This file contains the new cluster name and previously specified namespace and VM class.

Note

It is recommended to create enough space on the containerd storage for this cluster as containers will be stored.

  1. List all VM class instances associated with that Namespace using the command below.

    Copy
    Copied!
                

    kubectl get virtualmachineclasses


  2. View GPU resources for a specific class using the command below.

    Copy
    Copied!
                

    kubectl describe virtualmachineclass <VMclass-name>


  3. Create a YAML file with the appropriate configuration for your VM class.

    Copy
    Copied!
                

    nano tanzucluster.yaml


  4. Populate the YAML file with the information below.

    Copy
    Copied!
                

    apiVersion: run.tanzu.vmware.com/v1alpha2 kind: TanzuKubernetesCluster metadata: name: tkg-cluster namespace: launchpad spec: distribution: fullVersion: 1.20.8+vmware.1-tkg.2 settings: network: cni: name: antrea pods: cidrBlocks: - 192.0.2.0/16 serviceDomain: local services: cidrBlocks: - 198.51.100.0/12 storage: defaultClass: launchpad-kubernetes topology: controlPlane: replicas: 1 storageClass: launchpad-kubernetes vmClass: guaranteed-medium nodePools: - name: nodepool-a30 replicas: 2 storageClass: launchpad-kubernetes vmClass: vm-class-a30-24gb volumes: - capacity: storage: 100Gi mountPath: /var/lib/containerd name: containerd


  5. Apply the YAML to create the TKG cluster using the command below.

    Copy
    Copied!
                

    kubectl apply -f tanzucluster.yaml


  6. Execute the command below to see the status of the cluster.

    Copy
    Copied!
                

    kubectl get tkc


  7. Apply the YAML to create the TKG cluster using the command below.

    Copy
    Copied!
                

    kubectl apply -f tanzucluster.yaml


  8. Execute the command below to see the status of the cluster.

    Copy
    Copied!
                

    kubectl get tkc


  9. Wait until the cluster shows ready.

    vmware-tanzu-012.png

  10. At this point, the IT Administrator will be able to see the cluster created in the vCenter UI.

    vmware-tanzu-013.png

© Copyright 2022-2023, NVIDIA. Last updated on Apr 13, 2023.