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

Migrate pkg/kubelet/kuberuntime to structured logging #99970

Conversation

krzysiekg
Copy link
Contributor

@krzysiekg krzysiekg commented Mar 9, 2021

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?

NONE

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


/sig node
/sig instrumentation
/priority important-soon

@k8s-ci-robot k8s-ci-robot added release-note kind/cleanup size/M sig/node sig/instrumentation priority/important-soon cncf-cla: yes needs-triage needs-ok-to-test labels Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 9, 2021

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 /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.

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)
Copy link
Contributor

@shubheksha shubheksha Mar 9, 2021

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

Copy link
Contributor Author

@krzysiekg krzysiekg Mar 9, 2021

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")
Copy link
Contributor

@shubheksha shubheksha Mar 9, 2021

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?

Copy link
Contributor Author

@krzysiekg krzysiekg Mar 9, 2021

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.

@shubheksha
Copy link
Contributor

@shubheksha shubheksha commented Mar 9, 2021

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted and removed needs-triage labels Mar 9, 2021
@shubheksha shubheksha moved this from Needs Reviewer to Waiting on Author in Structured Logging Migration for Kubelet, 1.21 Mar 9, 2021
@krzysiekg krzysiekg force-pushed the structured_logging_pkg_kubelet_kuberuntime branch from c52ec01 to 4ab5fec Compare Mar 9, 2021
@troy0820
Copy link
Member

@troy0820 troy0820 commented Mar 9, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test labels Mar 9, 2021
@troy0820 troy0820 moved this from Waiting on Author to Needs Reviewer in Structured Logging Migration for Kubelet, 1.21 Mar 9, 2021
@krzysiekg
Copy link
Contributor Author

@krzysiekg krzysiekg commented Mar 10, 2021

/retest

2 similar comments
@krzysiekg
Copy link
Contributor Author

@krzysiekg krzysiekg commented Mar 10, 2021

/retest

@krzysiekg
Copy link
Contributor Author

@krzysiekg krzysiekg commented Mar 10, 2021

/retest

Copy link
Member

@kikisdeliveryservice kikisdeliveryservice left a comment

Apologies wrong PR..

@krzysiekg
Copy link
Contributor Author

@krzysiekg krzysiekg commented Mar 12, 2021

/assign @derekwaynecarr
/retest

@ehashman
Copy link
Member

@ehashman ehashman commented Mar 13, 2021

/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)
Copy link
Contributor

@mrunalp mrunalp Mar 16, 2021

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.

Copy link
Contributor Author

@krzysiekg krzysiekg Mar 17, 2021

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)
Copy link
Contributor

@mrunalp mrunalp Mar 16, 2021

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)
Copy link
Contributor

@mrunalp mrunalp Mar 16, 2021

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.

@mrunalp mrunalp moved this from Needs Approver to Waiting on Author in SIG Node PR Triage Mar 16, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm label Mar 17, 2021
@ehashman
Copy link
Member

@ehashman ehashman commented Mar 17, 2021

Hi @krzysiekg, can you squash your commits? I think this is good to go otherwise

@ehashman ehashman moved this from Needs Approver to Needs Reviewer in Structured Logging Migration for Kubelet, 1.21 Mar 17, 2021
@krzysiekg krzysiekg force-pushed the structured_logging_pkg_kubelet_kuberuntime branch from 016bfd0 to 629d5ab Compare Mar 17, 2021
Copy link
Member

@ehashman ehashman left a comment

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 17, 2021
@ehashman ehashman moved this from Needs Reviewer to Needs Approver in Structured Logging Migration for Kubelet, 1.21 Mar 17, 2021
@ehashman ehashman moved this from Waiting on Author to Needs Approver in SIG Node PR Triage Mar 17, 2021
@pacoxu
Copy link
Member

@pacoxu pacoxu commented Mar 17, 2021

/skip
/retest

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 17, 2021

@krzysiekg: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-azure-file-windows 629d5ab link /test pull-kubernetes-e2e-azure-file-windows

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.

@krzysiekg
Copy link
Contributor Author

@krzysiekg krzysiekg commented Mar 17, 2021

/skip

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Mar 17, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 17, 2021

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

1 similar comment
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 17, 2021

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

@k8s-ci-robot k8s-ci-robot added the approved label Mar 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit 862aa6d into kubernetes:master Mar 17, 2021
15 of 16 checks passed
SIG Node PR Triage automation moved this from Needs Approver to Done Mar 17, 2021
Structured Logging Migration for Kubelet, 1.21 automation moved this from Needs Approver to Done Mar 17, 2021
@k8s-ci-robot k8s-ci-robot added release-note-none and removed release-note labels Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/kubelet cncf-cla: yes kind/cleanup lgtm ok-to-test priority/important-soon release-note-none sig/instrumentation sig/node size/M triage/accepted
Development

Successfully merging this pull request may close these issues.

None yet