<p>Is it required to clean up docker logs in AKS/Kubernetes? Or even more simple, it is possible to set a maximum log-size in AKS?</p>

BendEg
<p>Short answers:</p>
<ul>
<li><p>No, you don't have to clean up the docker logs yourself.</p>
</li>
<li><p>Yes, there is a way to set a maximum log-size but it is not an officially supported method.</p>
</li>
</ul>
<p>There is a config in <code>/etc/docker/daemon.json</code> that is responsible for log rotation. See the example below:</p>
<pre><code>{
  &quot;live-restore&quot;: true,
  &quot;log-driver&quot;: &quot;json-file&quot;,
  &quot;log-opts&quot;:  {
     &quot;max-size&quot;: &quot;50m&quot;,
     &quot;max-file&quot;: &quot;5&quot;
  }
}
</code></pre>
<p>You can change those values but it would not be persistent due to the fact that node can be replaced on scale or upgrade operations. There is a workaround however. You can use <a href="https://github.com/juan-lee/knode" rel="nofollow noreferrer">knode</a> in order to change the node configuration:</p>
<blockquote>
<p>knode uses a kubernetes daemonset for node configuration.</p>
</blockquote>
<p>More details regarding it can be found in the <a href="https://github.com/juan-lee/knode" rel="nofollow noreferrer">linked page</a>.</p>
<p>Please let me know if that helps.</p>
