-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Is your feature request related to a problem? Please describe.
The nginx access log is enabled by default which writes to /var/log/nginx/access.log. The problem is logrotate/cron binary is absent in the container as well as the default nginx logrotate config seems invalid.
/etc/logrotate.d # cat nginx
/var/log/nginx/*.log {
missingok
sharedscripts
postrotate
/etc/init.d/nginx --quiet --ifstarted reopen -> This nginx binary does not exist.
endscript
}
This causes the log the grow exponentially and pod is evicted once it reaches threshold and even might cause disk pressure issues in nodes itself. I saw the access.log grow to 27gb in just few weeks.
Describe the solution you'd like
- First, real solution is to update the image so that log rotation works for the nginx logs.
- Second, straight forward solution is to allow the access logging to be disabled from helm values file in case one does not need the logging.
Describe alternatives you've considered
For now we are using a manual patch to disable the access logging before startup script run as follows.
kubectl -n $namespace patch deployment $deployment_name --type='json' -p='[
{
"op": "replace",
"path": "/spec/template/spec/containers/0/args",
"value": ["-c", "sed -i \"s|access_log.*|access_log off;|\" /etc/nginx/nginx.conf && /app/startup.sh"]
}
]
Additional context
Tested in latest tag : 1.1.12
Metadata
Metadata
Assignees
Labels
No labels