Replicaset and Pods not deleted after Deployment has been deleted

Cluster information:

Kubernetes version: 1.27.2
Cloud being used: baremetal
Installation method: kubeadm
Host OS: Ubuntu 20.04.4 LTS
CNI and version: calico v3.26.0
CRI and version: containerd v1.6.2

Dummy NGINX Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: stacksimplify/kube-nginxapp1:1.0.0
        ports:
        - containerPort: 80

Output after deploying

NAME                                              READY   STATUS    RESTARTS   AGE
pod/nginx-deployment-7d94b5f487-7q2hd             1/1     Running   0          8s

NAME                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nginx-deployment             1/1     1            1           8s

NAME                                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-deployment-7d94b5f487             1         1         1       8s

After i run kubectl delete deploy nginx-deployment

NAME                                              READY   STATUS    RESTARTS   AGE
pod/nginx-deployment-7d94b5f487-7q2hd             1/1     Running   0          5m22s

NAME                                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-deployment-7d94b5f487             1         1         1       5m23s

Even if i run kubectl delete deploy nginx-deployment --cascade=background, the replicasets and pods does not get deleted.

How should I proceed with this?

Thank you!

I’m afraid I can’t reproduce your problem - and if I could it would be a P0 “stop everything” sort of bug.

Can you post a more complete transcript?

get types … # prove that nothing exists
create deployment
sleep 10
get types … # prove stuff is running
delete deployment
sleep 10
get types … # see what happened

if anything remains, kubectl describe them

@thockin

This was resolved by upgrading Calico from v3.26.0 to v3.26.1.

Just curious how does calico has something to do with kubernetes resource uninstalls?