<p>After some time, I have problems with some of our clusters where auto-delete of orphaned resources stop working. So if I remove a deployment nor the replicaset or the pods are removed, or if I remove a replicaset, a new one is created but the previous pods are still there.
I can't even update some deployments because that will create a new replicaset+pods.</p>
<p>This is an actual problem as we are creating and removing some resources and relying on auto-child removal.</p>
<p>The thing is that, destroying and creating again a cluster makes it working perfectly and we weren't able to trace to something we did that caused the problem.</p>
<p>I tried to upgrade both master and agent nodes to a newer version and restarting kubelet in agent nodes but that doesn't solve anything.</p>
<p>Could anyone knows where could be the problem or which component is in charge of the cascade deletion of orphan resources?</p>
<p>Does this happen to someone else? It happend to us already in 3 different clusters with different Kubernetes version.</p>
<p>I have tested it creating the test deployment in K8s documentation, and then delete it:</p>
<pre><code>kubectl apply -f https://k8s.io/examples/application/deployment.yaml

kubectl delete deployments.apps nginx-deployment
</code></pre>
<p>But the pods are still there.</p>
<p>Thanks in advance</p>

<p>The problem was caused by a faulty CRD / Admission Webhook. It could seem strange, but a wrong CRD or a faulty pod acting as webhook will make kube-controller-manager fail for all resources (at least in AKS). After removing the CRD's and the faulty webhook it started to work again. (The reason why the webhook was failing is another different thing)</p>
