When trying to add a windows node-pool to a workload cluster in vSphere Supervisor cluster, one or more of the following errors are returned:
Error from server (Forbidden): error when creating "<workload cluster name>": admission webhook "tkr-resolver-cluster-webhook.tanzu.vmware.com" denied the request: Could not resolve KR/OSImage
Missing compatible KR/OSImage for the cluster
vSphere Supervisor
vKR v1.31 and higher
Windows Server 2022
This issue can occur due to any of the below causes:
The annotation for specifying that a node-pool should use the Windows OS should match the below using os-type=windows:
- class: node-pool
metadata:
annotations:
run.tanzu.vmware.com/resolve-os-image: os-type=windows
If your custom Windows image cannot be found by the system, you will need to specify the ID of the content library in the annotation similarly to the below:
- class: node-pool
metadata:
annotations:
run.tanzu.vmware.com/resolve-os-image: os-type=windows, content-library=cl-<ID>
You can locate the content library ID by using the below commands:
kubectl get contentlibraryitem -A
clitem-<ID> <image-name> cl-<ID> OVF
kubectl get contentlibrary -A
<namespace> cl-<ID> <name in vsphere> <Local/Subscribed>
After correcting the annotations, the next system creation of a worker node in the windows node-pool should succeed.
If it does not succeed, confirm that all requirements noted in the below documentation are met:
Provisioning TKG Clusters with Windows Node Pools
While connected to the Supervisor cluster context, the custom Windows image is not present as a osImage:
kubectl get osimages
kubectl get contentlibraryitem -A
kubectl get contentlibrary -A
Provisioning TKG Clusters with Windows Node Pools
--------
"VMware will support issues with the vSphere Kubernetes Service Image Builder, but you are responsible for any issues relating to your image customizations and custom applications."
https://github.com/vmware/vks-image-builder
--------