How to delete a pod in Openshift with restart policy set to always?

13.9k views Asked by At

Could be a basic one..

I have created a pod in Openshift Enterprise 3.2 with the configuration set as restartPolicy: Always . So ideally when the pod is destroyed Openshift will make sure to re-run/re-create the pod because of the restart policy.

Now I no longer need the pod. When I am trying to destroy the pod it is getting created again.

My question is What is the ideal way to destroy the pod with restartPolicy: Always

1

There are 1 answers

0
luciddreamz On BEST ANSWER

The deployment config (and related replication controller) is the reason your pod is getting recreated when you delete it. The replication controller's job is literally to "ensure that a specified number of replicas of a pod are running at all times."

To destroy the pod (and leave the deployment config and other resources intact, just run: oc scale dc <dc-name> --replicas=0