Here_2_learn
Here_2_learn

Reputation: 5451

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

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

Upvotes: 3

Views: 15471

Answers (1)

luciddreamz
luciddreamz

Reputation: 2093

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

Upvotes: 8

Related Questions