root@Supervisor [ ~ ]# k get services -n <vsphere-namespace> --no-headers | grep -E "tkc-.*LoadBalancer" | grep -v "-control-plane-service" | wc -l
3
root@tkc-#####-#####:~# k get services -A --no-headers | grep LoadBalancer | wc -l
2
VMware vSphere with Kubernetes
A cause observed in the past is when corresponding required finalizers on services resources were removed within the Guest Cluster, hence vSphere Supervisor is not informed about service removal.
To get them back in sync, first the differences must be identified. Then, if Supervisor has more services any leftovers need to be deleted from the vSphere Supervisor.
Note: If there are any further questions or concerns, please consult with Broadcom Support prior deleting the virtualmachineservice resource.
Steps:
root@SV [ ~ ]# kubectl get services -n <vsphere-namespace> --no-headers | grep -E "tkc-.*LoadBalancer"From this Supervisor perspective, there are 4 services of type LoadBalancer. The service "tkc-control-plane-service" is solely on the Supervisor and must not be deleted. Hence, 3 relevant services in total.
tkc-0###################a LoadBalancer ##.##.##.10 ##.##.##.200 1337/TCP 137m
tkc-1###################b LoadBalancer ##.##.##.11 ##.##.##.210 1337/TCP 128d
tkc-2###################c LoadBalancer ##.##.##.12 <pending> 1337/TCP 137m
tkc-control-plane-service LoadBalancer ##.##.##.1 ##.##.##.220 6443/TCP 135d --> OK and expected
root@SV [ ~ ]# kubectl get services -n <vsphere-namespace> --no-headers | grep -E "tkc-.*LoadBalancer" | grep -v "control-plane-service" | wc -l
3
root@tkc-#####-#####:~# kubectl get services -A --no-headers | grep LoadBalancer
test-namespace app-1 LoadBalancer ##.##.##.12 <pending> 1337:8080/TCP 137m
test-namespace app-2 LoadBalancer ##.##.##.10 ##.#.##.200 1337:8080/TCP 137m
root@tkc-#####-#####:~# kubectl get services -A --no-headers | grep LoadBalancer | wc -l
2
From this Guest Cluster perspective, there are 2 services in total.
root@SV [ ~ ]# kubectl describe virtualmachineservice -n test-namespace tkc-1###################b
Name: tkc-1###################b
Namespace: test-namespace
Labels: run.tanzu.vmware.com/cluster.name=tkc
run.tanzu.vmware.com/service.name=web-app-http
run.tanzu.vmware.com/service.namespace=webapp
[...]
Spec:
Ports:
Name: http
Port: 1337
Protocol: TCP
Target Port: 8080
[...]
Status:
Load Balancer:
Ingress:
Ip: ##.##.##.210
kubectl delete virtualmachineservice -n <vsphere-namespace> tkc-1###################b=