This section describes how to build custom machine images to use as node VM templates for a Tanzu Kubernetes Grid (TKG) standalone management cluster and the workload clusters that it creates.
To build custom images for a vSphere with Tanzu Supervisor cluster, see the vSphere Tanzu Kubernetes Grid Image Builder repository.
This topic provides background on TKG custom images.
NoteTo use a custom machine image for management cluster nodes, you need to deploy the management cluster with the installer interface, not from a configuration file.
Each custom machine image packages a base operating system (OS) version and a Kubernetes version, along with any additional customizations, into an image that runs on vSphere. Linux custom images can also run on AWS or Microsoft Azure infrastructure. A custom image must be based on the OS versions that are supported by Tanzu Kubernetes Grid. The base OS can be an OS that VMware supports but does not distribute, for example, Red Hat Enterprise Linux (RHEL) v8. To view the list of supported OSes, see Target Operating Systems.
To build custom machine images for Tanzu Kubernetes Grid cluster nodes, you use the container image from the upstream Kubernetes Image Builder project. Kubernetes Image Builder runs on your local workstation and uses the following:
ISO
.vm template
.For common combinations of OS version, Kubernetes version, and target infrastructure, Tanzu Kubernetes Grid provides default machine images. For example, one ova-ubuntu-2004-v1.26.8+vmware.1-tkg
image serves as the OVA image for Ubuntu v20.04 and Kubernetes v1.26.8 on vSphere.
For other combinations of OS version, Kubernetes version, and infrastructure, such as with the RHEL v8 OS or Windows, there are no default machine images, but you can build them.
If you build and use a custom image with the same OS version, Kubernetes version, and infrastructure that a default image already has, your custom image replaces the default. The Tanzu CLI then creates new clusters using your custom image, and no longer uses the default image, for that combination of OS version, Kubernetes version, and target infrastructure.
Cluster API (CAPI) is built on the principles of immutable infrastructure. All nodes that make up a cluster are derived from a common template or machine image.
When CAPI creates a cluster from a machine image, it expects several things to be configured, installed, and accessible or running, including:
kubeadm
, kubelet
and kubectl
specified in the cluster manifest.containerd
.kubeadm init
and kubeadm join
. You must include any images that are not published and must be pulled locally, as with VMware-signed images.cloud-init
configured to accept bootstrap instructions.For information about how to build images, see the following topics.