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.
It is recommended to create enough space on the containerd storage for this cluster as containers will be stored.
List all VM class instances associated with that Namespace using the command below.
kubectl get virtualmachineclasses
View GPU resources for a specific class using the command below.
kubectl describe virtualmachineclass <VMclass-name>
Create a YAML file with the appropriate configuration for your VM class.
nano tanzucluster.yaml
Populate the YAML file with the information below.
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
Apply the YAML to create the TKG cluster using the command below.
kubectl apply -f tanzucluster.yaml
Execute the command below to see the status of the cluster.
kubectl get tkc
Apply the YAML to create the TKG cluster using the command below.
kubectl apply -f tanzucluster.yaml
Execute the command below to see the status of the cluster.
kubectl get tkc
Wait until the cluster shows ready.
At this point, the IT Administrator will be able to see the cluster created in the vCenter UI.