Kubernetes clean up failed containers

1/30/2016

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.

-- MrE
kubernetes

1 Answer

1/30/2016

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.
-- Prashanth B
Source: StackOverflow