Kubernetes: How to delete PODs based on age/creation time

后端 未结 3 2077
执念已碎
执念已碎 2020-12-30 07:51

Is it possible to delete POD in kubernetes based on creation time or age?

Example : I would like to delete all PODs which are older than 1 day. These PODs are orpha

3条回答
  •  星月不相逢
    2020-12-30 08:15

    You can either add a liveness probe to track how long the pod alive and kill it when it's longer a certain period. Or you can schedule a CronJob

提交回复
热议问题