'Kubernetes deployment
I have deployed a pod in kubernetes cluster that run a python script.
The problem is i want to force the k8s to stop the container after the script complete his job and not to re-create another pod.
To be aware that i have tried to use kind:job but it doesn't fulfill my need.
I tried two types of kind, job and deployments.
With the deployment the pod always show status first completed after that crush with crashloopbackof error.
With the job the pod always show the status completed but i don't have the possibility to re-excute it with an automated way
Do you have any suggestions about that?
Solution 1:[1]
I have posted community wiki answer to summarise the topic.
User Jonas has posted great suggestions:
A kind
Jobdoes exactly this. UseJoband your problem is solved.
If you deploy with
kubectl create -f job.yamland your job has agenerateName:instead ofname:, a newJobwill be created each time.
For more information look at the documentation about Jobs. See also information about Gnerated values.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
