-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Kubelet: support retrieving stats using UID of mirror pods #5730
Conversation
This PR is a bit cumbersome. The pod manager that I'm supposedly working on will help a lot. |
@@ -2176,8 +2200,23 @@ func (kl *Kubelet) StreamingConnectionIdleTimeout() time.Duration { | |||
return kl.streamingConnectionIdleTimeout | |||
} | |||
|
|||
func (kl *Kubelet) getStaticPodUID(uid types.UID) (types.UID, bool) { |
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.
Lets document why this exists in case future readers get confused :)
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.
Yeah it does look a bit brittle, but I think we knew that coming into it. Looks good overall, minor comments. Thanks @yujuhong! |
LGTM, squash commits and we'll merge. |
Kubelet supports retrieving stats for pods/containers with and without UID. This does not always work for the static pods because users may get the UIDs of the mirror pods from the API server, and use them to query Kubelet. In this case, Kubelet would fail to locate the containers due to mismatched UIDs. This change adds a intenral mirror to static pod UID mapping and teaches all public-facing functions to perform UID lookup before proceeding. This allows users to use either mirror or static pod's UID to retrieve stats.
What is this for? On Fri, Mar 20, 2015 at 3:08 PM, Victor Marmol notifications@github.com
|
Who would get these stats? If you say "master", then: isn't the new On Fri, Mar 20, 2015 at 3:49 PM, Victor Marmol notifications@github.com
|
Heapster uses this stats API |
Squashed and rebased. Shippable's complaints seem irrelevant though.
|
@yujuhong yeah that seemed odd, I kicked it again and we'll see what it thinks. |
@erictune, heapster queries kubelet directly for container info. |
Thanks for the quick fix @yujuhong! |
The head is broken :\ Other PRs are suffering too. This seems to be relevant to #5642. |
:( @vishh do you know if anyone is working on a fix? |
I uploaded one: #5743 |
Build is green! Merging. |
Kubelet: support retrieving stats using UID of mirror pods
Kubelet supports retrieving stats for pods/containers with and without UID.
This does not always work for the static pods because users may get the UIDs of
the mirror pods from the API server, and use them to query Kubelet. In this
case, Kubelet would fail to locate the containers due to mismatched UIDs.
This change adds a intenral mirror to static pod UID mapping and teaches all
public-facing functions to perform UID lookup before proceeding. This allows
users to use either mirror or static pod's UID to retrieve stats.
This fixes #5688