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

feat: add use-local-cached-images option. #6105

Closed

Conversation

Colstuwjx
Copy link

This PR is going to fixes #6103 by introducing a new config option use-local-cached-images, it will load local cached images without fetching images, and make minikube works well inside no-public-network-access environment.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 17, 2019
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot
Copy link
Contributor

Welcome @Colstuwjx!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 17, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @Colstuwjx. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 17, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Colstuwjx
To complete the pull request process, please assign josedonizetti
You can assign the PR to them by writing /assign @josedonizetti in a comment when ready.

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

Needs approval from an approver in each of these files:

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

@Colstuwjx
Copy link
Author

Colstuwjx commented Dec 17, 2019

BTW, on my laptop, I still could see some error messages output for kubeadm related issue while execute ./out/minikube start --memory=8196 --cpus=4 --use-local-cached-images, maybe it would be another PR to fix, the errors see below:

😄  Darwin 10.14.6 上的 minikube v1.6.1
✨  Selecting 'virtualbox' driver from user configuration (alternates: [hyperkit])
🔥  正在创建 virtualbox 虚拟机(CPUs=4,Memory=8196MB, Disk=20000MB)...
⚠️  VM is unable to access k8s.gcr.io, you may need to configure a proxy or set --image-repository
🐳  正在 Docker '19.03.5' 中准备 Kubernetes v1.17.0…
🚜  拉取镜像 ...
❌  无法拉取映像,有可能是正常状况:running cmd: "/bin/bash -c \"sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml\"": /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml": Process exited with status 1
stdout:

stderr:
W1217 13:10:41.291378    3250 common.go:77] your configuration file uses a deprecated API spec: "kubeadm.k8s.io/v1beta1". Please use 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.
W1217 13:10:41.291968    3250 common.go:77] your configuration file uses a deprecated API spec: "kubeadm.k8s.io/v1beta1". Please use 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.
W1217 13:10:41.295286    3250 validation.go:28] Cannot validate kube-proxy config - no validator is available
W1217 13:10:41.295309    3250 validation.go:28] Cannot validate kubelet config - no validator is available
failed to pull image "k8s.gcr.io/kube-apiserver:v1.17.0": output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
To see the stack trace of this error execute with --v=5 or higher

🚀  正在启动 Kubernetes ...
⌛  Waiting for cluster to come online ...
🏄  完成!kubectl 已经配置至 "minikube"

@codecov-io
Copy link

Codecov Report

Merging #6105 into master will increase coverage by <.01%.
The diff coverage is 27.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6105      +/-   ##
==========================================
+ Coverage    36.7%   36.71%   +<.01%     
==========================================
  Files         113      113              
  Lines        8355     8361       +6     
==========================================
+ Hits         3067     3070       +3     
- Misses       4887     4890       +3     
  Partials      401      401
Impacted Files Coverage Δ
pkg/minikube/machine/cache_images.go 4.36% <0%> (-0.02%) ⬇️
pkg/minikube/driver/driver.go 92.72% <100%> (+0.13%) ⬆️
cmd/minikube/cmd/start.go 22.82% <50%> (+0.15%) ⬆️

@tstromberg
Copy link
Contributor

tstromberg commented Dec 17, 2019

Offline support is supposed to work by default without user intervention, so I would prefer to not add a flag unless necessary.

#6111 should also rectify the issue.

@Colstuwjx
Copy link
Author

Yes, I agree.

@Colstuwjx Colstuwjx closed this Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

offline support broken: LoadImages makes HTTPS queries
5 participants