csye7125-fall2023-group05 / k8s-operator

Custom operator to create a controller that monitors a custom resource (CronJob) that runs a health check Kafka Producer and publishes the data to the Kafka brokers.
0 stars 1 forks source link

❌ Delete CronJob pods when status is complete #20

Closed sydrawat01 closed 10 months ago

sydrawat01 commented 10 months ago

After the cronjob completes, the pod it creates to run the producer is still present on the cluster, with a status of Complete. This pod needs to be removed using JobHistoryLimits.

The .spec.successfulJobsHistoryLimit and .spec.failedJobsHistoryLimit fields are optional. These fields specify how many completed and failed jobs should be kept. By default, they are set to 3 and 1 respectively. Setting a limit to 0 corresponds to keeping none of the corresponding kind of jobs after they finish.

ref: k8s docs on cronjobs