docker-logrotate
docker-logrotate copied to clipboard
logrotate has no permit to rotate the log files in /logs
error: skipping xxx because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation
FYI I just ran into the same issue, and came here to see if anyone else had too (or had a solution). Seems like there could be an easy fix to this project, but in the meantime an init container does the trick:
initContainers:
- name: init-permissions
image: busybox:latest
command: ['sh', '-c', 'chmod 755 /logs']
volumeMounts:
- name: whatever
mountPath: /logs
But perhaps the better suggestion is to use the very similar and more flexible: https://github.com/blacklabelops/logrotate