Repository: kubernetes/kubernetes (language: go)

Issue:
Increase the log level for the message showing that static pod status has been updated.
<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:

I would like to ask to increase the log level for this line:

https://github.com/kubernetes/kubernetes/blob/889cf714c17163e2a787db9c474652514a18d52f/pkg/kubelet/kubelet_getters.go#L176-L181

**Why is this needed**:

I do not see the necessity to show every time the static pod has the status updated. It can flood the logs with the message.

I do not know if there is a reason for that. I believe it is a matter of taste. Furthermore, the [original merge request](https://github.com/kubernetes/kubernetes/pull/77661/files) adding this piece of code, the log was not there. The log line has being added in a [later merge request](https://github.com/kubernetes/kubernetes/pull/84951/files)



Discussion / hints:
/sig node
I'll be happy to send a merge request for this issue. But I just need to know if this make sense to the community or not.
According to my quick research, this log is added in #84951  during fixing a regression issue.
Agree with you. I think it makes sense to use a lower log level  as the bug is already fixed.

However, I'm not the owner of kubelet. Let node/kubelet owner make the decision.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with `/remove-lifecycle stale`.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with `/close`.

Send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).
/lifecycle stale
/remove-lifecycle stale
@jvanz is the issue that it logs the same status over and over? Or that status being changed very often? 
/triage accepted

I agree V(2) seems a bit high for this. Feel free to submit a PR to drop to 3.
> I agree V(2) seems a bit high for this. Feel free to submit a PR to drop to 3.

what is the reason for rapid status change?
> @jvanz is the issue that it logs the same status over and over? Or that status being changed very often?

It the almost the same message. This is an example:

```
Dec 29 18:19:23 node001 kubelet[17929]: I1229 18:19:23.928661   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
Dec 29 18:20:23 node001 kubelet[17929]: I1229 18:20:23.929256   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
Dec 29 18:21:23 node001 kubelet[17929]: I1229 18:21:23.931642   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
Dec 29 18:22:23 node001 kubelet[17929]: I1229 18:22:23.932172   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
Dec 29 18:23:23 node001 kubelet[17929]: I1229 18:23:23.933055   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
Dec 29 18:24:23 node001 kubelet[17929]: I1229 18:24:23.934400   17929 kubelet_getters.go:173] status for pod etcd-caasp-prod-master-da-01 updated to {Running [{Initialized True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {Ready True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {ContainersReady True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  } {PodScheduled True 0001-01-01 00:00:00 +0000 UTC 2020-12-27 02:49:17 -0500 EST  }]    10.56.168.80 10.56.168.80 [{10.56.168.80}] 2020-12-27 02:49:17 -0500 EST [] [{etcd {nil &ContainerStateRunning{StartedAt:2020-12-27 01:22:46 -0500 EST,} nil} {nil nil nil} true 0 registry.suse.com/caasp/v4.5/etcd:3.4.13 registry.suse.com/caasp/v4.5/etcd@sha256:6245496cf4d78336c45bf0071f13a17dd9b997b3ac4b173563c1ee32ac0308e8 cri-o://f5308cdd5858cff6e84850accb1692d3d96b9b8e36fc5b0f294f0c824bfd0b36 0xc0019cd369}] BestEffort []}
```

I'm willing to send the PR. 
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue or PR as fresh with `/remove-lifecycle stale`
- Mark this issue or PR as rotten with `/lifecycle rotten`
- Close this issue or PR with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue or PR as fresh with `/remove-lifecycle rotten`
- Close this issue or PR with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle rotten

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Reopen this issue or PR with `/reopen`
- Mark this issue or PR as fresh with `/remove-lifecycle rotten`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/close

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/
@k8s-triage-robot: Closing this issue.

<details>

In response to [this](https://github.com/kubernetes/kubernetes/issues/98422#issuecomment-937402536):

>The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
>
>This bot triages issues and PRs according to the following rules:
>- After 90d of inactivity, `lifecycle/stale` is applied
>- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
>- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed
>
>You can:
>- Reopen this issue or PR with `/reopen`
>- Mark this issue or PR as fresh with `/remove-lifecycle rotten`
>- Offer to help out with [Issue Triage][1]
>
>Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).
>
>/close
>
>[1]: https://www.kubernetes.dev/docs/guide/issue-triage/


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

Fix patch:
diff --git a/pkg/kubelet/kubelet_getters.go b/pkg/kubelet/kubelet_getters.go
index a32f197143ff1..ec22cde4604e4 100644
--- a/pkg/kubelet/kubelet_getters.go
+++ b/pkg/kubelet/kubelet_getters.go
@@ -210,12 +210,12 @@ func (kl *Kubelet) getPodResourcesDir() string {
 // pods.
 func (kl *Kubelet) GetPods() []*v1.Pod {
 	pods := kl.podManager.GetPods()
-	// a kubelet running without apiserver requires an additional
-	// update of the static pod status. See #57106
 	for i, p := range pods {
+		// Pod cache does not get updated status for static pods.
+		// TODO(tallclair): Most callers of GetPods() do not need pod status. We should either parameterize this,
+		// or move the status injection to only the callers that do need it (maybe just the /pods http handler?).
 		if kubelettypes.IsStaticPod(p) {
 			if status, ok := kl.statusManager.GetPodStatus(p.UID); ok {
-				klog.V(2).InfoS("Pod status updated", "pod", klog.KObj(p), "status", status.Phase)
 				// do not mutate the cache
 				p = p.DeepCopy()
 				p.Status = status


Test patch: