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>'": 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).
If your environment is using a local content library with only ubuntu images, the above system defaults will search for a Photon image that does not exist.
To successfully deploy Ubuntu-based nodes, the following steps must be performed:
kubectl get osimages -n <namespace_name> | grep -i ubuntu
kubectl describe cluster -n <namespace> <affected workload cluster name> | grep -i annotations -A2 -B6
controlPlane:
replicas: #
metadata:
annotations:
run.tanzu.vmware.com/resolve-os-image: os-name=<OS>
workers:
machineDeployments:
- class: node-pool
name: <node-pool-name>
replicas: #
metadata:
annotations:
run.tanzu.vmware.com/resolve-os-image: os-name=<OS>
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. run.tanzu.vmware.com/resolve-os-image: "os-name=ubuntu,os-version=<OS version>"
kubectl apply -f <cluster-yaml-file>