[root@worker1:~# kubectl vsphere login --server=https://<redacted>ERRO[YYYY-MM-DD HH:MM:SS] Error occurred during HTTP request: Get "https://<####>/wcp/loginbanner": tls: failed to verify certificate: x509: certificate is valid for <####>, not <####>There was an error when trying to connect to the server.Please check the server URL and try again.
This is a known issue caused by the environment's AVI-AKO build version included with the vCenter and Supervisor cluster.
Following scenarios can lead to a change in IP address of the control-plane services.
This issue is resolved in vCenter 8.0u3E and Supervisor cluster version 1.29.7.
Workaround: The IP addresses for the services will need to be reverted to the original IPs, and virtual services deleted to be recreated within AVI.
Steps to restore IP in both VDS and NSX WCP deployments:
kubectl get service -A | awk '/LoadBalancer/ {print $1,$2,$5}' > svcs.txtSteps to Validate from AVI Web UI:
In the AVI web UI, navigate to Operations
Click on Config Audit Trail on the left
With the magnifying glass, search for the name of the affected service
The next CONFIG_CREATE event has the details of the current, incorrect IP address
In the Supervisor cluster context, use the below command to get a list of the Control Plane Endpoint IPs for each affected workload cluster:kubectl get cluster -o yaml -A | egrep -i "cluster-name|endpoint" -A1
This endpoint is equivalent to the External IP address of each <cluster-name>-control-plane-service LoadBalancer service for the affected workload cluster(s).
kubectl get svcs -A | grep "control-plane"kubectl get deployments -n vmware-system-netopkubectl scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=0Navigate to the Applications tab in AVI web UI in a web browser
vi correct-svcs.sh
#!/usr/bin/bashfilename="$1"while IFS=' ' read -r f1 f2 f3; dokubectl get gateway "$f2" -n "$f1" -oyaml | sed 's/addresses: \[\]/addresses:\n - type: IPAddress\n value: '"$f3"'/1' | kubectl replace -f -done < "$filename"
chmod 777 correct-svcs.sh./correct-svcs.sh svcs.txtkubectl rollout restart deploy -n vmware-system-akokubectl scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=<count from Step 4>kubectl get svc -n <virtual service namespace>