<p>I'm trying to delete a service I wrote &amp; deployed to Azure Kubernetes Service (along with required Dask components that accompany it), and when I run <code>kubectl delete -f my_manifest.yml</code>, my service gets stuck in the Terminating state. The console tells me that it was deleted, but the command hangs:</p>
<pre><code>&gt; kubectl delete -f my-manifest.yaml
service &quot;dask-scheduler&quot; deleted
deployment.apps &quot;dask-scheduler&quot; deleted
deployment.apps &quot;dask-worker&quot; deleted
service &quot;my-service&quot; deleted
deployment.apps &quot;my-deployment&quot; deleted
</code></pre>
<p>I have to <kbd>Ctrl</kbd>+<kbd>C</kbd> this command. When I check my services, Dask has been successfully deleted, but my custom service hasn't. If I try to manually delete it, it similarly hangs/fails:</p>
<pre><code>&gt; kubectl get services
NAME                TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)                      AGE
kubernetes          ClusterIP      x.x.x.x      &lt;none&gt;        443/TCP                      18h
my-service          LoadBalancer   x.x.x.x      x.x.x.x       80:30786/TCP,443:31934/TCP   18h

&gt; kubectl delete service my-service
service &quot;my-service&quot; deleted
</code></pre>
<p><a href="https://stackoverflow.com/questions/62240272/deleting-namespace-was-stuck-at-terminating-state">This question</a> says to delete the pods first, but all my pods are deleted (<code>kubectl get pods</code> returns nothing). There's also <a href="https://github.com/kubernetes/kubernetes/issues/66110" rel="nofollow noreferrer">this closed K8s issue</a> that says <code>--wait=false</code> might fix foreground cascade deletion, but this doesn't work and doesn't seem to be the issue here anyway (as the pods themselves have already been deleted).</p>
<p>I assume that I can completely wipe out my AKS cluster and re-create, but that's an option of last resort here. I don't know whether it's relevant, but my service is using <a href="https://learn.microsoft.com/en-us/azure/aks/internal-lb#create-an-internal-load-balancer" rel="nofollow noreferrer">the <code>azure-load-balancer-internal: &quot;true&quot;</code> annotation</a> for the service, and I have a webapp deployed to my VNet that uses this service.</p>
<p>Is there any other way to force shutdown this service?</p>

user655321
<p>I had a similar issue with a svc not connecting to the pod cause the pod was already deleted:</p>
<pre><code>HTTPConnectionPool(host='scv-name-not-shown-because-prod.namespace-prod', port=7999): Max retries exceeded with url: 
my-url-not-shown-because-prod (Caused by 
NewConnectionError('&lt;urllib3.connection.HTTPConnection object at 
0x7faee4b112b0&gt;: Failed to establish a new connection: [Errno 110] Connection timed out'))
</code></pre>
<p>I was able to solve this with the patch command:</p>
<pre><code>kubectl patch service scv-name-not-shown-because-prod -n namespace-prod -p '{&quot;metadata&quot;:{&quot;finalizers&quot;:null}}'
</code></pre>
<p>I think the service went into some illegal state and was not able to ricover</p>
