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

Add pod context to volume lifecycle logs #103261

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

markusthoemmes
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This adds the "correct" pod context for all logs concerning the lifecycle of pod volume mounts.

Which issue(s) this PR fixes:

None.

Special notes for your reviewer:

None really :). Let me know if I should remove the existing contexts in addition.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. 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. labels Jun 28, 2021
@k8s-ci-robot k8s-ci-robot added area/kubelet needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 28, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @markusthoemmes. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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 Jun 28, 2021
@markusthoemmes
Copy link
Contributor Author

/assign @msau42

Copy link
Member

@ehashman ehashman left a comment

Choose a reason for hiding this comment

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

/ok-to-test
/sig storage
/priority backlog
/triage accepted

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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 Jul 7, 2021
@ehashman ehashman moved this from Triage to Needs Reviewer in SIG Node PR Triage Jul 7, 2021
@markusthoemmes
Copy link
Contributor Author

/retest

@@ -208,7 +208,7 @@ func (rc *reconciler) mountAttachVolumes() {
if rc.controllerAttachDetachEnabled || !volumeToMount.PluginIsAttachable {
// Volume is not attached (or doesn't implement attacher), kubelet attach is disabled, wait
// for controller to finish attaching volume.
klog.V(5).InfoS(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.VerifyControllerAttachedVolume", ""))
klog.V(5).InfoS(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.VerifyControllerAttachedVolume", ""), klog.KObj(volumeToMount.Pod))
Copy link
Member

Choose a reason for hiding this comment

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

Can you show an example of what this log looks like now?

GenerateMsgDetailed also contains pod information. Maybe we need to clean that up too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not from this but from a few logs below

{"ts":1624886288131.6914,"caller":"reconciler/reconciler.go:254","msg":"Starting operationExecutor.MountVolume for volume \"usr-local-share-ca-certificates\" (UniqueName: \"kubernetes.io/host-path/25e80667e06cd3d268ce52026676a8a1-usr-local-share-ca-certificates\") pod \"kube-apiserver-kind-control-plane\" (UID: \"25e80667e06cd3d268ce52026676a8a1\") ","v":4,"pod":"kube-system/kube-apiserver-kind-control-plane"}

We could in theory remove the pod information from GenerateMsgDetailed to get less duplication, though that doesn't seem to be critical. The important bit is the structured context being added.

@msau42
Copy link
Member

msau42 commented Jul 29, 2021

/lgtm
/approve

Thanks, I think this is a good start. Eventually we'll want to refactor GenerateMsgDetailed too.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes, msau42

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 3, 2021
@markusthoemmes
Copy link
Contributor Author

@msau42 rebased this and fixed one line where I forgot the "pod" key. I'll have a followup for this soon which adds even more logs to the party. After that, we can likely look at refactoring GenerateMsgDetailed.

@markusthoemmes
Copy link
Contributor Author

/retest

1 similar comment
@markusthoemmes
Copy link
Contributor Author

/retest

@msau42
Copy link
Member

msau42 commented Aug 3, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 3, 2021
@ehashman ehashman moved this from Needs Reviewer to Needs Approver in SIG Node PR Triage Aug 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit a674fb4 into kubernetes:master Aug 5, 2021
SIG Node PR Triage automation moved this from Needs Approver to Done Aug 5, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Aug 5, 2021
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/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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 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