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

new command "image pull: allow to load remote images directly without cache #11127

Merged
merged 3 commits into from
Apr 19, 2021

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Apr 18, 2021

When looking at the benchmarks, there seems to be a need to pull images without too much intermediate layers...

This bypasses the local daemon and the file cache, and asks the container runtime to pull directly from the registry.

Basically the same as:

minikube ssh -- sudo crictl pull image

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 18, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 18, 2021
@afbjorklund afbjorklund requested a review from spowelljr April 18, 2021 17:39
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 18, 2021

@spowelljr : Would avoid having to save + scp + load the image help anything, with your benchmarks ?

minikube image load image

crane pull image image.tar
minikube cp image.tar /tmp/image.tar
minikube ssh -- docker load -i /tmp/image.tar

vs

minikube image load image --pull

minikube ssh -- docker pull image

@medyagh
Copy link
Member

medyagh commented Apr 19, 2021

uld avoid having to save + scp + load the image help anything, with your benchmarks ?

minikube image load image

@afbjorklund would this be only useful for publicly available images ?

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 19, 2021

would this be only useful for publicly available images ?

You would have to run a registry somewhere, but it doesn't have to use docker hub or any other publicly available one.

The main difference is if you plan to do it more than once (e.g. for another cluster, later on). Then you might want to cache.

It's still a bit of a premature optimization, you might just deploy and let Kubernetes decide when it needs to pull things...

  1. Just run, pull nothing, cache nothing -- this is the default
  2. Just pull, don't cache on the host (artificial benchmark)
  3. Full prepare, both pull and cache -- this is the default

@afbjorklund
Copy link
Collaborator Author

If we want to optimize for startup time, then the best option would be to not load the entire image ahead-of-time.

Instead we should run a local registry, and optimize the required kubernetes images for chunk streaming:
https://github.com/containerd/stargz-snapshotter/blob/master/docs/ctr-remote.md#optimizing-an-image

ctr-remote image pull
ctr-remote image optimize
ctr-remote image push

That would allow the cluster to start up as quickly as posssible, and pull the rest of the image when it is needed.

https://github.com/containerd/stargz-snapshotter/blob/master/docs/overview.md

@medyagh medyagh changed the title Allow to load remote images directly without cache new command "image pull: allow to load remote images directly without cache Apr 19, 2021
pkg/minikube/machine/cache_images.go Outdated Show resolved Hide resolved
@afbjorklund afbjorklund requested a review from medyagh April 19, 2021 19:56
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund, medyagh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [afbjorklund,medyagh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@medyagh medyagh merged commit d4c1c2a into kubernetes:master Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants