I have a script within my docker image which checks for the number of available PVs in my kubernetes cluster. If we are short in pv, the script exit 1 and if we are good, then it will return 0. I want to trigger this deployment from Jenkins every 15 min, so when the job gets triggered, it gets the result of kuberentes job deployment. if the status is error then page the team. My problem is that I cannot re-run the Kubernetes job without removing the old job - if this is not possible, what do you guys suggest would be the best to achieve this task? I do not want to use the cronjob cause then I will somehow have to monitor the cornjob and make sure it is always running. thanks
Asked
Active
Viewed 97 times
0
-
If you did use a Kubernetes CronJob, it would create a new Job every iteration with a timestamped name, and clean up older jobs. Replicating that pattern might make sense for you, if for some reason you can't use a CronJob directly. – David Maze Dec 21 '20 at 18:24
-
thanks David. I guess there is no easy way of automating the whole process. If I end up setting up cronjob then I need something to monitor the cron and make sure it is running. – Nova Dec 22 '20 at 17:53