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

Introduce DockerCache in Kubelet. #4592

Merged
merged 1 commit into from
Feb 24, 2015
Merged

Conversation

wojtek-t
Copy link
Member

Create and use DockerCache in Kubelet to get running containers from Docker in SyncPods method. This was the most walltime-consuming part of SyncPods method and was significantly slowing down starting containers (especially in cases when I was starting 50 of them on the same node at the same time).

This PR is partially addressing #4119.

@wojtek-t
Copy link
Member Author

cc @vmarmol

@vmarmol vmarmol self-assigned this Feb 19, 2015
@@ -432,6 +433,10 @@ func (kl *Kubelet) Run(updates <-chan PodUpdate) {
if kl.dockerPuller == nil {
kl.dockerPuller = dockertools.NewDockerPuller(kl.dockerClient, kl.pullQPS, kl.pullBurst)
}
if kl.dockerCache == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should do this in NewMainKubelet. It means some of the non Main initializations may need it. Those are all in tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@vmarmol
Copy link
Contributor

vmarmol commented Feb 19, 2015

The Shipable build is timing out too for some reason. Any ideas?

@wojtek-t
Copy link
Member Author

Re shippable - I don't know what's going on there - what is strange all tests are passing with 1.4 go. I will look deeper into it tomorrow (but just curious - did you have have such situation that tests are passing with 1.4 go and timing out/failing with 1.3)?

@vmarmol
Copy link
Contributor

vmarmol commented Feb 19, 2015

Not sure about the build. Shippable is rather new to us so I haven't seen many cases yet.

@wojtek-t
Copy link
Member Author

I've updated the PR addressing the comments. PTAL

@@ -691,3 +693,63 @@ type ContainerCommandRunner interface {
RunInContainer(containerID string, cmd []string) ([]byte, error)
GetDockerServerVersion() ([]uint, error)
}

type DockerCache interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to a docker_cache.go file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@wojtek-t
Copy link
Member Author

I've applied your comments - PTAL.

)

type DockerCache interface {
KubeletRunningDockerContainers() (DockerContainers, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we rename to RunningConainers()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@vmarmol
Copy link
Contributor

vmarmol commented Feb 23, 2015

A couple of nits, but this looks good.

@wojtek-t wojtek-t force-pushed the docker_cache branch 2 times, most recently from 19e147c to f5be903 Compare February 24, 2015 07:30
@wojtek-t
Copy link
Member Author

I updated the PR and squashed the previous commits. PTAL

@vmarmol
Copy link
Contributor

vmarmol commented Feb 24, 2015

That was my last nit I promise :) We already have plans to start using this cache for the metrics so thanks again for getting this in!

@wojtek-t
Copy link
Member Author

Thanks a lot for this review - I'm trying to get up to speed with both Go and Kubernetes.

@wojtek-t
Copy link
Member Author

I just squashed all the commits - hopefully you will merge the PR in the morning then :)

@vmarmol
Copy link
Contributor

vmarmol commented Feb 24, 2015

LGTM @wojtek-t thanks again!

vmarmol added a commit that referenced this pull request Feb 24, 2015
Introduce DockerCache in Kubelet.
@vmarmol vmarmol merged commit 7f6e1dc into kubernetes:master Feb 24, 2015
@wojtek-t wojtek-t deleted the docker_cache branch March 20, 2015 07:37
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.

3 participants