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

Allows to preload a docker image on the k3s node agents #92

Closed
dduportal opened this issue Feb 28, 2019 · 4 comments · Fixed by #141
Closed

Allows to preload a docker image on the k3s node agents #92

dduportal opened this issue Feb 28, 2019 · 4 comments · Fixed by #141
Labels
kind/feature A large new piece of functionality
Milestone

Comments

@dduportal
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As a k3s end-user (with the docker-compose solution)
When I start a k3s cluster to test my application
Then I would want to be able to push the docker image of my application to each k3s's agent node,
that I've already built locally, and that I don't want to push to a remote registry for latency reasons.

Describe the solution you'd like

A k3s command to push an image from a tar file, and/or from a containerd/docker instance where k3s is running.

Describe alternatives you've considered

  • Running a local registry so my k3s pods would pull from this registry. But it's an additional layer with a lot of plumbing.
  • Currently, running k3s in a docker:dind image, with docker, so I can preload my images

Additional context

Thanks for this great piece of software!

@ibuildthecloud
Copy link
Contributor

One idea I've had is currently we have the directory /var/lib/rancher/k3s/server/manifests that will automatically deploy any k8s manifests. We could do similar with a directory like /var/lib/rancher/k3s/agent/images that will look for docker image archives (docker save format) and preload those into the agent on start.

@dduportal
Copy link
Contributor Author

One idea I've had is currently we have the directory /var/lib/rancher/k3s/server/manifests that will automatically deploy any k8s manifests. We could do similar with a directory like /var/lib/rancher/k3s/agent/images that will look for docker image archives (docker save format) and preload those into the agent on start.

This would be a real cool feature, and would totally solve the feature request!

For the reference, as I'm trying to replace kind by k3s, this is a feature provided by kind: https://kind.sigs.k8s.io/docs/design/node-image/#design (tar files present in /kind/images/ are loaded at node's startup).

Thanks for the quick feedback

@vdups
Copy link

vdups commented Mar 5, 2019

Hi,

That sounds cool !
Does that mean I would be able to preload some official docker images (eg: k8s.gcr.io/pause:3.1, coredns, traefik, klipper-helm, klipper-lb...) and then run my Kubernetes cluster in an airgap (ie without Internet connection, neither direct nor via a proxy) environment or in a very bandwidth constrained environment ?
Or should I post additional comments in issue #99 ?
It seems I could also overload some source code to use my private registry, but that would require to build k3s for each private registry.

Please note : With docker I know how to pull / save / load images, hower here with crictl I was only able to find pull command... not load. (seems an additional tool is needed : sudo ctr cri load pause.tar found here )

Thanks for your help !

@cjellick cjellick added this to the v0.2.0 milestone Mar 8, 2019
@cjellick cjellick added the kind/feature A large new piece of functionality label Mar 8, 2019
@pmahoney
Copy link

I'm using k3s for some development work where I'm often building images locally with docker build and want to test them in my cluster without needing to push/pull or registry involved. It's a bit of a hack to work in both macos and linux, and it runs k3s agent in --docker mode, but so far seems to work for my purposes. https://gist.github.com/pmahoney/29bd2563aa69a09c98bbd7d8193b6213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A large new piece of functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants