kubectl vsphere login --server=https://<current Workload Management Supervisor control plane endpoint>
ERRO[YYYY-MM-DD HH:MM:SS] Error occurred during HTTP request: Get "https://<current Workload Management Supervisor control plane endpoint>/wcp/loginbanner": tls: failed to verify certificate: x509: certificate is valid for <old Workload Management Supervisor control plane endpoint>, not <current Workload Management Supervisor control plane endpoint>
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" -A1This 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 svc -A | grep "control-plane"kubectl get deployments -n vmware-system-netop
kubectl get deployments -n vmware-system-akokubectl scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=0
kubectl scale deployment vmware-system-ako-ako-controller-manager --replicas=0 -n vmware-system-akoNavigate to the Avi Load Balancer UI > Templates > Policies > L4 Policy Set in in a web browser
vi correct-svcs.sh
#!/usr/bin/bash
filename="$1"
while IFS=' ' read -r f1 f2 f3; do
kubectl 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 scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=<count from Step 4>
kubectl scale deployment vmware-system-ako-ako-controller-manager --replicas=<count from Step 4> -n vmware-system-akokubectl get svc -n <virtual service namespace>
Note: If you are using versions above vCenter 8.0u3E and Supervisor cluster version 1.29.7 and stil hitting the issue, you may be hitting this condition:
After an operation that triggers a reconcoliation cycle accross all kubernetes components, such as supervisor upgrade, gateway objects for the guest clusters can be created but may fail to carry over the existing, dynamically leased IP addreses due to the blocking virtual service under AVI.
In that situation you can follow the below resolution. In this case the gateway object is updated with the cluster's controlPlaneEndpoint:
kubectl get cluster -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.controlPlaneEndpoint.host}{"\n"}{end}'kubectl get gateway -n <NAMESPACE> <CLUSTER_NAME> -o yamlkubectl get deployments -n vmware-system-netop
kubectl get deployments -n vmware-system-akokubectl scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=0
kubectl scale deployment vmware-system-ako-ako-controller-manager --replicas=0 -n vmware-system-akokubectl patch gateway -n <NAMESPACE> <CLUSTER_NAME> --type=merge -p '{"spec":{"addresses":[{"type":"IPAddress","value":"<ORIGINAL_IP>"}]}}'NOTE: kubectl patch gateway may fail if the IP is already allocated in AVI. In this situation, AVI support is required to assist with manual IPAM adjustments. See "Configuring Avi Load Balancer IPAM".
kubectl scale deployment vmware-system-netop-controller-manager -n vmware-system-netop --replicas=<count from Step 4>
kubectl scale deployment vmware-system-ako-ako-controller-manager --replicas=<count from Step 4> -n vmware-system-ako