[OCP4.x] Dependent objects are not deleted when deployment is removed

Solution Verified - Updated -

Issue

  • Dependent objects aren't deleted when the deployment is removed. The test is done as follows.
$ oc get all
No resources found in redhat-support namespace.

# created deployment in a test namespace

$ oc get all
NAME                           READY   STATUS    RESTARTS   AGE
pod/example-5fb6876865-84drd   1/1     Running   0          19s
pod/example-5fb6876865-tftmq   1/1     Running   0          19s
pod/example-5fb6876865-vqgtl   1/1     Running   0          19s

NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/example   3/3     3            3           19s

NAME                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/example-5fb6876865   3         3         3       19s

$ oc delete deployment.apps/example
deployment.apps "example" deleted

$ oc get all                                                                                                                             
NAME                           READY   STATUS    RESTARTS   AGE
pod/example-5fb6876865-84drd   1/1     Running   0          65s
pod/example-5fb6876865-tftmq   1/1     Running   0          65s
pod/example-5fb6876865-vqgtl   1/1     Running   0          65s

NAME                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/example-5fb6876865   3         3         3       65s
  • On a working server, it works as follows.
$ oc get all --show-labels
NAME                           READY   STATUS    RESTARTS   AGE   LABELS
pod/example-5fb6876865-4htzm   1/1     Running   0          25h   app=hello-openshift,pod-template-hash=5fb6876865
pod/example-5fb6876865-8brvj   1/1     Running   0          25h   app=hello-openshift,pod-template-hash=5fb6876865
pod/example-5fb6876865-kh7hd   1/1     Running   0          25h   app=hello-openshift,pod-template-hash=5fb6876865

NAME                                 DESIRED   CURRENT   READY   AGE   LABELS
replicaset.apps/example-5fb6876865   3         3         3       25h   app=hello-openshift,pod-template-hash=5fb6876865

$ oc delete all -l app=hello-openshift
pod "example-5fb6876865-4htzm" deleted
pod "example-5fb6876865-8brvj" deleted
pod "example-5fb6876865-kh7hd" deleted
replicaset.apps "example-5fb6876865" deleted

Environment

  • Red Hat OpenShift Container Platform
    • 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content