请参阅此处提供的示例 YAML,置备对集群节点使用 Ubuntu 操作系统的 TanzuKubernetesCluster 集群。此类集群可用于 vGPU 工作负载。

v1alpha3 示例:使用 Ubuntu TKR 的 TKC

默认情况下,对 TKG 2 集群节点使用指定 TKR 的 PhotonOS 版本。如果引用的 TKR 支持 OSImage 格式并具有可用的 Ubuntu 操作系统版本,请使用 run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu 注释指定 TKR 的 Ubuntu 操作系统版本。有关 OSImage 格式的详细信息,请参见 TKR OSImage 格式

AI/ML 工作负载需要使用 Ubuntu TKR。在此示例中,控制平面节点有一个单独的卷用于 etcd 数据库。每个工作节点池都有一个单独的卷用于容器运行时和 kubelet,每个卷的容量为 70 GiB。建议为基于容器的 AI/ML 工作负载提供此大小的单独卷。
apiVersion: run.tanzu.vmware.com/v1alpha3
kind: TanzuKubernetesCluster
metadata:
  name: tkc-ubuntu-gpu
  namespace: tkg2-cluster-ns
  annotations:
    run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
spec:
   topology:
     controlPlane:
       replicas: 3
       storageClass: tkg2-storage-policy
       vmClass: guaranteed-large
       tkr:
         reference:
           name: v1.23.8---vmware.2-tkg.2-zshippable
       volumes:
       - name: etcd
         mountPath: /var/lib/etcd
         capacity:
           storage: 4Gi
     nodePools:
     - name: nodepool-a100-primary
       replicas: 3
       storageClass: tkg2-storage-policy
       vmClass: vgpu-a100
       tkr:
         reference:
           name: v1.23.8---vmware.2-tkg.2-zshippable
       volumes:
       - name: containerd
         mountPath: /var/lib/containerd
         capacity:
           storage: 70Gi
       - name: kubelet
         mountPath: /var/lib/kubelet
         capacity:
           storage: 70Gi
     - name: nodepool-a100-secondary
       replicas: 3
       storageClass: tkg2-storage-policy
       vmClass: vgpu-a100
       tkr:
         reference:
           name: v1.23.8---vmware.2-tkg.2-zshippable
       volumes:
       - name: containerd
         mountPath: /var/lib/containerd
         capacity:
           storage: 70Gi
       - name: kubelet
         mountPath: /var/lib/kubelet
         capacity:
           storage: 70Gi
   settings:
     storage:
       defaultClass: tkg2-storage-policy
     network:
       cni:
        name: antrea
       services:
        cidrBlocks: ["198.51.100.0/12"]
       pods:
        cidrBlocks: ["192.0.2.0/16"]
       serviceDomain: cluster.local