1. After upgrading TCA Manager and TCA Control Plane from version 3.2 to 3.4, the TKG Management Cluster (TKG-M) node upgrade to Kubernetes 1.29 succeeds, but the subsequent addon upgrade fails.
2. The UI displays the following error: Fail to upgrade cluster <REDACTED_HOSTNAME> to v1.29.15+vmware.1: Failed to update addon. Error: class java.lang.String cannot be cast to class java.util.Map
3. The TCA API pod logs show a java.lang.ClassCastException:
ERROR c.v.h.a.c.SelfCertificateProvider- Failed to create kubernetes api client to connect internal cluster
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map
at com.vmware.nfv.vim.kubernetes.client.KubeClient.loadKubeConfig(KubeClient.java:122)
4. Verification of the kubeconfig-secret in the tca-cp-cn namespace reveals that the kubeconfig data field is empty ("").
TCA 3.4, TKG 2.5.x
The kubeconfig-secret within the TCA Control Plane namespace contains an empty or improperly formatted kubeconfig string, causing the Java-based KubeClient to fail during type casting while attempting to parse the cluster configuration.
To resolve this issue, manually update the secret with a valid, base64-encoded kubeconfig:
Log in to the TCA Control Plane (TCA-CP) node via SSH.
Locate or generate a valid kubeconfig for the management cluster.
Encode the kubeconfig file to base64 (one-line format): cat /home/admin/valid-kubeconfig | base64 -w 0
Edit the existing secret in the TCA namespace: kubectl edit secret kubeconfig-secret -n tca-cp-cn
Locate the data: section and update the kubeconfig: field with the base64 string generated in Step 3:
data:
kubeconfig: <BASE64_ENCODED_STRING>
Save and exit the editor.
Rerun the cluster upgrade from the TCA UI.