shutting down kubernetes pod without using job

5/16/2018

I have a pod running and I have a hard time creating a job.yaml file that successfully does all the things I want it to do. Is there a way for me to shutdown the kubernetes pod without calling kubectl delete jobs? I looked into kubectl stop pods but its been deprecated.

Also, is it bad to just keep a pod running even if there is no computation happening?

-- Jonathan
kubectl
kubernetes

1 Answer

5/16/2018

The correct way to stop a pod is simply deleting it.

kubectl delete po <pod name> -n <namespace>

Please be aware that if the pod was created by a job, it will likely be recreated automatically, so you should update the job spec before actually deleting the pod.

As per the second question, having a Pod that does nothing is not a problem for kubernetes, but of course it's a waste of resources and you should avoid it.

-- whites11
Source: StackOverflow