minikube icon indicating copy to clipboard operation
minikube copied to clipboard

Fix minikube image load on windows (#20529)

Open james-world opened this issue 5 months ago • 6 comments

fixes #20529

getWindowsVolumeNameCmd uses the deprecated wmic.exe, this breaks minikube image load on newer installs of windows. Whilst wmic.exe can be added, it will be removed from Windows 11 soon.

See here for details.

This fix replaces the use of wmic.exe with a call to the Powershell equivalent.

james-world avatar Jun 10 '25 09:06 james-world

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: james-world / name: James World (e17b3f4c84a0902de7d396d48a7b6e780d0674ca)

Welcome @james-world!

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. :smiley:

k8s-ci-robot avatar Jun 10 '25 09:06 k8s-ci-robot

Hi @james-world. 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-sigs/prow repository.

k8s-ci-robot avatar Jun 10 '25 09:06 k8s-ci-robot

Can one of the admins verify this patch?

minikube-bot avatar Jun 10 '25 09:06 minikube-bot

If powershell.exe is not available in PATH (it should be...) it can be discovered via SystemRoot env variable: '%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

gabrielgbs97 avatar Jun 13 '25 06:06 gabrielgbs97

OK, sorry for the hiatus - been busy at work. @medyagh I've removed the fallback as discussed and added code to robustly discover Powershell.exe, using the cited approaches.

james-world avatar Jul 01 '25 09:07 james-world

thank you @james-world, let me ask @bobsira for last approve and then we can merge it @bobsira can you plz test this on windows and see if it fixes the issue?

medyagh avatar Jul 09 '25 18:07 medyagh

@james-world plz see last comments and then we can merge this

medyagh avatar Jul 14 '25 17:07 medyagh

@medyagh Added the requested comment.

james-world avatar Jul 15 '25 13:07 james-world

thank you @james-world

medyagh avatar Jul 21 '25 23:07 medyagh

/ok-to-test

medyagh avatar Jul 21 '25 23:07 medyagh

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 49.5s    │ 50.5s                  │
│ enable ingress │ 15.0s    │ 15.3s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 49.2s 50.9s 48.2s 48.4s 50.8s Times for minikube (PR 20921) start: 49.3s 48.8s 49.4s 52.7s 52.3s

Times for minikube ingress: 15.0s 15.0s 15.0s 14.9s 14.9s Times for minikube (PR 20921) ingress: 15.1s 15.0s 15.5s 15.9s 15.0s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.9s    │ 23.2s                  │
│ enable ingress │ 12.3s    │ 12.5s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 25.2s 22.3s 21.8s 26.9s 23.1s Times for minikube (PR 20921) start: 23.0s 24.3s 25.2s 21.4s 22.2s

Times for minikube ingress: 10.7s 12.7s 12.7s 12.7s 12.7s Times for minikube (PR 20921) ingress: 12.2s 12.7s 11.2s 13.8s 12.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.4s    │ 22.4s                  │
│ enable ingress │ 29.2s    │ 24.4s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 24.1s 24.1s 23.5s 21.0s 24.1s Times for minikube (PR 20921) start: 20.6s 25.2s 21.2s 22.9s 22.2s

Times for minikube ingress: 22.7s 38.8s 38.7s 23.3s 22.7s Times for minikube (PR 20921) ingress: 22.7s 22.7s 22.7s 31.2s 22.7s

minikube-pr-bot avatar Jul 22 '25 00:07 minikube-pr-bot

The failures seem unrelated to this PR (failed to pull an image)

rata avatar Jul 23 '25 12:07 rata

@medyagh I've started to see this kind of error at work; it's docker.io rate-limiting. Definitely nothing to do with this PR.

The rate limiting on anonymous logins is by IP - see here. That means if you are using any shared IP on the build agent pool you can hit limits faster than you might think.

We've addressed it by using pull-through caches (we use ACR for this: https://learn.microsoft.com/en-us/azure/container-registry/artifact-cache-overview)

Guess minikube would need to cut a deal with docker.io, or do something similar.

james-world avatar Jul 27 '25 21:07 james-world

@medyagh Just following up on this - not sure what else I can do? I'm pretty sure the build failure here is an unrelated transient issue with throttled image pulls from docker registry. Anything I can do to help move it along?

james-world avatar Aug 07 '25 13:08 james-world

@medyagh I've started to see this kind of error at work; it's docker.io rate-limiting. Definitely nothing to do with this PR.

The rate limiting on anonymous logins is by IP - see here. That means if you are using any shared IP on the build agent pool you can hit limits faster than you might think.

We've addressed it by using pull-through caches (we use ACR for this: https://learn.microsoft.com/en-us/azure/container-registry/artifact-cache-overview)

Guess minikube would need to cut a deal with docker.io, or do something similar.

thank you for sharing that I will check that out. we have two different rate limit issue, on the host we login, but inside minikube, minikube itself pull images for addons and things like that that causes rate limit. one option would be login to docker inside minikube as well

I will checkout the caching you have linked

medyagh avatar Aug 07 '25 18:08 medyagh

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: james-world, 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:

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

k8s-ci-robot avatar Aug 07 '25 18:08 k8s-ci-robot

thank you very much @james-world for your patience and presistance and making minikube better for our windows users, I look forward to see more contributions from you, maybe you could join one of our Office Hours or Triage Parties https://minikube.sigs.k8s.io/community/

medyagh avatar Aug 07 '25 18:08 medyagh