Error from server (Spec.Topology.ControlPlane.TKR.Reference.Name unable to resolve that Kubernetes release due to Could not resolve KR/OSImage
Missing compatible KR/OSImage for the cluster
Control Plane, filters: {k8sVersionPrefix: '<TKR.VERSION>', osImageSelector: os-name='<OS NAME>'/standard}
MachineDeployment worker-nodepool, filters: {k8sVersionPrefix: '<TKR.VERSION>', osImageSelector: os-name='<OS NAME>'}
): error when creating ".\\'<CLUSTER_NAME.yaml'": admission webhook "default.validating.tanzukubernetescluster.run.tanzu.vmware.com" denied the request: Spec.Topology.ControlPlane.TKR.Reference.Name unable to resolve that Kubernetes release due to Could not resolve KR/OSImage
Missing compatible KR/OSImage for the cluster
vSphere Kubernetes Service
The issue occurs because the Ubuntu OS annotation was missing from the cluster deployment YAML. By default, vSphere Kubernetes Clusters use Photon OS images unless explicitly directed otherwise. When the Ubuntu annotation is not included, the system attempts to resolve a Photon OS image for the specified Kubernetes release (TKR).
To successfully deploy Ubuntu-based nodes, the following steps must be performed:
kubectl get osimages -n <namespace_name> | grep -i ubuntu
metadata:
name: tkc-ubuntu-gpu
namespace: tkg-cluster-ns
annotations:
run.tanzu.vmware.com/resolve-os-image: os-name=ubuntu
This annotation instructs the system to use an Ubuntu OS image instead of Photon OS during cluster provisioning. kubectl apply -f <cluster-yaml-file>