Add option to specify log-opt max-size value for docker containers
Bug #1794249 reported by
Eric Miller
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla-ansible |
Fix Released
|
Undecided
|
Doug Szumski |
Bug Description
Using Rocky, 7.0.0.0rc1 release of Kolla Ansible...
This is really a wish list item, and maybe there is a way to do it already, so I thought I'd ask.
Docker logs will fill up disks pretty quickly, especially with fluentd and swift-object-server containers (from what we have seen so far).
There is an option "--log opt max-size=XXXX" as describe here:
https:/
This would allow logs to roll and keep them at bay.
I think this we be added to the containers' configs at the kolla-build stage? Or is there an on-demand method for adding this option after completing a deployment?
Eric
Changed in kolla-ansible: | |
assignee: | nobody → Doug Szumski (dszumski) |
To post a comment you must log in.
I hadn't scrolled up to the top of that page, which indicates that Docker has a global option for enabling the JSON file logging driver by creating /etc/docker/ daemon. json with:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "10"
}
}
in it - so I am trying that now. If this works, I have answered my own question. :)
It doesn't seem to have taken effect on existing containers, after a container restart - so this may need to be added to the kolla-ansible baremetal bootstrap component here (before the "Start docker" task): /github. com/openstack/ kolla-ansible/ blob/master/ ansible/ roles/baremetal /tasks/ post-install. yml
https:/
Eric