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

certificate controller: use contextual logging #113994

Conversation

mengjiao-liu
Copy link
Member

@mengjiao-liu mengjiao-liu commented Nov 18, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

certificate controller: use contextual logging

Which issue(s) this PR fixes:

Part of kubernetes/enhancements#3077

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Migrated the certificate controller (within `kube-controller-manager`) to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging).

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/3077-contextual-logging

@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/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 18, 2022
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.26 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.26.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Fri Nov 18 03:25:00 UTC 2022.

@k8s-ci-robot k8s-ci-robot added 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 Nov 18, 2022
@mengjiao-liu
Copy link
Member Author

/sig instrumentation
/wg structured-logging
/area logging

@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. area/logging and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 18, 2022
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. labels Nov 18, 2022
@mengjiao-liu mengjiao-liu force-pushed the contextual-logging-controller-certificates branch from efe57d0 to 3e6d925 Compare November 18, 2022 06:53
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 18, 2022
@mengjiao-liu mengjiao-liu force-pushed the contextual-logging-controller-certificates branch from 3e6d925 to 2d043ea Compare November 18, 2022 07:06
@fedebongio
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Nov 29, 2022
@logicalhan
Copy link
Member

/assign @pohly
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 1, 2022
@mengjiao-liu
Copy link
Member Author

/retest

@pohly
Copy link
Contributor

pohly commented Apr 11, 2023

We don't have a CI job that produces logs with changes from a PR. Let me add one...

@pohly
Copy link
Contributor

pohly commented Apr 11, 2023

Once kubernetes/test-infra#29266 is merged, we can trigger jobs to produce logs with these changes.

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

While we wait for a pre-merge job config, can remove the exception from

-contextual k8s.io/kubernetes/pkg/controller/certificates/.*

@mengjiao-liu
Copy link
Member Author

mengjiao-liu commented Apr 12, 2023

While we wait for a pre-merge job config, can remove the exception from

-contextual k8s.io/kubernetes/pkg/controller/certificates/.*

Done. I have added a commit 5588e8a to remove the exception.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mengjiao-liu, pohly, soltysh

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

The pull request process is described 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

@pohly
Copy link
Contributor

pohly commented Apr 15, 2023

/test pull-kubernetes-kind-json-logging
/test pull-kubernetes-kind-text-logging

Let's see whether the new jobs works... (untested so far).

@pohly
Copy link
Contributor

pohly commented Apr 16, 2023

/test pull-kubernetes-kind-json-logging
/test pull-kubernetes-kind-text-logging

@pohly
Copy link
Contributor

pohly commented Apr 19, 2023

/test pull-kubernetes-kind-text-logging

@pohly
Copy link
Contributor

pohly commented Apr 24, 2023

Looks like these dumps are incomplete, the start of the kube-controller-manager log output is missing. I'll reduce the verbosity.

@pohly
Copy link
Contributor

pohly commented Apr 24, 2023

/test pull-kubernetes-kind-json-logging
/test pull-kubernetes-kind-text-logging

2 similar comments
@pohly
Copy link
Contributor

pohly commented Apr 28, 2023

/test pull-kubernetes-kind-json-logging
/test pull-kubernetes-kind-text-logging

@pohly
Copy link
Contributor

pohly commented Apr 28, 2023

/test pull-kubernetes-kind-json-logging
/test pull-kubernetes-kind-text-logging

@pohly
Copy link
Contributor

pohly commented Apr 28, 2023

Finally! 😄

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/113994/pull-kubernetes-kind-text-logging/1651955298555924480/artifacts/kind-control-plane/containers/kube-controller-manager-kind-control-plane_kube-system_kube-controller-manager-627431f5c535b52313af3c1f2c1d94c531ba6bb670cd32a6cbc9ad97589c6edd.log

$ grep -e "csrsigning: " -e "csrapproving: "

2023-04-28T14:42:34.729415875Z stderr F I0428 14:42:34.729196       1 certificate_controller.go:115] "csrsigning: Starting certificate controller" name="csrsigning-kubelet-serving"
2023-04-28T14:42:34.730901704Z stderr F I0428 14:42:34.730658       1 certificate_controller.go:115] "csrsigning: Starting certificate controller" name="csrsigning-kubelet-client"
2023-04-28T14:42:34.731850517Z stderr F I0428 14:42:34.731732       1 certificate_controller.go:115] "csrsigning: Starting certificate controller" name="csrsigning-kube-apiserver-client"
2023-04-28T14:42:34.732864988Z stderr F I0428 14:42:34.732784       1 certificate_controller.go:115] "csrsigning: Starting certificate controller" name="csrsigning-legacy-unknown"
2023-04-28T14:42:46.335458775Z stderr F I0428 14:42:46.335313       1 certificate_controller.go:78] "csrsigning: Adding certificate request" csr="csr-7fnfl"
2023-04-28T14:42:46.335466999Z stderr F I0428 14:42:46.335388       1 certificate_controller.go:78] "csrsigning: Adding certificate request" csr="csr-7fnfl"
2023-04-28T14:42:46.335478306Z stderr F I0428 14:42:46.335417       1 certificate_controller.go:78] "csrsigning: Adding certificate request" csr="csr-7fnfl"
2023-04-28T14:42:46.335485238Z stderr F I0428 14:42:46.335456       1 certificate_controller.go:78] "csrsigning: Adding certificate request" csr="csr-7fnfl"
2023-04-28T14:42:46.335602006Z stderr F I0428 14:42:46.335518       1 certificate_controller.go:78] "csrapproving: Adding certificate request" csr="csr-7fnfl"
2023-04-28T14:42:46.430430472Z stderr F I0428 14:42:46.430343       1 certificate_controller.go:171] "csrsigning: Finished syncing certificate request" csr="csr-7fnfl" elapsedTime="18.681µs"
2023-04-28T14:42:46.43194421Z stderr F I0428 14:42:46.431633       1 certificate_controller.go:171] "csrsigning: Finished syncing certificate request" csr="csr-7fnfl" elapsedTime="11.892µs"
2023-04-28T14:42:46.433234041Z stderr F I0428 14:42:46.433139       1 certificate_controller.go:171] "csrsigning: Finished syncing certificate request" csr="csr-7fnfl" elapsedTime="13.485µs"
2023-04-28T14:42:46.43353266Z stderr F I0428 14:42:46.433392       1 certificate_controller.go:171] "csrsigning: Finished syncing certificate request" csr="csr-7fnfl" elapsedTime="19.269µs"
2023-04-28T14:42:46.605537398Z stderr F I0428 14:42:46.605346       1 certificate_controller.go:83] "csrapproving: Updating certificate request" old="csr-7fnfl"
2023-04-28T14:42:46.605546112Z stderr F I0428 14:42:46.605369       1 certificate_controller.go:83] "csrsigning: Updating certificate request" old="csr-7fnfl"
...
```

@mengjiao-liu
Copy link
Member Author

Can we grab some logs from CI for these controllers to make sure they look okay?

CI jobs:

  • pull-kubernetes-kind-json-logging
  • pull-kubernetes-kind-text-logging

logs example: #113994 (comment)

@enj Would you do the final LGTM?

@enj
Copy link
Member

enj commented Jun 21, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d658e4a7ba0c9bfc11482f646b5ff12eed628944

@pohly
Copy link
Contributor

pohly commented Jun 21, 2023

/hold
for sig-auth approval

We have that now (thanks @enj), let's merge it.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 21, 2023
@k8s-ci-robot
Copy link
Contributor

@mengjiao-liu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-gce 5588e8a link unknown /test pull-kubernetes-e2e-gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@pohly
Copy link
Contributor

pohly commented Jun 21, 2023

/retest

@k8s-ci-robot k8s-ci-robot merged commit 28296ba into kubernetes:master Jun 21, 2023
12 of 13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Jun 21, 2023
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. area/logging area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet