Editing spec.topology.class to use a new custom cluster class fails with "clusters.cluster.x-k8s,io " was not valid
search cancel

Editing spec.topology.class to use a new custom cluster class fails with "clusters.cluster.x-k8s,io " was not valid

book

Article ID: 381215

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

After upgrading from vCenter 8.0 U2 to 8.0U3 and using a custom cluster class following v1beta1 Example: Cluster Based on a Custom ClusterClass (vSphere 8 U2 and Later Workflow) editing the topology of the existing cluster results in error:

"clusters.cluster.x-k8s,io " was not valid: []: Invalid value: "": could not compare ClusterClass compatibility: desired ClusterClass must not be nil  

kube-apiserver-[id]/logs.txt shows entries similar to:

rejected by webhook "validation.kubeadmcontrolplanetemplate.controlplane.cluster.x-k8s.io": &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"admission webhook "validation.kubeadmcontrolplanetemplate.controlplane.cluster.x-k8s.io"

The CAPI logs may show entries similar to:

"Reconciler error" err="failed to patch object KubeadmControlPlaneTemplate/tkc-control-plane: adminssion webhook ... spec.tempalte.spec field is immutable. Please create new resource instead. 

Environment

vCenter 8.0 u2
vCenter 8.0 u3
TKR version 1.28
TKR version 1.29

Cause

This is a known issue when upgrading from a vCenter with a CAPI version greater than or equal to 1.2 (e.g vCenter 8.0 U2) to a vCenter with CAPI version 1.4 (e.g vCenter 8.0 U3). 

Resolution

Upgrade to TKG Service 3.2 which includes the fix. Then follow the same existing public document for maintaining custom clusterclass: v1beta1 Example: Cluster Based on a Custom ClusterClass (vSphere 8 U2 and Later Workflow) 

Additional Information

Steps on how to upgrade

  1. Review release notes: VMware Tanzu Kubernetes Grid Service Release Notes
  2. Verify compatibility: Verify TKGS Cluster Compatibility for Updates
  3. Upgrade process: Upgrade the TKG Service Version