<p>I want to ask why the Kubernetes networking driver <a href="https://www.weave.works/docs/net/latest/overview/" rel="nofollow noreferrer">weave</a> container is generating a lot of logs?</p>
<p>The log file size is 700MB after two days.</p>
<p>How can I solve that?</p>

<h2 id="logs-in-kubernetes">Logs in kubernetes</h2>
<p>As it was said in comment, kubernetes is not responsible for log rotation. This is from kubernetes documentation:</p>
<blockquote>
<p>An important consideration in node-level logging is implementing log
rotation, so that logs don't consume all available storage on the
node. Kubernetes is not responsible for rotating logs, but rather a
deployment tool should set up a solution to address that. For example,
in Kubernetes clusters, deployed by the kube-up.sh script, there is a
logrotate tool configured to run each hour. You can also set up a
container runtime to rotate an application's logs automatically.</p>
</blockquote>
<p>As proposed option, this can be managed on container's runtime level.</p>
<p>Please refer to <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#logging-at-the-node-level" rel="nofollow noreferrer">Logging at the node level</a>.</p>
<h2 id="reducing-logs-for-weave-cni">Reducing logs for Weave CNI</h2>
<p>There are two containers in each pod. Weave itself and weave-npc (which is a network policy controller).</p>
<p>By default weave's log level is set to INFO. This can be changed to WARNING to see only exceptions. This can be achieved by adding <code>--log-level</code> flag through the <code>EXTRA_ARGS</code> environment variable for the weave:</p>
<pre><code>$ kubectl edit daemonset weave-net -n kube-system
</code></pre>
<p>So <code>weave container</code> part should look like:</p>
<pre><code>spec:
  containers:
  - command:
    - /home/weave/launch.sh
    env:
    - name: HOSTNAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: EXTRA_ARGS # this was added with value below!
      value: --log-level=warning
    - name: INIT_CONTAINER
      value: &quot;true&quot;
    image: docker.io/weaveworks/weave-kube:2.8.1
    imagePullPolicy: IfNotPresent
    name: weave 
</code></pre>
<p><a href="https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-reading-the-logs" rel="nofollow noreferrer">Weave - logs level</a>.</p>
<p>A lot of logs go from <code>Weave NPC</code>, there's an option that allows to <code>disable</code> NPC. However based on documentation this is a paid option based on their documentation - <a href="https://www.weave.works/product/cloud/" rel="nofollow noreferrer">cloud.weave.works</a></p>
<p><a href="https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-changing-configuration-options" rel="nofollow noreferrer">Weave - Changing configuration options</a></p>
