2

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

Here_2_learn
  • 5,013
  • 15
  • 50
  • 68
  • Are you saying you have no associated replication controller or deployment, or deployment config? – Graham Dumpleton Sep 05 '17 at 05:56
  • It is associated with deployment config, with replicas set to 1 and restartPolicy: Always. Is this the info you are looking for? – Here_2_learn Sep 05 '17 at 12:02
  • Hi @Here_2_learn I suggest you get yourself familiarized with the [core concepts of OpenShift and Kubernetes](https://docs.openshift.com/enterprise/3.2/architecture/core_concepts/index.html). You probably want to either delete or scale down the DeploymentConfig. – mhutter Sep 05 '17 at 12:55

1 Answers1

7

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

luciddreamz
  • 2,073
  • 14
  • 15