Checking if Cluster Certificates are valid:
Run the following commands to query the Kubernetes Cluster Control Plane node for the status and expiration date of Kubernetes Cluster certificates:
- SSH to the Control Plane node of the CaaS Cluster and switch to the sudo user:
ssh capv@K8S-CONTROL-PLANE-IP
- Switch to root
sudo -i
- Check if certificates are expired by
kubeadm certs check-expiration
Updating the Cluster certificate within Caas
- TCA 2.3 introduces the automatic renewal of the Cluster Certificates, given the CaaS Clusters have been upgraded to the supported Tanzu Kubernetes Grid (TKG) clusters: 1.24.10, 1.23.16 and 1.22.17.
- Clusters upgraded to TKG 1.24.10, 1.23.16 or 1.22.17:
- TCA 2.3 will automatically regenerate the Kubernetes cluster certificates. However, these clusters will still need their kubeconfig updated.
Note: The following steps apply only to TKG clusters deployed with older versions of TCA and NOT upgraded to TCA 2.3.
Renewing the Workload Cluster Certificate
- SSH into the TCA-CP where the corresponding management cluster is deployed as the admin user and switch to the sudo user:
ssh admin@mgmt_cluster_tca_cp_fqdn
su –
Note: Replace mgmt_cluster_tca_cp_fqdn with the actual values in the command provided.
- Download the attached certificate renewal tool file: tca2.3-cluster-cert-renew.tar.gz.
Note: For Airgap environments, manually SCP the file over to the TCA-CP:
- Untar the tca2.3-cluster-cert-renew.tar.gz:
tar -zxvf tca2.3-cluster-cert-renew.tar.gz
- Renew the workload cluster certificate:
cd /home/admin/cluster-cert-renew
bash cert-renew -wc workload-cluster-name -mc mgmt-cluster-name -t workload
Note: Replace workload-cluster-name and mgmt-cluster-name with the actual values in the command provided.
- Verify the new workload cluster certificate has been stored on the management cluster:
kubectl config use-context mgmt-cluster-name-admin@mgmt-cluster-name
kubectl get secret workloadcluster-name-kubeconfig -n workloadcluster-name -ojsonpath='{.data.value}' | base64 -d
Note: Replace mgmt-cluster-name-admin and mgmt-cluster-name and workloadcluster-name with the actual values in the command provided.
Renew the Management Cluster Certificates
- SSH into the TCA-CP and switch to the sudo user:
ssh admin@tca_cp
su –
Note: Replace tca_cp with the IP of the TCA-CP where the management cluster is configured in the command provided.
- Download the cluster-cert-renew scripts tar to TCA-CP:
curl -kfsSL https://packages.broadcom.com/artifactory/tca-distro/kb/20230413/cluster-cert-renew.tar.gz
- Untar the cluster-cert-renew.tar.gz and change to the cluster-cert-renew directory:
tar -zxvf cluster-cert-renew.tar.gz
cd /home/admin/cluster-cert-renew
- Obtain the Control Plane node IP
kubectl get nodes -owide | grep control-plane | awk '{print ""$6""}' | head -n 1
- Renew the management cluster certificate.
bash cert-renew -mc mgmt-cluster-name -t management -ip control-plane-node-ip
Synchronize the kubeconfig for the TCA-Manager (TCA-M) and TCA-CP.
- To generate an authentication token on TCA 2.3, you can POST the following API call from any machine that has access to the TCA-M web layer. This can be executed from the TCA-M Manager, TCA-CP, or any other Linux VM with access to the TCA-Manager.
Note: Steps 1 through 4 should be applied only to TCA-M, not to TCA-CP.
- curl -D - --location --insecure --request POST 'https://tca-m-url/hybridity/api/sessions' --header 'Accept: application/json' --header 'Content-Type: text/plain' --data-raw '{"username": "username","password": "plain_text_password"}'
Note: Replace tca-m-url and username and plain_text_password
- Take note of the x-hm-authorization UUID from the output of the previous step.
- Update the TCA-M and TCA-CP database by synchronizing the kubeconfig:
curl --location --insecure --request POST 'https://tca-m-fqdn/telco/api/caas/v2/clusters/cluster_name/syncKubeconfig' --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'x-hm-authorization: auth-token'
Note: Replace tca-m-fqdn and cluster_name and auth-token with the actual values in the command provided.
- To ensure that the operation succeeds, run the following API call:
curl --location --insecure --request GET 'https://tca-m-fqdn/hybridity/api/jobs/job_id_from_above_response' --header 'Accept: application/json' --header 'x-hm-authorization: auth-token'
Note: Replace tca-m-fqdn, auth-token, and job_id_from_above_response with the actual values in the command provided.
Note: Take note of the isDone and didFail flags in the json. The isDone flag should return true and the didFail flag should return false.
- SSH login to TCA-CP to restart the services:
ssh admin@tca-cp
su -
Note: tca-cp where the cluster is configure
- Restart the following TCA-CP services:
systemctl restart app-engine
systemctl restart web-engine
Note:
All (upgraded and non-upgraded) Clusters require the kubeconfig to be synchronized.
In case of multiple TCA-CPs (i.e one for Mgmt cluster & one for Workload cluster) the app & web services should be started from both.