Upgrading a VKS (vSphere Kubernetes Service) cluster from v1.34.x to v1.35.x fails with the following symptoms:
While connected to the Supervisor cluster context, the following symptoms are observed:
kubectl get machines,vm -n <affected vks cluster namespace>
kubectl get cluster,clusterbootstrap,kcp,md -n <affected vks cluster namespace>
kubectl describe cluster -n <affected vks cluster namespace> <vks cluster name>
Message: * TopologyReconciled: error computing the desired state of the Cluster topology: failed to compute ControlPlane: failed to compute version of ControlPlane: failed to call extension handlers for hook "BeforeClusterUpgrade.hooks.runtime.cluster.x-k8s.io": failed to call extension handler "before-cluster-upgrade.runtime-extension": got failure response, please check controller logs for errors
Observed Generation: 8
Reason: NotAvailable
Status: False
Type: Available
"failed to call extension handlers" err="failed to call extension handler \"before-cluster-upgrade.runtime-extension\": got failure response, please check controller logs for errors" controller="topology/cluster" controllerGroup="cluster.x-k8s.io" controllerKind="Cluster" Cluster="<NAMESPACE>/<VKS_CLUSTER_NAME>" reconcileID="<UUID>" hook="BeforeClusterUpgrade"
"Reconciler error" err="error computing the desired state of the Cluster topology: failed to compute ControlPlane: failed to compute version of ControlPlane: failed to call extension handlers for hook \"BeforeClusterUpgrade.hooks.runtime.cluster.x-k8s.io\": failed to call extension handler \"before-cluster-upgrade.runtime-extension\": got failure response, please check controller logs for errors" controller="topology/cluster" controllerGroup="cluster.x-k8s.io" controllerKind="Cluster" Cluster="<NAMESPACE>/<VKS_CLUSTER_NAME>" reconcileID="<UUID>"
tanzu-addons-controller logs show the below error:
"failed to selectAddonRelease" err="expected to find at least one version, but did not (details: all=4 -> after-kuberntes-version-check=0) -> after-upgrade-version-check=0 failed to select item" logger="controllers.ClusterAddon" clusterAddon.Name="<VKS cluster name>-antrea" clusterAddon.Namespace="<VKS cluster namespace>"
The above noted ClusterAddon is in Unknown state:
kubectl get clusteraddon -n <vks cluster namespace>
However, the addonRelease of antrea for the desired v1.35.x VKR version exists in the affected cluster's namespace:
kubectl get addonreleases -n <vks cluster namespace> | grep antreaUpgrading to VKR v1.35.X.
VKS 3.6.2+v1.35 and earlier.
This issue has been resolved in VKS 3.6.3 and later.
This issue occurs due to an indeterministic selection of AddonRelease during the CNI (Antrea / Calico) upgrade phase.
When upgrading to any 1.35.x VKR, multiple Antrea or Calico AddonRelease resources may exist in the environment with the same spec.version, but will be tied to different Kubernetes minor releases (e.g., KR 1.35.2 vs 1.35.5).
In VKS versions prior to 3.6.3, the Addon Controller cannot deterministically select the correct AddonRelease that matches the target Kubernetes version.
As a result, the controller cannot resolve the exact Antrea / Calico package to deploy and the upgrade process deadlocks which causes the upgrading VKS cluster's TopologyReconcile failure.
Upgrade the VKS supervisor service (Kubernetes service) to v3.6.3 or later which has the fix for this issue.
If you're unable to update VKS, you can apply the fix to all clusters in a VKS namespace or to specific clusters with the attached script and the below steps:
chmod +x addonrelease-fix.sh
KUBECONFIG=/path/to/admin.conf ./addonrelease-fix.sh --dry-run./addonrelease-fix.sh -n <affected VKS cluster namespace> --dry-run
KUBECONFIG=/path/to/admin.conf ./addonrelease-fix.sh./addonrelease-fix.sh -n <affected VKS cluster namespace>
kubectl get addoninstall -A | grep "kb-" kubectl get cluster -n <affected vks cluster namespace>
kubectl describe cluster -n <affected vks cluster namespace> <affected vks cluster name> | grep -i Topology
kubectl get cluster,kcp,md,machines -n <affected VKS cluster namespace>You can further restrict the script by CNI type with the below flag examples:
./addonrelease-fix.sh --cni antrea./addonrelease-fix.sh --cni calico