deleting pods from cronjob

 Sometimes after your k8s cronjob runs, you will get some pods left with completed but terminated state. 

In order to remove these pods, you can configure these history to be removed via yaml 

spec: 
    failedJobsHistoryLimit: 0
    successfulJobsHistoryLimit: 0


You can also delete by running the following command:  

kubectl delete pod --field-selector=status.phase==Succeeded


Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm