Refer to this example to provision a v1beta1 Cluster that uses the Ubuntu edition of a Tanzu Kubernetes release.

v1beta1 Example: Cluster with Ubuntu TKR

The following example YAML demonstrates how to use the v1beta1 API to provision a Cluster that uses the Ubuntu edition of the specified TKR. This example builds on the v1beta1 Example: Default Cluster.

By default PhotonOS is used for cluster nodes. If the TKR version supports multiple OSImages, include the annotation run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu in the cluster spec to use Ubuntu instead of Photon. If you are using the Ubuntu edition of the TKr, you must specify the full version string and you must include the OS annotation in the cluster spec. For more information on TKRs, see Administering Kubernetes Releases for TKG Service Clusters.

Caution:

The IP addresses are examples only. You need to provide your own IP addresses suitable for your network environment.

apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: cluster-ubuntu
  namespace: tkg-cluster-ns
spec:
  clusterNetwork:
    services:
      cidrBlocks: ["10.96.0.0/12"]
    pods:
      cidrBlocks: ["192.168.0.0/16"]
    serviceDomain: "cluster.local"
  topology:
    class: tanzukubernetescluster
    version: v1.30.1---vmware.1-fips-tkg.5
    controlPlane:
      replicas: 3
      metadata:
        annotations:
          run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
    workers:
      machineDeployments:
        - class: node-pool
          name: node-pool-1
          replicas: 3
          metadata:
            annotations:
              run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
        - class: node-pool
          name: node-pool-2
          replicas: 3
          metadata:
            annotations:
              run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
        - class: node-pool
          name: node-pool-3
          replicas: 3
          metadata:
            annotations:
              run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
    variables:
      - name: vmClass
        value: guaranteed-medium
      - name: storageClass
        value: tkg-storage-policy