Commit Graph

26019 Commits (2670400830a855aecafd3c5f7c6d49a7800a6db9)

Author SHA1 Message Date
minikube-bot eba8fc9e50
Update auto-generated docs and translations (#20687) 2025-05-01 13:49:57 -04:00
Nir Soffer 55b88a6763
Shared network for vfkit driver using vmnet-helper (#20501)
* vfkit: Remove temporary variable

Remove temporary and unneeded mac variable. It is easier to follow the
code when we use d.MACAddress.

* vfkit: Promote state change to INFO level

System state changes should be more visible to make debugging easier.

* vmnet: Add vmnet package

The package manages the vmnet-helper[1] child process, providing
connection to the vmnet network without running the guest as root.

We will use vmnet-helper for the vfkit driver, which does not have a way
to use shared network, when guests can access other guest in the
network.  We can use it later with the qemu driver as alternative to
socket_vmnet.

[1] https://github.com/nirs/vmnet-helper

* vfkit: add vmnet-shared network

Add new network option for vfkit "vmnet-shared", connecting vfkit to the
vmnet shared network. Clusters using this network can access other
clusters in the same network, similar to socket_vmnet with QEMU driver.

If network is not specified, we default to the "nat" network, keeping
the previous behavior. If network is "vmnet-shared", the vfkit driver
manages 2 processes: vfkit and vmnet-helper.

Like vfkit, vmnet-helper is started in the background, in a new process
group, so it not terminated if the minikube process group is terminate.

Since vmnet-helper requires root to start the vmnet interface, we start
it with sudo, creating 2 child processes. vmnet-helper drops privileges
immediately after starting the vmnet interface, and run as the user and
group running minikube.

Stopping the cluster will stop sudo, which will stop the vmnet-helper
process. Deleting the cluster kill both sudo and vmnet-helper by killing
the process group.

This change is not complete, but it is good enough to play with the new
shared network.

Example usage:

1. Install vmnet-helper:
   https://github.com/nirs/vmnet-helper?tab=readme-ov-file#installation

2. Setup vmnet-helper sudoers rule:
   https://github.com/nirs/vmnet-helper?tab=readme-ov-file#granting-permission-to-run-vmnet-helper

3. Start 2 clusters with vmnet-shared network:

    % minikube start -p c1 --driver vfkit --network vmnet-shared
    ...

    % minikube start -p c2 --driver vfkit --network vmnet-shared
    ...

    % minikube ip -p c1
    192.168.105.18

    % minikube ip -p c2
    192.168.105.19

4. Both cluster can access the other cluster:

    % minikube -p c1 ssh -- ping -c 3 192.168.105.19
    PING 192.168.105.19 (192.168.105.19): 56 data bytes
    64 bytes from 192.168.105.19: seq=0 ttl=64 time=0.621 ms
    64 bytes from 192.168.105.19: seq=1 ttl=64 time=0.989 ms
    64 bytes from 192.168.105.19: seq=2 ttl=64 time=0.490 ms

    --- 192.168.105.19 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 0.490/0.700/0.989 ms

    % minikube -p c2 ssh -- ping -c 3 192.168.105.18
    PING 192.168.105.18 (192.168.105.18): 56 data bytes
    64 bytes from 192.168.105.18: seq=0 ttl=64 time=0.289 ms
    64 bytes from 192.168.105.18: seq=1 ttl=64 time=0.798 ms
    64 bytes from 192.168.105.18: seq=2 ttl=64 time=0.993 ms

    --- 192.168.105.18 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 0.289/0.693/0.993 ms

* reason: Remove trailing whitepsace

Trailing whitespace is removed by some editors or displayed as a
warning. Clean up to make it easy to make maintain this file.

* start: Validate vfkit --network option

The vfkit driver supports now `nat` and `vmnet-shared` network options.
The `nat` option provides the best performance and is always available,
so it is the default network option. The `vmnet-shared` option provides
access between machines with lower performance compared to `nat`.

If `vment-shared` option is selected, we verify that vmnet-helper is
available. The check ensure that vmnet-helper is installed and sudoers
configuration allows the current user to run vment-helper without a
password.

If validating vment-helper failed, we return a new NotFoundVmnetHelper
reason pointing to vment-helper installation docs or recommending to use
`nat`. This is based on how we treat missing socket_vmnet for QEMU
driver.

* site: Document vfkit network options
2025-05-01 13:26:48 -04:00
dependabot[bot] e5906629a2
Build(deps): Bump cloud.google.com/go/storage from 1.50.0 to 1.52.0 (#20678)
Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.50.0 to 1.52.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.50.0...spanner/v1.52.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-version: 1.52.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 13:06:27 -04:00
minikube-bot 15e1263d66
update Kubernetes versions list (#20660) 2025-04-30 14:56:29 -04:00
minikube-bot 908f7d5dac
bump default/newest kubernetes versions (#20661) 2025-04-30 14:56:05 -04:00
minikube-bot e3f5d85463
update image constants for kubeadm images (#20659) 2025-04-30 14:54:49 -04:00
dependabot[bot] c83e759975
Build(deps): Bump github.com/opencontainers/runc from 1.2.5 to 1.2.6 (#20674)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.2.5...v1.2.6)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-version: 1.2.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 16:45:14 -04:00
dependabot[bot] eea787a65b
Build(deps): Bump actions/download-artifact from 4.2.1 to 4.3.0 (#20676)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](95815c38cf...d3f86a106a)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 16:44:53 -04:00
minikube-bot 6f563afb6d
Addon kubevirt: Update bitnami/kubectl image from 1.32.3 to 1.33.0 (#20665) 2025-04-28 16:14:02 -04:00
minikube-bot 49bb44034d
Update auto-generated docs and translations (#20672) 2025-04-28 15:49:35 -04:00
Predrag Rogic c8a63fa11f
Fix waiting for all pods having specified labels to be Ready (#20315)
* Fix waiting for all kube-system pods having one of specified labels to be Ready

* Fix waiting for all kube-system pods having one of specified labels to be Ready

* Fix waiting for all kube-system pods having one of specified labels to be Ready
2025-04-28 14:58:02 -04:00
minikube-bot 9797ec1b10
CI: Update gh from 2.70.0 to 2.71.2 (#20664) 2025-04-28 14:57:30 -04:00
minikube-bot 0008a6cce0
Addon cloud-spanner: Update cloud-spanner-emulator/emulator image from 1.5.32 to 1.5.33 (#20670) 2025-04-28 14:40:42 -04:00
minikube-bot 10b98ab821
site: Update node from 20.19.0 to 20.19.1 (#20671) 2025-04-28 12:11:53 -04:00
Kubernetes Prow Robot a7f87917f9
Merge pull request #20634 from cdw8431/add-korean-translations
Add more Korean translations
2025-04-24 13:08:31 -07:00
dependabot[bot] e96371c9b1
Build(deps): Bump github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace (#20492)
Bumps [github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go) from 1.26.0 to 1.27.0.
- [Release notes](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/releases)
- [Commits](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/compare/detectors/gcp/v1.26.0...detectors/gcp/v1.27.0)

---
updated-dependencies:
- dependency-name: github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-24 12:59:26 -07:00
minikube-bot 51f909bac6
Addon registry: Update registry image from 2.8.3 to 3.0.0 (#20425) 2025-04-24 12:58:08 -07:00
minikube-bot fd1e014974
Addon kubevirt: Update bitnami/kubectl image from 1.32.1 to 1.32.3 (#20349) 2025-04-24 12:56:32 -07:00
minikube-bot 682dd5b70a
Addon nvidia-device-plugin: Update nvidia/k8s-device-plugin image from v0.17.0 to v0.17.1 (#20534) 2025-04-24 11:54:22 -07:00
minikube-bot d8520ff6dd
Addon inspektor-gadget: Update inspektor-gadget image from v0.37.0 to v0.39.0 (#20512) 2025-04-24 11:53:26 -07:00
minikube-bot 8d3946f8d4
CI: Update gh from 2.66.1 to 2.70.0 (#20420) 2025-04-24 11:52:39 -07:00
minikube-bot 832e8b2404
Addon kong: Update kong/kubernetes-ingress-controller image from 3.4.1 to 3.4.4 (#20446) 2025-04-24 11:43:02 -07:00
minikube-bot 8ca52a326f
HA (multi-control plane): Update kube-vip from v0.8.10 to v0.9.0 (#20638) 2025-04-24 11:34:06 -07:00
minikube-bot 1fd355c7da
CNI: Update cilium from v1.17.2 to v1.17.3 (#20637) 2025-04-24 11:31:43 -07:00
minikube-bot 889274e6ed
CNI: Update flannel from v0.26.6 to v0.26.7 (#20639) 2025-04-24 11:16:47 -07:00
Sylvester Carolan 262895b07b
Added additonal checks for 9p support (#20288) 2025-04-24 20:14:05 +02:00
minikube-bot ce447e2fec
Site: Update hugo from v0.144.2 to v0.146.6 (#20483) 2025-04-24 10:55:16 -07:00
cdw8431 fa9b2ade32 Add some Korean translations 2025-04-17 14:45:37 +09:00
minikube-bot ff698bb73e
CNI: Update calico from v3.29.2 to v3.29.3 (#20584) 2025-04-15 13:29:48 -07:00
minikube-bot 74adcbd58e
Addon Volcano: Update volcano images from v1.11.0 to v1.11.1 (#20616) 2025-04-15 13:29:18 -07:00
minikube-bot 51c301602f
CNI: Update flannel from v0.26.4 to v0.26.6 (#20617) 2025-04-15 13:28:47 -07:00
minikube-bot a4059331a0
Update go-github from v70.0.0 to v71.0.0 (#20618) 2025-04-15 13:28:27 -07:00
minikube-bot 7177b54b55
Addon cloud-spanner: Update cloud-spanner-emulator/emulator image from 1.5.31 to 1.5.32 (#20623) 2025-04-15 13:26:30 -07:00
dependabot[bot] 51f58958fa
Build(deps): Bump kubernetes-sigs/release-actions from 0.3.0 to 0.3.1 (#20625)
Bumps [kubernetes-sigs/release-actions](https://github.com/kubernetes-sigs/release-actions) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/kubernetes-sigs/release-actions/releases)
- [Changelog](https://github.com/kubernetes-sigs/release-actions/blob/main/RELEASE.md)
- [Commits](a69972745f...a30d93cf2a)

---
updated-dependencies:
- dependency-name: kubernetes-sigs/release-actions
  dependency-version: 0.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 13:21:30 -07:00
Medya Ghazizadeh ec971ba85b
Update OWNERS (#20207) 2025-04-14 11:40:38 -07:00
Medya Ghazizadeh 0e6675c48c
update prow image (#20626) 2025-04-14 11:37:54 -07:00
minikube-bot fe470c1679
Kicbase/ISO: Update runc from v1.2.5 to v1.2.6 (#20604)
* Kicbase/ISO: Update runc from v1.2.5 to v1.2.6

* Updating kicbase image to v0.0.46-1744107393-20604
2025-04-10 14:15:59 -07:00
minikube-bot 65ded669af
HA (multi-control plane): Update kube-vip from v0.8.9 to v0.8.10 (#20598) 2025-04-07 11:17:16 -07:00
minikube-bot 17a537994c
Addon cloud-spanner: Update cloud-spanner-emulator/emulator image from 1.5.30 to 1.5.31 (#20602) 2025-04-07 09:45:33 -07:00
minikube-bot 709f200e9b
Kicbase/ISO: Update docker from 28.0.1 to 28.0.4 (#20591)
* Kicbase/ISO: Update docker from 28.0.1 to 28.0.4

* Updating kicbase image to v0.0.46-1743675393-20591
2025-04-04 12:07:07 -07:00
minikube-bot 3b71fa646c
Update yearly leaderboard (#20590) 2025-04-02 09:47:43 -07:00
Nir Soffer adc341cdcf
vfkit: More robust state management (#20506)
* Add process package

Current code contains multiple implementations for managing a process
using pids, with various issues:

- Some are unsafe, terminating a process by pid without validating that
  the pid belongs to the right process. Some use unclear
- Using unclear terms like checkPid() (what does it mean?)
- Some are missing tests

Let's clean up the mess by introducing a process package. The package
provides:

- process.WritePidfile(): write a pid to file
- process.ReadPidfile(): read pid from file
- process.Exists(): tells if process matching pid and name exists
- process.Terminate() terminates a process matching pid and name
- process.Kil() kill a process matching pid and name

The library is tested on linux, darwin, and windows. On windows we don't
have a standard way to terminate a process gracefully, so
process.Terminate() is the same as process.Kill().

I want to use this package in vfkit and the new vment package, and later
we can use it for qemu, hyperkit, and other code using managing
processes with pids.

* vfkit: Use process pidfile helpers

- Simplify GetState() using process.ReadPidfile()
- Simplify Start() using process.WritePidfile()

* vfkit: Simpler and more robust GetState()

GetState() had several issues:

- When accessing vfkit HTTP API, we handled only "running",
  "VirtualMachineStateRunning", "stopped", and
  "VirtualMachineStateStopped", but there are other 10 possible states,
  which we handled as state.None, when vfkit is running and need to be
  stopped. This can lead to wrong handling in the caller.

- When handling "stopped" and "VirtualMachineStateStopped" we returned
  state.Stopped, but did not remove the pidfile. This can cause
  termination of unrelated process or reporting wrong status when the
  pid is reused.

- Accessing the HTTP API will fail after we stop or kill it. This
  cause GetState() to fail when the process is actually stopped, which
  can lead to unnecessary retries and long delays (#20503).

- When retuning state.None during Remove(), we use tried to do graceful
  shutdown which does not make sense in minikube delete flow, and is not
  consistent with state.Running handling.

Accessing vfkit API to check for state does not add much value for our
used case, checking if the vfkit process is running, and it is not
reliable.

Fix all the issues by not using the HTTP API in GetState(), and use only
the process state. We still use the API for stopping and killing vfkit
to do graceful shutdown. This also simplifies Remove(), since we need to
handle only the state.Running state.

With this change we consider vfkit as stopped only when the process does
not exist, which takes about 3 seconds after the state is reported as
"stopped".

Example stop flow:

    I0309 18:15:40.260249   18857 main.go:141] libmachine: Stopping "minikube"...
    I0309 18:15:40.263225   18857 main.go:141] libmachine: set state: {State:Stop}
    I0309 18:15:46.266902   18857 main.go:141] libmachine: Machine "minikube" was stopped.
    I0309 18:15:46.267122   18857 stop.go:75] duration metric: took 6.127761459s to stop

Example delete flow:

    I0309 17:00:49.483078   18127 out.go:177] * Deleting "minikube" in vfkit ...
    I0309 17:00:49.499252   18127 main.go:141] libmachine: set state: {State:HardStop}
    I0309 17:00:49.569938   18127 lock.go:35] WriteFile acquiring /Users/nir/.kube/config: ...
    I0309 17:00:49.573977   18127 out.go:177] * Removed all traces of the "minikube" cluster.

* vfkit: Use process.Exists()

Previously we did not check the process name when checking a pid from a
pidfile. If the pidfile became state we would assume that vfkit is
running and try to stop it via the HTTP API, which would never succeed.
Now we detect stale pidfile and remove it.

If removing the stale pidfile fails, we don't want to fail the operation
since we know that vfkit is not running. We log the failure to aid
debugging of stale pidfile.

* vfkit: More robust Stop()

If setting vfkit state to "Stop" fails, we used to return an error.
Retrying the operation may never succeed.

Fix by falling back to terminating vfkit using a signal. This terminates
vfkit immediately similar to HardStop[1].

We can still fail if the pidfile is corrupted but this is unlikely and
requires manual cleanup.

In the case when we are sure the vfkit process does not exist, we remove
the pidfile immediately, avoiding leftover pidfile if the caller does
not call GetState() after Stop().

[1] https://github.com/crc-org/vfkit/issues/284

* vfkit: More robust Kill()

We know that setting the state to `HardStop` typically fails:

    I0309 19:19:42.378591   21795 out.go:177] 🔥  Deleting "minikube" in vfkit ...
    W0309 19:19:42.397472   21795 delete.go:106] remove failed, will retry: kill: Post "http://_/vm/state": EOF

This may lead to unnecessary retries and delays. Fix by falling back to
sending a SIGKILL signal.

Example delete flow when setting vfkit state fails:

    I0309 20:07:41.688259   25540 out.go:177] 🔥  Deleting "minikube" in vfkit ...
    I0309 20:07:41.712017   25540 main.go:141] libmachine: Failed to set vfkit state to 'HardStop': Post "http://_/vm/state": EOF
2025-04-02 09:47:15 -07:00
dependabot[bot] 42aa2eab55
Build(deps): Bump actions/upload-artifact from 4.6.1 to 4.6.2 (#20570)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](4cec3d8aa0...ea165f8d65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 15:13:28 -07:00
dependabot[bot] 049f7a0652
Build(deps): Bump actions/download-artifact from 4.1.9 to 4.2.1 (#20571)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.9 to 4.2.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](cc20338598...95815c38cf)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 15:13:02 -07:00
dependabot[bot] 334c582a9b
Build(deps): Bump actions/setup-go from 5.3.0 to 5.4.0 (#20572)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](f111f3307d...0aaccfd150)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 14:35:23 -07:00
Aaina Lohia cf12d1e2c4
fixed minor typo in german translation (#20546) 2025-03-24 11:15:16 -07:00
minikube-bot 4d2cdae349
Update go-github from v69.2.0 to v70.0.0 (#20561) 2025-03-24 11:13:19 -07:00
minikube-bot fdfe612eb5
CNI: Update cilium from v1.17.1 to v1.17.2 (#20535) 2025-03-18 15:06:09 -07:00
minikube-bot 08c0e594b8
Addon cloud-spanner: Update cloud-spanner-emulator/emulator image from 1.5.29 to 1.5.30 (#20539) 2025-03-18 15:05:44 -07:00
Tian 494cd7b002
translations: Add more Chinese translations (#20543) 2025-03-18 15:05:20 -07:00