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

kubelet: activate logging sooner #104997

Closed
wants to merge 1 commit into from

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Sep 14, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Without this, some error messages during startup are printed in
text format although JSON was requested.

Before:

   $ go run ./cmd/kubelet --logging-format=json
   ...
   E0914 10:54:57.540301   69656 server.go:271] "Failed to construct kubelet dependencies" err="error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair"
   exit status 1

After:

  $ go run ./cmd/kubelet --logging-format=json
  ...
  {"ts":1631610094233.7605,"caller":"app/server.go:276","msg":"Failed to construct kubelet dependencies","err":"error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair"}

Special notes for your reviewer:

I noticed this while working on logging configuration for kubelet and other commands.

Does this PR introduce a user-facing change?

kubelet activates the logging settings sooner, so some more early error messages get printed as configured.

Without this, some error messages during startup are printed in
text format although JSON was requested.

Before:

   $ go run ./cmd/kubelet --logging-format=json
   ...
   E0914 10:54:57.540301   69656 server.go:271] "Failed to construct kubelet dependencies" err="error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair"
   exit status 1

After:

  $ go run ./cmd/kubelet --logging-format=json
  ...
  {"ts":1631610094233.7605,"caller":"app/server.go:276","msg":"Failed to construct kubelet dependencies","err":"error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair"}
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 14, 2021
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 14, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pohly
To complete the pull request process, please assign yujuhong after the PR has been reviewed.
You can assign the PR to them by writing /assign @yujuhong in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@MadhavJivrajani
Copy link
Contributor

/priority backlog
/triage accepted

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 20, 2021
@MadhavJivrajani MadhavJivrajani moved this from Triage to Needs Reviewer in SIG Node PR Triage Sep 20, 2021
Comment on lines +230 to +234
// Activate final logging options as soon as we have
// them validated.
logOption := &logs.Options{Config: kubeletConfig.Logging}
logOption.Apply()

Copy link
Contributor

Choose a reason for hiding this comment

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

@derekwaynecarr @mrunalp @sjenning
I am not as familiar with this part of the code to be sure that this is safe to do earlier like this.
Can one of you please review?

@pohly
Copy link
Contributor Author

pohly commented Nov 5, 2021

/close

Solved differently in #106090

@k8s-ci-robot
Copy link
Contributor

@pohly: Closed this PR.

In response to this:

/close

Solved differently in #106090

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.

SIG Node PR Triage automation moved this from Needs Reviewer to Done Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants