-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DPE-1799 Add rotation of mysqlrouter logs #143
Conversation
src/rock.py
Outdated
) | ||
layer = ops.pebble.Layer( | ||
{ | ||
"summary": "Logrotate dispatcher layer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: will this override the summary for mysql router service since they're using the same layer?
also to confirm, does override:replace within the service only override the logrotate service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/canonical/pebble#layer-specification indicates it only overrides the service with the same name. i ran a small test to confirm this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the summary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what you mean to ask. a summary is a field of the service object, and thus gets overwritten when replace: override
is specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it part of the service? it looks like it's part of the layer—and it seems like it will override the summary from the layer with the mysql router service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, i don't think the layer summary is overwritten/persisted in that way.
the following is the pebble plan:
root@mysql-router-k8s-0:/# pebble plan
services:
logrotate_executor:
summary: Logrotate executor
startup: enabled
override: replace
command: python3 /logrotate_executor.py
user: mysql
group: mysql
mysql_router:
summary: MySQL Router
startup: enabled
override: replace
command: mysqlrouter --config /etc/mysqlrouter/mysqlrouter.conf
user: mysql
group: mysql
there is no way to inspect the pebble layers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it isn't persisted, should we be writing it at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no way to inspect the pebble layers
I think there might be in the filesystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is possible that pebble keeps track of the summary of the layers, but it is not exposed to the user with any of the pebble commands. Either way, I removed the layer summary in 86e8516
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits
Issue
We do not currently have rotation of mysqlrouter logs
Solution
logrotate
with the above config)TODO
Attempt to run logrotate as non-root user