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

Load docker images of kubernetes components after docker is installed. #6496

Merged
merged 1 commit into from
Apr 10, 2015

Conversation

ArtfulCoder
Copy link
Contributor

@ArtfulCoder
Copy link
Contributor Author

@derekwaynecarr can you check if this PR works with Vagrant ?

@dchen1107

#6471

@derekwaynecarr
Copy link
Member

Will report back with results

@ArtfulCoder
Copy link
Contributor Author

@derekwaynecarr did you get a chance to try it. thanks!

@derekwaynecarr
Copy link
Member

not yet, will try this afternoon and reply.

@@ -104,9 +104,24 @@ lxc-docker-{{ docker_ver }}:
- sources:
- lxc-docker-{{ docker_ver }}: /var/cache/docker-install/{{ deb }}

docker_load_kube_apiserver:
Copy link
Member

Choose a reason for hiding this comment

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

These functions are stuck in a if/else block that is only called if you are not running in a Red Hat based linux distro, so they are never called. I am testing this by moving it to the top of the function.

@ArtfulCoder ArtfulCoder force-pushed the docker_image_install branch from bdde589 to 9327694 Compare April 7, 2015 18:21
@ArtfulCoder
Copy link
Contributor Author

@derekwaynecarr I update the PR based on your feedback.

@ArtfulCoder ArtfulCoder force-pushed the docker_image_install branch from 9327694 to e8c2c82 Compare April 7, 2015 18:23
@derekwaynecarr
Copy link
Member

So it doesn't fail, but when I ssh into the master and run 'sudo docker images', I do not see the images reported. If I manually run the command to load the tars 'sudo docker load -i ...' , the images load fine.

@ArtfulCoder
Copy link
Contributor Author

I am trying to start my own vagrant cluster.
I think even though salt thinks that docker service is running, docker might not have fully initialized
Hence, when you tried later, it worked.
if you check the /var/log/startupscript.log file, you should see errors.

@derekwaynecarr
Copy link
Member

I am happy to debug further. Ping me on IRC

@ArtfulCoder ArtfulCoder force-pushed the docker_image_install branch from e8c2c82 to dbfda90 Compare April 7, 2015 18:53
@derekwaynecarr
Copy link
Member

As structured, this code attempts to load the images on the master and the minions. Is this desired? It causes error on subsequent kube-push calls when each minion tries to run the command.

==> master: kubernetes-minion-1:
==> master: ----------
==> master:           ID: docker_load_kube_apiserver
==> master:     Function: cmd.run
==> master:         Name: docker load -i /srv/salt/kube-bins/kube-apiserver.tar
==> master:       Result: False
==> master:      Comment: Command "docker load -i /srv/salt/kube-bins/kube-apiserver.tar" run
==> master:      Started: 19:19:04.119813
==> master:     Duration: 60.291 ms
==> master:      Changes:   
==> master:               ----------
==> master:               pid:
==> master:                   23439
==> master:               retcode:
==> master:                   1
==> master:               stderr:
==> master:                   time="2015-04-07T19:19:04Z" level="fatal" msg="open /srv/salt/kube-bins/kube-apiserver.tar: no such file or directory"
==> master:               stdout:
==> master:                   

@derekwaynecarr
Copy link
Member

It looks like on initial kube-up, docker is not found for some reason yet when the command runs.

It looks on subsequent kube-push, the images are loaded correctly on the master, but there is an error reported by salt on each minion as defined above.

@derekwaynecarr
Copy link
Member

Would it be better to push this into its own sls file kind of like we do for kube-addons so this can only run on the master?

@ArtfulCoder ArtfulCoder force-pushed the docker_image_install branch from dbfda90 to c5c2e87 Compare April 7, 2015 20:30
@derekwaynecarr
Copy link
Member

Trying again, will report back with success/fail. Is the goal for this image to be on each minion though?

@derekwaynecarr
Copy link
Member

LGTM

@ArtfulCoder
Copy link
Contributor Author

@derekwaynecarr I am going to address your previous comments about loading images only on master.
I will update the PR today (hopefully)

@ArtfulCoder ArtfulCoder force-pushed the docker_image_install branch from c5c2e87 to 4996ccb Compare April 9, 2015 16:07
@ArtfulCoder
Copy link
Contributor Author

@derekwaynecarr
PTAL
I have verified it on GCE and vagrant.
container images are installed only on the master.

@ArtfulCoder
Copy link
Contributor Author

#5011

@ArtfulCoder
Copy link
Contributor Author

@thockin PTAL
Thanks!

@derekwaynecarr
Copy link
Member

Trying this now.

@derekwaynecarr
Copy link
Member

works great, LGTM.

derekwaynecarr added a commit that referenced this pull request Apr 10, 2015
Load docker images of kubernetes components after docker is installed.
@derekwaynecarr derekwaynecarr merged commit d2b6920 into kubernetes:master Apr 10, 2015
@ArtfulCoder
Copy link
Contributor Author

Thanks!!

Sent from my iPhone

On Apr 10, 2015, at 1:19 PM, Derek Carr notifications@github.com wrote:

Merged #6496.


Reply to this email directly or view it on GitHub.

# limitations under the License.

while true; do
if which docker 1>/dev/null 2>&1; then
Copy link
Member

Choose a reason for hiding this comment

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

Isn't spinwaiting? :) You might want a sleep in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zmerlynn
Thanks for the catch! created a PR #6955

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.

4 participants