MrE
MrE

Reputation: 20808

Kubernetes clean up failed containers

Is Kubernetes taking care of cleaning up failed/stopped containers at some point?

It doesn't seem like it and it can pile up.

I know how to clean them up manually but i wonder if there is a setting to automate it.

Upvotes: 1

Views: 1180

Answers (1)

Prashanth B
Prashanth B

Reputation: 5113

It's good practice to first check the docs site before posting a question. Kubernetes does handle container GC, quoting from the docs page:

We also allow users to customize garbage collection policy, basically via following three flags.

  • minimum-container-ttl-duration, minimum age for a finished container before it is garbage collected. Default is 1 minute.
  • maximum-dead-containers-per-container, maximum number of old instances to retain per container. Default is 2.
  • maximum-dead-containers, maximum number of old instances of containers to retain globally. Default is 100.

Upvotes: 2

Related Questions