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

Update to latest cAdvisor version and add a client package for cAdvisor #448

Closed
wants to merge 7 commits into from

Conversation

monnand
Copy link
Contributor

@monnand monnand commented Jul 14, 2014

This PR updates kubelet's code to use the most recent cAdvisor's API.

The current problem I encountered here is where should I put the data structures' definition.

There are several data structures' in cAdvisor describing CPU/Memory stats/specs. To retrieve stats from cAdvisor through kubelet, we could either use cAdvisor's data structures, or redefine (almost) the same structures in k8s' api package.

If we reuse cAdvisor's data structure, then there will be less copy&paste work. However, we will force kubelet users (i.e. the master) to import one of cAdvisor's package (github.com/google/cadvisor/info).

If we redefine all, or some data structures in api, then there'll be lots of boilerplate copied from cadvisor.

Currently, I'm using the second approach (copy all data structures in the api package.) But I'm open to change. So please feel free to add any comment here.

@monnand
Copy link
Contributor Author

monnand commented Jul 14, 2014

Just talked with @lavalamp offline, he suggested me to use cAdvisor's data structure directly. I think this would be good for me because there'll be less work.

Thoughts? ping @brendanburns @thockin @dchen1107 @vmarmol

@monnand
Copy link
Contributor Author

monnand commented Jul 14, 2014

Talked with @thockin offline and he agrees with @lavalamp's suggestion. So I'm going to change the code to let kubelet directly use cadvisor's data structure. If anyone has other problem, please make a comment below.

@monnand monnand changed the title [WIP] Update to latest cAdvisor version Update to latest cAdvisor version Jul 14, 2014
@monnand
Copy link
Contributor Author

monnand commented Jul 14, 2014

This PR is ready to be reviewed now. ping @brendanburns @thockin @lavalamp

}

// GetContainerStats returns stats (from Cadvisor) for a container.
func (kl *Kubelet) GetContainerStats(podID, containerName string) (*api.ContainerStats, error) {
func (kl *Kubelet) GetContainerStats(podID, containerName string, req *info.ContainerInfoRequest) (*info.ContainerInfo, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should rename it to GetContainerInfo() instead?

@monnand monnand mentioned this pull request Jul 15, 2014
@monnand
Copy link
Contributor Author

monnand commented Jul 15, 2014

Rebased.

@monnand
Copy link
Contributor Author

monnand commented Jul 15, 2014

Just updated cAdvisor with most recent changes.

The PR is ready for review now. Ping @lavalamp @thockin @brendandburns Thanks!

@monnand monnand changed the title Update to latest cAdvisor version Update to latest cAdvisor version and add a client package for cAdvisor Jul 15, 2014
@monnand
Copy link
Contributor Author

monnand commented Jul 15, 2014

Add another comment to retrieve machine spec from cAdvisor. We may need to consider to rename some functions.

@lavalamp
Copy link
Member

This is a really big and hard to review PR. Can we split it up some?

@monnand
Copy link
Contributor Author

monnand commented Jul 16, 2014

Sure. I'm going to split it into three parts:

  • Update kubelet package to use most recent cAdvisor's code
  • Add code in client package to use kubelet's API to retrieve data from cAdvisor
  • Add code to retrieve machine specs from cAdvisor.

@monnand
Copy link
Contributor Author

monnand commented Jul 16, 2014

@lavalamp Sent #480.

@monnand
Copy link
Contributor Author

monnand commented Jul 16, 2014

@lavalamp Sent #482

@monnand
Copy link
Contributor Author

monnand commented Jul 16, 2014

@lavalamp Sent #491

@monnand
Copy link
Contributor Author

monnand commented Jul 18, 2014

This PR is split into several PRs. All of them are merged. Close this PR.

@monnand monnand closed this Jul 18, 2014
@monnand monnand deleted the cadvisor-update branch July 18, 2014 22:00
vishh pushed a commit to vishh/kubernetes that referenced this pull request Apr 6, 2016
Move network graphs above filesystem info for root.
keontang pushed a commit to keontang/kubernetes that referenced this pull request May 14, 2016
Change order of deleting resource from anchnet
keontang pushed a commit to keontang/kubernetes that referenced this pull request Jul 1, 2016
Change order of deleting resource from anchnet
mqliang pushed a commit to mqliang/kubernetes that referenced this pull request Dec 8, 2016
Change order of deleting resource from anchnet
mqliang pushed a commit to mqliang/kubernetes that referenced this pull request Mar 3, 2017
Change order of deleting resource from anchnet
wking pushed a commit to wking/kubernetes that referenced this pull request Jul 21, 2020
add a tested breakfast configuration demo
jsafrane pushed a commit to jsafrane/kubernetes that referenced this pull request Nov 13, 2020
UPSTREAM: revert: <drop>: don't use dynamic tokens for KCM
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.

2 participants