ingress-nginx-log-persistent
This project provide a solution to record and rotate all logs of nginx-ingress-controller.
Features
When you deploy ingress-nginx according to the template in ./example , you will find that:
- logs of
nginx-ingress-controller
exists in/data/log/nginx-ingress-controller/
in your hosts - nginx's log :
access.log
anderror.log
exists in/data/log/nginx-ingress-controller/
in your hosts - logrotate configuration will inject into sidecar container of
ingress-nginx
and will take effect toaccess.log
anderror.log
Design
- change some args of
ingress-nginx
- add initContainer to add permission of log of
ingress-nginx
, which is belong to user 101 (www-data
) - add sideCar to do log rotate
If you are interested, welcome to read my blog .
Build
You can build a image : adddirperm
by execute docker build -t XXX -f ./Dockerfile .
in addDirPerm .
You can build a image : logrotate
by execute docker build -t XXX -f ./Dockerfile .
in logrotate .