-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Enable logrotate for Kubernetes configs on CoreOS #3488
Enable logrotate for Kubernetes configs on CoreOS #3488
Conversation
Hi @julianvmodesto. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/ok-to-test |
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 for you
if b.Distribution == distros.DistributionContainerOS { | ||
glog.Infof("Detected ContainerOS; won't install logrotate") | ||
return nil | ||
} else if b.Distribution == distros.DistributionCoreOS { | ||
glog.Infof("Detected CoreOS; won't install logrotate") |
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.
How are we enabling? Confused ... sorry
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.
Logrotate is already installed on CoreOS, so we don't need to install the package, only the logrotate conf.
Would c.AddTask(&nodetasks.Package{Name: "logrotate"})
be okay to run away on CoreOS?
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.
@julianvmodesto you can answer
Would c.AddTask(&nodetasks.Package{Name: "logrotate"}) be okay to run away on CoreOS?
Better than I :) What do you recommend? Test it
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 - you generally can't run the Package task on CoreOS - it'll complain that it doesn't know the package manager, because it only supports apt & yum.
I'll take a look at this - thank you! It looks good, I just need to verify that the rotation is indeed installed on Debian, but it sounds right :-) |
/retest was a testing problem, not a PR issue |
Thanks @julianvmodesto - will be great to get logrotation working on CoreOS! Can we keep the hourly rotation, i.e. wrap that block in an I suspect we'll actually want to tweak CoreOS to logrotate more often than daily, but we can see :-) But I don't want to change the existing behaviour for Debian images. |
0f0602d
to
8cb2b68
Compare
Done! Instead of an hourly cron, could we use an houry systemd timer for Jessie and CoreOS, the latter by overriding the existing timer? e.g.
|
/lgtm thanks @julianvmodesto! On the idea of moving to the hourly systemd timer, that would be great - we could even trigger it more often if needed than hourly. Want to send a PR? :-) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Automatic merge from submit-queue. Replace logrotate crontab with systemd timer Related to #2710, minor improvement mentioned in #3488 (comment). This change replaces the logrotate crontab with a systemd timer. Any existing systemd timer for logrotate will be overridden.
Addresses #2710.
Also, remove logrotate crontab because logrotate ships with a systemd timer,
logrotate.timer
, to run logrotate daily.