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
Migrate pkg/kubelet/kuberuntime to structured logging #99970
Migrate pkg/kubelet/kuberuntime to structured logging #99970
Conversation
Hi @krzysiekg. 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 Once the patch is verified, the new status will be reflected by the 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. |
continue | ||
} | ||
|
||
sizeString, err := v1helper.HugePageUnitSizeFromByteSize(pageSize.Value()) | ||
if err != nil { | ||
klog.Warningf("pageSize is invalid: %v", err) | ||
klog.InfoS("Hugepage size is invalid", "object", resourceObj, "err", err) |
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.
I wouldn't add Hugepage
here
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.
Done
@@ -97,7 +97,7 @@ func (m *kubeGenericRuntimeManager) generateWindowsContainerConfig(container *v1 | |||
if wc.Resources.CpuCount > 0 { | |||
if wc.Resources.CpuMaximum > 0 { | |||
wc.Resources.CpuMaximum = 0 | |||
klog.Warningf("Mutually exclusive options: CPUCount priority > CPUMaximum priority on Windows Server Containers. CPUMaximum should be ignored") | |||
klog.InfoS("Mutually exclusive options CPUCount and CPUMaximum present, CPUMaximum value ignored") |
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.
Why has the error message been modified here?
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.
I was trying to simplify the message somehow, but I doesn't look good to me today. It's probably best to leave the original message intact. I reverted my changes.
/triage accepted |
c52ec01
to
4ab5fec
Compare
/ok-to-test |
/retest |
2 similar comments
/retest |
/retest |
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.
Apologies wrong PR..
/assign @derekwaynecarr |
/skip |
@@ -38,15 +38,15 @@ func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32 | |||
podSandboxConfig, err := m.generatePodSandboxConfig(pod, attempt) | |||
if err != nil { | |||
message := fmt.Sprintf("GeneratePodSandboxConfig for pod %q failed: %v", format.Pod(pod), err) |
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.
Update the message as well.
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.
I updated the messages. I also changed one more message that didn't have matching klog.ErrorS call to make all messages in this method consistent.
@@ -38,15 +38,15 @@ func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32 | |||
podSandboxConfig, err := m.generatePodSandboxConfig(pod, attempt) | |||
if err != nil { | |||
message := fmt.Sprintf("GeneratePodSandboxConfig for pod %q failed: %v", format.Pod(pod), err) | |||
klog.Error(message) | |||
klog.ErrorS(err, "Failed to generate sandbox config for pod", "pod", klog.KObj(pod)) | |||
return "", message, err | |||
} | |||
|
|||
// Create pod logs directory | |||
err = m.osInterface.MkdirAll(podSandboxConfig.LogDirectory, 0755) | |||
if err != nil { | |||
message := fmt.Sprintf("Create pod log directory for pod %q failed: %v", format.Pod(pod), err) |
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.
Update the message as well.
@@ -58,14 +58,14 @@ func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32 | |||
return "", message, err | |||
} | |||
if runtimeHandler != "" { | |||
klog.V(2).Infof("Running pod %s with RuntimeHandler %q", format.Pod(pod), runtimeHandler) | |||
klog.V(2).InfoS("Running pod with runtime handler", "pod", klog.KObj(pod), "runtimeHandler", runtimeHandler) | |||
} | |||
} | |||
|
|||
podSandBoxID, err := m.runtimeService.RunPodSandbox(podSandboxConfig, runtimeHandler) | |||
if err != nil { | |||
message := fmt.Sprintf("CreatePodSandbox for pod %q failed: %v", format.Pod(pod), err) |
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.
Update the message as well.
Hi @krzysiekg, can you squash your commits? I think this is good to go otherwise |
016bfd0
to
629d5ab
Compare
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.
/lgtm
/skip |
@krzysiekg: The following test failed, say
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. |
/skip |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ehashman, krzysiekg, mrunalp 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 |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ehashman, krzysiekg, mrunalp 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Migrate pkg/kubelet/kuberuntime to structured logging
Which issue(s) this PR fixes:
Ref #98976
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig node
/sig instrumentation
/priority important-soon