K3s: Allows to preload a docker image on the k3s node agents

Created on 28 Feb 2019  路  4Comments  路  Source: k3s-io/k3s

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!

kinfeature

Most helpful comment

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

All 4 comments

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.

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

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 !

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seanmalloy picture seanmalloy  路  3Comments

theonewolf picture theonewolf  路  3Comments

pierreozoux picture pierreozoux  路  4Comments

weber-software picture weber-software  路  3Comments

gilkotton picture gilkotton  路  3Comments