How to manually update kubeconfig/cluster configuration
search cancel

How to manually update kubeconfig/cluster configuration

book

Article ID: 345733

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

  • K8S VIMs are disconnected in TCA-M, or the status of a cluster is disconnected (indicated with a red dot) in TCA-CP Appliance Management portal (9443).
  • In TCA UI under partner system, Harbor is registered and connected Kubernetes cluster as VIM. In cluster Harbor add-on gets added successfully. But in partner system still it shows "Initiated", it should show "Enable".
  • CNF installations fail.
  • Attempts to create a new cluster results in the message: "Token has expired. Please login again."

Environment

2.3, 3.0, 3.1, 3.2, 3.3

Cause

The cluster config stored inside TCA-DB for the clusters has expired. The cluster certificates are renewed, but not synced with the TCA appliances.

Resolution

  1. Manually update the kube-config/cluster configuration
  2. SSH to the management cluster with endpoint IP as the capv user.

  3. Get the kubeconfig secret content for the disconnected k8s cluster.
    kubectl get secret <cluster name>-kubeconfig -n <cluster name> -ojsonpath="{.data.value}" | base64 -d

    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data: [base64 CA data]
        server: https://<cluster VIP>:6443
      name: <cluster name>
    contexts:
    - context:
        cluster: <cluster name>
        user: <cluster name>-admin
      name: <cluster name>-admin@<cluster name>
    current-context: <cluster name>-admin@<cluster name>
    kind: Config
    preferences: {}
    users:
    - name: <cluster name>-admin
      user:
        client-certificate-data: [base64 client cert data]
        client-key-data: [base64 client key data]
  4. Copy the above kubeconfig content

  5. Go to the TCA-UI -> Virtual Infrastructure -> cluster.

  6. Click on the 'Edit' button.

  7. Update the Kubernetes Config with the secret content obtained from step 3.

  8. Click on 'Update'

  9. This will set the VIM status to pending for about 30-40 seconds. It should return to the 'connected' status

  10. Navigate to https://<TCA-CP_IP>:9443 in a browser

  11. Locate the cluster, edit and update the kube config file with the secret content obtained from step 3.

  12. Repeat steps 1 through 10 for any other affected clusters.

  13. Restart the TCA Manager applianceRestart the TCA CP Appliance

     14.Verify the K8S VIMs status in TCA-M, or the status of the Workload Cluster in the TCA-CP Appliance Management portal (9443). They should be in a connected state.