Commit Graph

184 Commits (master)

Author SHA1 Message Date
Nir Soffer 62529ec03e
spelling: Fix spelling errors with codespell (#21273)
Fix trivial spelling errors using codespell[1]:

    codespell --skip '*.yaml,*.tmpl,*.json,*.html,*.patch,go.sum' -w

And rejecting some false positives fixes:

    ./CHANGELOG.md:907: fliter ==> filter
    ./third_party/go9p/clnt_write.go:48: Writen ==> Written
    ./third_party/kubeadm/app/features/features.go:69: AtLeast ==> at least
    ./site/content/en/docs/contrib/translations.md:106: certificats ==> certificates
    ./site/content/en/docs/contrib/translations.md:113: espace ==> escape
    ./site/content/en/docs/tutorials/amd.md:75: HSA ==> HAS
    ./site/content/en/docs/tutorials/amd.md:87: HSA ==> HAS
    ./pkg/minikube/config/extra_options_test.go:143: expRes ==> express
    ./pkg/minikube/config/extra_options_test.go:151: expRes ==> express
    ./pkg/minikube/config/extra_options_test.go:152: expRes ==> express
    ./pkg/minikube/config/extra_options_test.go:168: expRes ==> express
    ./pkg/minikube/config/extra_options_test.go:177: expRes ==> express
    ./pkg/minikube/config/extra_options_test.go:178: expRes ==> express

There are more spelling errors that need manual selection:

    ./CHANGELOG.md:234: issuse ==> issue, issues
    ./CHANGELOG.md:543: Pris ==> Prise, Prism
    ./hack/benchmark/time-to-k8s/page.go:73: readin ==> reading, read in
    ./hack/benchmark/image-build/generate-chart.go:82: INTERATIVE ==> INTERACTIVE, ITERATIVE
    ./hack/benchmark/image-build/generate-chart.go:87: INTERATIVE ==> INTERACTIVE, ITERATIVE
    ./hack/benchmark/image-build/generate-chart.go:137: INTERATIVE ==> INTERACTIVE, ITERATIVE
    ./hack/benchmark/image-build/generate-chart.go:162: interative ==> interactive, iterative
    ./hack/benchmark/image-build/generate-chart.go:195: INTERATIVE ==> INTERACTIVE, ITERATIVE
    ./third_party/go9p/fmt.go:132: Tread ==> Thread, Treat
    ./third_party/go9p/fmt.go:133: Tread ==> Thread, Treat
    ./third_party/go9p/p9.go:33: Tread ==> Thread, Treat
    ./third_party/go9p/p9.go:170: Tread ==> Thread, Treat
    ./third_party/go9p/p9.go:171: Tread ==> Thread, Treat
    ./third_party/go9p/p9.go:225: Tread ==> Thread, Treat
    ./third_party/go9p/p9.go:263: Tread ==> Thread, Treat
    ./third_party/go9p/packt.go:165: Tread ==> Thread, Treat
    ./third_party/go9p/packt.go:168: Tread ==> Thread, Treat
    ./third_party/go9p/srv_srv.go:305: Tread ==> Thread, Treat
    ./third_party/go9p/srv_srv.go:349: Tread ==> Thread, Treat
    ./third_party/go9p/unpack.go:170: Tread ==> Thread, Treat
    ./site/content/en/docs/tutorials/multi_control_plane_ha_clusters.md:145: Virual ==> Virtual, Visual, Viral
    ./pkg/drivers/krunkit/krunkit.go:392: Terminte ==> Terminate, Termite
    ./pkg/drivers/common/common.go:283: drawin ==> drawing, draw in, drawn
    ./pkg/drivers/kic/oci/oci.go:175: stroed ==> stored, stroked, strode
    ./pkg/minikube/out/out.go:412: isT ==> is, it, its, it's, sit, list
    ./pkg/minikube/out/out.go:413: isT ==> is, it, its, it's, sit, list
    ./pkg/minikube/out/out.go:414: isT ==> is, it, its, it's, sit, list
    ./pkg/minikube/shell/shell_test.go:152: writed ==> wrote, written, write, writer
    ./pkg/minikube/bootstrapper/kubeadm/kubeadm.go:710: wil ==> will, well

If we find a way to prevent the false positives we can use this command
for spell checking in the CI.

[1] https://github.com/codespell-project/codespell
2025-08-11 11:27:20 -07:00
Aaron Nall fc70407316
Add support to docker runtime for OCI access to NVIDIA GPUs (#20959)
* Add support for --device=nvidia.com/gpu=all

* Add "nvidia.com" to valid options for gpus flag in TestValidateGPUs.
2025-08-07 11:23:31 -07:00
Tian 3cf1e63e21
build: address all lint issues by v2 (#20804)
* fix QF1011: could omit type *os.File from declaration; it will be inferred from the right-hand side

* fix QF1012: Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))

* fix QF1001: could apply De Morgan's law

* fix QF1003: could use tagged switch

* fix weakCond: suspicious ; nil check may not be enough, check for len (gocritic)

* fix docStub: silencing go lint doc-comment warnings is unadvised

* fix builtinShadow: shadowing of predeclared identifier: error

* fix importShadow: shadow of imported package

* fix nestingReduce: invert if cond, replace body with , move old body after the statement

* useless-break: useless break in case clause (revive)

* Clear the redundant content in golangci.yaml file
2025-05-23 17:31:28 -07:00
fbyrne 50b5d8ee62 Add support for AMD GPU via --gpu=amd for docker linux amd64. 2024-10-11 21:36:06 +01:00
chubei 2957f964b4 Set `NVIDIA_DRIVER_CAPABILITIES` to `all` when GPU is enabled 2024-08-20 13:39:46 -07:00
Steven Powell b9c6c6ec15 add nolint 2023-10-25 16:36:16 -07:00
Steven Powell a678fe11bd Add "no-limit" option to cpus & memory flags 2023-10-25 16:10:22 -07:00
Steven Powell 55b78ed5cf change gpus flag from bool to string 2023-10-05 17:18:30 -07:00
Steven Powell 7f5fbf98fe Automate installing NVIDIA Container Toolkit w/ flag 2023-10-05 17:18:30 -07:00
Steven Powell 53b09081b4 Automate installing NVIDIA Container Toolkit 2023-10-05 17:18:28 -07:00
Steven Powell 5dd0f26cd7 cleanup: Check for scanner errors 2023-03-31 11:15:34 -07:00
Steven Powell 99b4e45b1e
Revert "Special case port mapping publish on macOS" 2023-01-23 13:19:49 -08:00
Rahil Patel d7baa13960
fix spelling and grammar in Go files 2022-11-03 18:31:44 -04:00
Kian-Meng Ang bc03821826 Fix typos 2022-06-10 15:26:35 -07:00
Steven Powell c099c054b2
Merge pull request #14290 from kgibm/issue12658
Special case port mapping publish on macOS
2022-06-08 11:09:20 -07:00
Kevin Grigorenko 7df74d3e4a
Issue #12658: Special case port mapping publish on macOS
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
2022-06-07 09:24:21 -05:00
Alex Andrews 1d35e4fcf9 return default kernel modules path if alternatives are not found 2022-05-16 22:30:05 +01:00
Alex Andrews e5d8c9d8ef move checkRunning out of CreateContainerNode 2022-05-16 22:30:04 +01:00
Alex Andrews 8fb9165f82 fix NixOS kernel modules path in podman driver 2022-05-16 22:30:04 +01:00
Pablo Caderno f31a1d5020 fix: conditional compiling for cgroups code 2022-05-09 19:41:28 +10:00
Pablo Caderno 947ff0435b fix: small code refactor 2022-05-08 19:46:17 +10:00
Pablo Caderno 7d9eca5eff fix: improved memory cgroup checks
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
2022-05-08 19:46:17 +10:00
Akihiro Suda 92ab555928
Support rootless Podman driver, take 2
Usage:
```
minikube config set rootless true
minikube start --driver=podman --container-runtime=(cri-o|containerd)`
```

Tested on Podman 4.0.2, Ubuntu 21.10.

Needs cgroup v2 (as in Rootless Docker): https://rootlesscontaine.rs/getting-started/common/cgroup2/
See also `site/content/en/docs/drivers/includes/podman_usage.inc`

Fix issue 8719
Fix issue 12460
Replace PR 12901

Changes from PR 12901: `rootless` is now a config property.
In the previous PR, `--rootless` was implemented as a flag for `minikube start`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-05 18:49:40 +09:00
Akihiro Suda 28fdc99086
Podman: fix `minikube delete` for Podman v4
The "minikube" network was not deleted due to the breaking change of
`podman network inspect` in Podman v4.

Fix issue 13861

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-03-30 18:29:14 +09:00
Akihiro Suda 7204b1db3e
KIC rootless: drop fuse-overlayfs; bump kernel requirement to 5.11
minikube 1.23 (PR 12359) added fuse-overlayfs snapshotter for rootless Docker driver,
but got broken in minikube 1.25 (issue 13534).

We can drop fuse-overlayfs for kernel >= 5.11.

Fix issue 13534

We may add back fuse-overlayfs later if there is a huge demand to
support kernel < 5.11.
That will require packing preloadable tarballs for fuse-overlayfs
snapshotter.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-03-22 18:08:14 +09:00
Medya Gh c24818d9b7 lint 2022-02-01 13:21:53 -08:00
Medya Gh 8c6f9f64c7 lint 2022-01-31 15:18:04 -08:00
Piotr Resztak 7b3860388c Print a message about preserving kicbase image
Print additional info about preserving kicbase image and generates
image deletion command for user when running `minikube delete`.
Message is printed only when `--purge` option is used.
2021-11-25 23:36:59 +01:00
Akihiro Suda 323225483e
Support Rootless Docker
Requirements:
- Install rootless Docker 20.10 or later, see https://rootlesscontaine.rs/getting-started/docker/
- Enable cgroup v2 delegation, see https://rootlesscontaine.rs/getting-started/common/cgroup2/

Usage: `minikube start --driver=docker --container-runtime=containerd`.
The `--container-runtime` flag needs to be set to "containerd".
CRI-O can be also supported later.

Closes issue 10836 ("add support for rootless Docker").

Support for rootless Podman (issue 8719) is not covered in this commit.

---

Code reading guide:
- `deploy/kicbase/Dockerfile`: updated to install fuse-overlayfs and containerd-fuse-overlayfs, which is used
  instead of `overlayfs` snapshotter

- `deploy/kicbase/entrypoint`: updated to verify cgroup v2 delegation.
  Mostly from 8a83ee46b2/images/base/files/usr/local/bin/entrypoint

- `cmd/minikube/cmd/start_flags.go`: updated to set `KubeletInUserNamespace` feature gate when rootless

- `pkg/drivers/kic/oci`: updated to use port forwarding, because rootless container IPs are not reachable from the host

- `pkg/minikube/cruntime`: updated to generate `/etc/containerd/config.toml` with rootless support.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-27 17:21:53 +09:00
hetong07 9a30756d38 Improve the error message of setting cgroup memory limit. 2021-02-22 20:18:22 -08:00
hetong07 556a8d7930 Move the user facing warning inside hasMemoryCgroup(). 2021-02-18 16:43:19 -08:00
hetong07 e8c2a23398 Provide an advice for users on how to modify Grub setting. 2021-02-18 16:09:51 -08:00
hetong07 7b0bf57f4c Stop using --memory for cgroup v2. 2021-02-18 15:43:26 -08:00
Medya Ghazizadeh 369f93f393
Merge pull request #10468 from afbjorklund/cgroups-warning
Make sure to show debian warning also for cgroup 2
2021-02-18 14:25:59 -08:00
Medya Ghazizadeh 75be14d2ce
Merge pull request #10507 from afbjorklund/docker-memswap
Stop using --memory-swap if it is not available
2021-02-18 11:15:32 -08:00
Anders F Björklund eabc02d3c4 Stop using --memory-swap if it is not available
With Debian and Ubuntu kernels, it needs to be configured.

And now with cgroups v2, it starts throwing errors at run.
2021-02-18 18:54:36 +01:00
Kent Iso e3cd93aa1a Change prepareVolume func to add container name for preload side car 2021-02-17 10:06:12 +09:00
Anders F Björklund 2c87f6e1ad Make sure to show debian warning also for cgroup 2
Move check to function, to cut down on complexity
2021-02-13 18:37:54 +01:00
Priya Wadhwa a6372b35a3 Add 5 minute timeout to deleting leftover cvolumes and containers 2021-02-08 15:15:08 -08:00
Medya Ghazizadeh 6eadee30b8
Merge pull request #9802 from afbjorklund/podman-host-cleanup
Some more cleanup of missing code for podman-env
2020-12-09 15:00:37 -08:00
Anders F Björklund da778ea870 Some more cleanup of missing code for podman-env
There is a lot of code duplication from docker-env

Most of it also applies for podman (CONTAINER_HOST)
2020-11-29 23:35:37 +01:00
Anders F Björklund fee0f5310a Add private network implementation for podman
Most of it the same as docker, except for the options.

i.e. libnetwork "bridge" plugin vs. cni "bridge" plugin
2020-11-22 13:58:12 +01:00
Ilya Zuyev c97cd912f1 Rename oci.RuntimeHost() -> oci.DaemonHost() 2020-10-30 13:44:34 -07:00
Ilya Zuyev acbdafa4e1 Fix func naming 2020-10-27 16:07:50 -07:00
Ilya Zuyev 6e02753204 Forward ports for docker machine on Linux 2020-10-22 22:41:58 -07:00
Ilya Zuyev 89bf9ac01c Update certs and API endpoints 2020-10-22 22:10:07 -07:00
Ilya Zuyev eaa9ecfd31 Experiments 2020-10-22 13:41:01 -07:00
Ilya Zuyev 85d45be207 Fix docker-env command 2020-10-20 23:10:08 -07:00
Ilya Zuyev d384343c39 When configuring docker environment, use MINIKUBE_EXISTING_* variables if set 2020-10-19 22:02:42 -07:00
Nick Kubala fd15e50dbe
Fix typo (cointainer -> container) 2020-10-13 14:20:35 -07:00