<p>I am running Kubernetes in GCP and since updating few months ago (now I am running <code>1.17.13-gke.2600</code>) I am observing trailing replicasets and pods after deployment deletion. Consider state before deletion:</p>
<pre><code>$ k get deployment | grep parser
parser-devel                              1/1     1       1        38d
$ k get replicaset | grep parser
parser-devel-66bfc86ddb                   0       0       0        27m
parser-devel-77898d9b9d                   1       1       1      5m49s
$ k get pod | grep parser
parser-devel-77898d9b9d-4w48w             1/1     Running 0       6m2s
</code></pre>
<p>Then I delete the deployment:</p>
<pre><code>$ k delete deployment parser-devel
deployment.apps &quot;parser-devel&quot; deleted
$ k get replicaset | grep parser
parser-devel-66bfc86ddb                   0       0       0        28m
parser-devel-77898d9b9d                   1       1       1       7m1s
$ k get pod | grep parser
parser-devel-77898d9b9d-4w48w             1/1     Running 0       7m6s
</code></pre>
<p>Then I try to delete the replicasets:</p>
<pre><code>$ k delete replicaset parser-devel-66bfc86ddb parser-devel-77898d9b9d
replicaset.apps &quot;parser-devel-66bfc86ddb&quot; deleted
replicaset.apps &quot;parser-devel-77898d9b9d&quot; deleted
$ k get pod | grep parser
parser-devel-77898d9b9d-4w48w             1/1     Running 0      8m14s
</code></pre>
<p>As far as I understand Kubernetes, this is not a correct behaviour, so why it is happening?</p>

Vojtěch
<p>How about check ownerReference of the ReplicaSet created by you Deployment ? Refer <a href="https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#owners-and-dependents" rel="nofollow noreferrer">Owners and dependents</a> for more details. For example, for removing dependencies of the Deployment, the Deployment name and uid should be matched exactly in the ownerReference ones. Or I have experience that similar issue happened, if Kuerbetenes API was somthing wrong. So API service restart may help to resovle it.</p>
<pre><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
  ...
  ownerReferences:
  - apiVersion: apps/v1
    controller: true
    blockOwnerDeletion: true
    kind: Deployment
    name: your-deployment
    uid: xxx
</code></pre>
