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.
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.
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 usingJobHistoryLimits
.successfulJobHistoryLimit
to0
failedJobHistoryLimit
to0
ref: k8s docs on cronjobs