Skip to content
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

enabling log rotate for api logs in nginx #56979

Merged
merged 1 commit into from
Dec 17, 2017
Merged

enabling log rotate for api logs in nginx #56979

merged 1 commit into from
Dec 17, 2017

Conversation

hyperbolic2346
Copy link
Contributor

What this PR does / why we need it:
Prevent the load balancer from filling the disk with logs from the api server
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #
https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/449
Special notes for your reviewer:

Release note:

Enabled log rotation for load balancer's api logs to prevent running out of disk space.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 9, 2017
@marcoceppi
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 9, 2017
@dixudx
Copy link
Member

dixudx commented Dec 11, 2017

@hyperbolic2346 Please squash your commits. Thanks.

… the nginx directory where the log rotation is setup. Adding a log rotation file for these logs.
@hyperbolic2346
Copy link
Contributor Author

@dixudx Done, thanks for the help.

@marcoceppi
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2017
@Cynerva
Copy link
Contributor

Cynerva commented Dec 11, 2017

/approve no-issue

👍

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2017
Copy link
Contributor

@lazypower lazypower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@@ -89,6 +109,14 @@ def close_old_port():
hookenv.log('Port %d already closed, skipping.' % old_port)


def maybe_write_apilb_logrotate_config():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choice message signature :) 👍

@@ -35,6 +36,25 @@
from subprocess import CalledProcessError


apilb_nginx = """/var/log/nginx.*.log {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:

Why declare this inline instead of using the template system that exists and is used elsewhere? I'm not generally +/- for this approach, just curious why you chose the approach you did.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not +/- either way and mainly just selected this method randomly. I'd be happy to convert it over, but I felt that it would be more obvious to someone reading the code what was happening if they could easily find that data. It probably isn't worth it and should be a template though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough to satisfy my curiosity. Thanks for the explanation

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chuckbutler, Cynerva, hyperbolic2346, marcoceppi

Associated issue requirement bypassed by: Cynerva

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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to @fejta).

Review the full test history for this PR.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 56858, 57040, 56979, 57051, 57052). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants