Status manager does not normalize ephemeral container statuses #124873
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
sig/node
Categorizes an issue or PR as relevant to SIG Node.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Projects
What happened?
EphemeralContainerStatuses
is not normalized innormalizeStatus()
in the status manager:kubernetes/pkg/kubelet/status/status_manager.go
Lines 1026 to 1043 in cade1dd
This does not seem to cause any user facing problem because
EphemeralContainerStatuses
is sorted before passed to the status manager and timestamps are normalized at marshaling to create a patch:kubernetes/pkg/kubelet/kubelet_pods.go
Line 2336 in cade1dd
kubernetes/pkg/kubelet/status/status_manager.go
Line 873 in cade1dd
However, an unexpected behavior is caused internally because timestamps are not normalized. If the log verbosity is 3 or larger, the following messages are logged periodically in kubelet when an ephemeral container exists:
This message is emitted here:
kubernetes/pkg/kubelet/status/status_manager.go
Lines 984 to 988 in cade1dd
After
needsReconcile()
returnstrue
,syncPod()
is called. This does not look so harmful becauseunchaged
getstrue
eventually:kubernetes/pkg/kubelet/status/status_manager.go
Lines 873 to 881 in cade1dd
API is called once unnecessarily in
syncPod()
, though:kubernetes/pkg/kubelet/status/status_manager.go
Line 843 in cade1dd
What did you expect to happen?
It might be better to normalize ephemeral container statuses, at least timestamps, in the status manager to avoid this unexpected behavior.
How can we reproduce it (as minimally and precisely as possible)?
Set the log verbosity of kubelet to 3 or larger. Then, create an ephemeral container like this.
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: