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

WIP: Adding pod compute resource stats to kubelet API. #4685

Closed
wants to merge 1 commit into from

Conversation

vishh
Copy link
Contributor

@vishh vishh commented Feb 21, 2015

The same API will also expose stats for all the pods known to the kubelet.

DO NOT MERGE. Testing pending.

The same API will also expose stats for all the pods known to the kubelet.
@vishh
Copy link
Contributor Author

vishh commented Feb 21, 2015

@dchen1107: Posting this WIP for feedback before I add unit tests and e2e tests.

// ResourceStats represents compute resource usage metrics associated with a pod or a container.
type ResourceStats struct {
// Detailed instantaneous metrics.
Detailed *cadvisor_api.ContainerInfo `json:"detailed,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we decouple what we expose in the master API from the cadvisor API? The downside is you would end up with two data structures and a bunch of stupid copying between them, but the advantage is that you could evolve the cadvisor API without impacting the master API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent is to not expose all the stats via the master since it will be a lot of data. The kubelet API will be extended soon to expose historical usage distribution, which is what @rjnagal is working on. That will be something we will end up exposing via the master API. The copying overhead should be minimal I hope.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc/ @bgrant0607 we need to make the final decision on how to introduce resource related types to our API?

@vishh I am not comfortable to use cadvisor's API directly here, since it is introduced an extra dependency to cadvisor. But up to Brian to make the final call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Please ping me directly in the future. Mentioning me on github is no longer sufficient to rise about the noise.

Will discuss offline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, the only reason you touched pkg/api/types.go here was because Kubelet is reusing the types from master. Should we introduce a new API types file specifically for the kubelet, like @abhgupta did in #4674 for scheduler? Or maybe we can have three types files, one for master-only, one for kubelet-only, and one for shared (similar to how we factored the proto bufs for our internal system)? I think it's fine to share some data structures between master and kubelet as long as we think carefully about upgrades/evolution. The two are going to be talking to each other anyway so there's no escaping thinking about backward compatibility no matter what you do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this current PR does is wrong in multiple ways -- and so are the current Kubelet APIs.

For now, I proposed that Vish expose the actual cadvisor API at a new API prefix. The cadvisor API has its own independent versioning. This would effectively make Kubelet a caching proxy for cadvisor.

This is a bigger discussion, which we should have in another forum.

@dchen1107
Copy link
Member

ping, any new status on this PR? Should I take another look at it?

@vishh
Copy link
Contributor Author

vishh commented Mar 4, 2015

Not yet Dawn. I will re-work this PR as per Brian's comments and ping you.

On Tue, Mar 3, 2015 at 4:33 PM, Dawn Chen notifications@github.com wrote:

ping, any new status on this PR? Should I take another look at it?


Reply to this email directly or view it on GitHub
#4685 (comment)
.

@piosz
Copy link
Member

piosz commented Mar 31, 2015

Is this PR active? If not please close it according to https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/devel/pull-requests.md

@piosz
Copy link
Member

piosz commented Apr 8, 2015

Closing according to the mentioned policy.

@piosz piosz closed this Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants