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

<p>It doesn't seem like it and it can pile up.</p>

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

<p>It's good practice to first check the <a href="http://kubernetes.io/v1.1/docs/admin/garbage-collection.html" rel="nofollow">docs site</a> before posting a question. Kubernetes does handle container GC, quoting from the docs page:</p>

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

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