Is there an expected race condition when recreating a deleted LoadBalancer Service in Kubernetes?

Viewed 41

We've noticed a race condition when performing the following actions (on Azure Kubernetes Services):

  1. install a Service of type LoadBalancer (via a Helm chart, using helm install)
  2. delete the Service (using helm uninstall)
  3. recreate the Service (using helm install again)

As the Service has a finalizer, the Service will not really be deleted when the API server returns from step 1. Instead, it will only be marked for deletion. Therefore, if executed fast enough, step 2 will not recreate anything and in the end, there will be no Service even though the Helm chart seems to be installed.

I wonder if this is expected or if I should raise a bug report with Kubernetes (because, e.g., the API server should refuse to modify a service currently being deleted) or Helm (because, e.g., they should notice that the resource is currently deleted and therefore cannot be reinstalled).

0 Answers
Related