All cluster, nodepool, and Network Function (NF) operations require a secure trust to vCenter via a vSphere certificate thumbprint.
Below error is observed in TCA when there is a mismatch in the VC thumbprint:
[VcSessionEstablishmentFailed] vmconfig status is Failed, nodeconfig status is Normal.vmconfig failed: plugin placementPlugin check failed: POST "/sdk": 503 Service Unavailable
After renewing/replacing vCenter Certificate, the following steps must be followed to restore functionality to TCA 2.X
kubectl get VCenterPrime -A
kubectl edit VCenterPrime -n <namespace> <cr_name>
SSH into the management cluster control plane VIP with capv
Run the following command and note the CR name and namespace:
kubectl get VCenterPrime –A
kubectl edit VCenterPrime -n <namespace> <cr_name>
Change the "thumbprint" field to match the correct thumbprint from step 1.
apiVersion: telco.vmware.com/v1alpha1 kind: VCenterPrime metadata: name: vcprime-mgmt-cluster01 namespace: tca-system spec: server: address: 10.#.#.# ===> verify the correct vCenter credentialRef: kind: Secret name: vcprime-mgmt-cluster01-secret namespace: tca-system subConfig: datacenter: tcpscale-VMCCloudDC thumbprint: AB.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.## ===> change here
Login to TCA-M/TCA-CP manage page with tca-m/tca-cp:9443
Re-import the new vCenter TLS thumbprint by “Administration” -> Certificate -> Trusted CA Certificate -> Click the “Import” button
If vCenter Certificate was changed for a stretch cluster environment:
kubectl get secret -A | grep cpi-addon
Save original CPI vSphere configure to temporary file
kubectl get secret -n tkg-system {mgmt-cluster-name}-vsphere-cpi-addon -o jsonpath='{.data.vsphereconf-custom\.lib\.txt}' |base64 -d >/tmp/vsphereconf.txt
Update the CPI vSphere config with new thumbprint in the temporary file
Sample as following of CPI vsphere config:
[root@tca /home/admin]# vim /tmp/vsphereconf.txt ((@def vsphere_conf(): -@) [Global] user = "administrator@vsphere.local" password = "Password" port = "443" datacenters = "test-dc, cellsite-dc" [VirtualCenter "10.x.x.x"] datacenters = "test-dc" thumbprint = "CD.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##" ===> change to new thumbprint ip-family = "ipv4" [VirtualCenter "sc2-10-185-10-130.example"] datacenters = "cellsite-dc" thumbprint = "EF.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##" ip-family = "ipv4" [Workspace] server = "10.x.x.x" datacenter = "test-dc" thumbprint = "CD.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##" ===> change to new thumbprint ip-family = "ipv4"
export encoded_vsphereconf_content=`base64 -w 0 /tmp/vsphereconf.txt`
kubectl patch secret {mgmt-cluster-name}-vsphere-cpi-addon -n tkg-system -p '{"data": {"vsphereconf-custom.lib.txt":"'${encoded_vsphereconf_content}'"}}'
kubectl -n kube-system get cm vsphere-cloud-config -o yaml
kubectl rollout restart ds/vsphere-cloud-controller-manager -n kube-system
vSphere TLS Thumbprint may also be included in the vspherecluster CR and in some cases must be updated in both management and all workload cluster contexts.
Verify if thumbrpints are being used with the following command:
kubectl get vsphereclusters -A | grep -v READY | awk '{print $1,$2}' | while read namespace cluster ; do kubectl get vsphereclusters -n $namespace $cluster -o yaml | grep thumbprint ; done
SSH into management cluster control plane VIP with capv
List all the vsphereclusters including the management cluster:
kubectl get vsphereclusters -A
NAMESPACE NAME AGE
default-ns tkg-test-workload 62d
default-ns tkg-wld 83d
tkg-system tkg-mgmt-cluster 83d
kubectl edit vsphereclusters -n default-ns tkg-test-workload
kubectl get vsphereclusters -n default-ns tkg-test-workload -o yaml
Note: For management clusters, use the tkg-system namespace to the kubectl commands:
kubectl edit vsphereclusters -n tkg-system tkg-mgmt-cluster