-
Notifications
You must be signed in to change notification settings - Fork 975
Description
This issue was introduced by: kubernetes/kubernetes#130471
Summary:
The kubelet generates events for containers within a Pod, but the Message field of these events does not include the container name.
As a result, when users run kubectl describe pods, they see events like:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
...
Normal Pulling 9s (x2 over 20s) kubelet Pulling image "nginx"
Normal Pulling 5s (x2 over 14s) kubelet Pulling image "nginx"
Warning FailedPostStartHook 5s (x2 over 14s) kubelet PostStartHook failed
Normal Killing 5s (x2 over 14s) kubelet FailedPostStartHook
Warning FailedPreStopHook 5s (x2 over 14s) kubelet PreStopHook failed
Warning FailedPostStartHook 0s (x2 over 10s) kubelet PostStartHook failed
Normal Killing 0s (x2 over 10s) kubelet FailedPostStartHook
Warning FailedPreStopHook 0s (x2 over 10s) kubelet PreStopHook failed
...
As we can see, the container name is not included in the Message of these events, which makes it somewhat inconvenient to troubleshoot the status of a multi-container pod based on events.
However, considering that the container-related fields are already included in the involvedObjects
field of the events, having the kubelet redundantly add the container name to the Message seems unnecessary.
Therefore, perhaps this could be better addressed in kubectl. kubectl describe pods
could either:
-
Default to displaying the
involvedObjects.fieldpath
field for events, or -
Add a flag like
--show-fieldpath
to display theinvolvedObjects.fieldpath
field for events.
We would greatly appreciate any suggestions from SIG CLI on this matter.