@Veronika Bulavina , adding on to @Pradeep Kommaraju 's answer,
The reason is a little misleading in this Service event. DeleteLoadBalancer
operation from the Azure cloud controller manager actually refers to the cloud controller manager trying to remove the dynamic Public IP address associated with a Service of type LoadBalancer (public) when the Service is set to be deleted. This is default behaviour with Service objects using dynamic public IP addresses in Azure as mentioned here:
By default, the public IP address assigned to a load balancer resource created by an AKS cluster is only valid for the lifespan of that resource. If you delete the Kubernetes service, the associated load balancer and IP address are also deleted. If you want to assign a specific IP address or retain an IP address for redeployed Kubernetes services, you can create and use a static public IP address.
This is because, by default the following finalizer gets added to the Service object if no static IP address is configured to be used:
finalizers:
- service.kubernetes.io/load-balancer-cleanup
You can verify this using:
kubectl get svc <service-name> -n <namespace> -o yaml
If you add a static IP address with service.spec.loadBalancerIP
this finalizer is not added to the Service object.
Thus, if the lock on the node resource group (default: MC_resourcegroupname_clustername_location) of the AKS cluster, is an absolute necessity for your use case, you might want to use Static public IP address with the Azure Kubernetes Service (AKS) load balancer. This will ensure that the Service object is deleted and the Public IP address is released but not removed, thus honoring your Delete
lock on the node resource group.
----
P.S: If you are currently stuck with a Service that is being held up in terminating state due to this, please perform the following actions:
----
Hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.