<p>I'm trying to rotate logs inside kubernetes by the way of using following code snippets:</p>
<pre><code>containers:
  - name: logrotate
    image: docker.io/kicm/logrotate
    securityContext:
      runAsUser: 0
    volumeMounts:
      - name: logrotate-conf
        mountPath: /etc/logrotate.d
volumes:
  - name: logrotate-conf
    configMap:
      name: logrotation-config
  - name: app-logs
    persistentVolumeClaim:
      claimName: my-var-pvc
restartPolicy: OnFailure
</code></pre>
<p>When the pod running stage, I've encountered following error:</p>
<pre><code>Potentially dangerous mode on /etc/logrotate.conf: 0664
error: Ignoring /etc/logrotate.conf because it is writable by group or others.
Reading state from file: /tmp/logrotate.status
Allocating hash table for state file, size 64 entries

Handling 0 logs
</code></pre>
<p>Please let me know how to fix that issue, thanks.</p>

PPShein
<p>If this is your image, rebuild it with proper permissions, push it to the regisrty and use it.</p>
<p>If this is not your image, think twice before using someone else's image (security reasons). You still think this is good idea to use someone's image? Build new image with changed permissions using this image as a base image, push it to registry and use it.</p>
