Upgrade of TKC fails on TMC web UI with API Error: Updates to Immutable Fields are not allowed (invalid argument)
search cancel

Upgrade of TKC fails on TMC web UI with API Error: Updates to Immutable Fields are not allowed (invalid argument)

book

Article ID: 375191

calendar_today

Updated On:

Products

VMware Tanzu Mission Control VMware vSphere with Tanzu vSphere with Tanzu VMware Tanzu Kubernetes Grid Service (TKGs)

Issue/Introduction

  • When attempting cluster upgrade from the TMC Web GUI, users will see errors reported:

    API Error: Failed to upgrade cluster: (target=mc:xxxxyyyyzzzzaaaabbbbcccc, intentId=xxxxyyyyzzzzaaaabbbbcccc): admission webhook "default.validating.tanzukubernetescluster.run.tanzu.vmware.com" denied the request: updates to immutable fields are not allowed (invalid argument)"

  • The TMC Management Cluster is connected to a vSphere with Tanzu Supervisor Cluster.
  • The Guest Cluster being upgraded has a spec.defaultCNI configured in the cluster manifest.
  • The TKGS Guest Cluster being upgraded is running on a Legacy Cluster, prior to the v1beta1 API.
  • The Supervisor Cluster has a tkgServiceConfiguration applied that contains a spec.defaultCNI that differs from the failing cluster's defaultCNI

Environment

This failure occurs on Legacy TKGS clusters (also known as TKCs) and should not impact ClusterClass based clusters using the ClusterClass API v1beta1

Cause

This failure scenario is unique to environments that have configured a default CNI in the tkgServiceConfiguration (this will apply to all clusters that don't have a defaultCNI explicitly configured in the cluster manifest) and where one or more of the TKGS Guest Clusters (TKCs) have a defaultCNI configuration applied in the cluster manifest that differs from the tkgServiceConfiguration. When TMC upgrades the cluster, it removes the defaultCNI from the cluster manifest. The cluster then refers to the tkgServiceConfiguration configured defaultCNI. As the CNI's were configured differently during cluster instantiation and this is an immutable field, TMC is unable to reconcile the change, leading to failures on the pre-check for cluster upgrade.

Resolution

TMC engineering is working on a permanent resolution for this. In the meantime, please follow the workaround below:

 

The Supervisor Cluster is the source of truth for TMC GUI. As the defaultCNI is removed by TMC during upgrade process, the workaround to upgrade clusters is to upgrade via the Supervisor Cluster context. The following documentation provides details on how to upgrade the TKC directly from Supervisor cluster