spring-cloud-deployer-kubernetes
spring-cloud-deployer-kubernetes copied to clipboard
Revisit LoadBalancer deletion logic
Current logic of deleting LoadBalancer
service during undeploy have few issues.
- We should not silently eat
InterruptedException
as it may be a signal that this task should be aborted. This happens if this is run within cancellable task inTaskExecutor
. - We wait
LoadBalancer
to go away which will never happen as we never ask to delete it. - For example with
minikube
, there's no realLoadBalancer
while service itself is created. When service response have emptyLoadBalancer
,svc.getStatus().getLoadBalancer().getIngress().isEmpty()
will always return true, thus we always wait.
https://github.com/spring-cloud/spring-cloud-deployer-kubernetes/blob/078cedc3649d857480a0fe6e2de73a91f3b5268f/src/main/java/org/springframework/cloud/deployer/spi/kubernetes/KubernetesAppDeployer.java#L174-L198
We would have to look into to see why it was decided to confirm that the objects are actually deleted from the K8s cluster. This may not be necessary after all.