Clean k8s cronjob and its running pods

12/20/2016

I encountered one weird cleanup issue in k8s when cleaning up CronJob and its associated running Pods. Look like some component created a new Pod when i did the following:

  1. Delete the CronJob by using REST API of k8s
  2. Delete the Pod by using REST API of k8s

What I expected after doing 1) and then 2), there will be no CronJob Pod will be running. But i observed:

  1. The CronJob has been deleted
  2. The existing running Pods are deleted also
  3. A new CronJob Pod is created by some component in k8s

I am wondering if the steps to clean up CronJob and its Pods is correct and which component in k8s creates the new CronJob Pod ?

-- Ken Chen
cron
kubernetes

0 Answers