Skip to content

Commit

Permalink
Add new macOS vfkit driver, like hyperkit and qemu (#19423)
Browse files Browse the repository at this point in the history
* Add new macOS vfkit driver, like hyperkit and qemu

It uses the new Virtualization.framework from macOS 11,
instead of the older Hypervisor.framework (hvf) in QEMU.

* Start vfkit in a new process group

* vfkit: Add firewall workaround from minikube

* vfkit: Add HostIP implementation for gateway

* vfkit: Add driver to extra-disks supported

* Add documentation for vfkit driver

* vfkit: Add usual integration tests

* Update site/content/en/docs/drivers/vfkit.md

Co-authored-by: Steven Powell <[email protected]>

---------

Co-authored-by: Nir Soffer <[email protected]>
Co-authored-by: Medya Ghazizadeh <[email protected]>
Co-authored-by: Steven Powell <[email protected]>
  • Loading branch information
4 people authored Sep 3, 2024
1 parent 613a681 commit 5295883
Show file tree
Hide file tree
Showing 13 changed files with 729 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ func interpretWaitFlag(cmd cobra.Command) map[string]bool {
}

func checkExtraDiskOptions(cmd *cobra.Command, driverName string) {
supportedDrivers := []string{driver.HyperKit, driver.KVM2, driver.QEMU2}
supportedDrivers := []string{driver.HyperKit, driver.KVM2, driver.QEMU2, driver.VFKit}

if cmd.Flags().Changed(extraDisks) {
supported := false
Expand Down
3 changes: 3 additions & 0 deletions hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ case "${DRIVER}" in
virtualbox)
echo "vbox: $(vboxmanage --version)"
;;
vfkit)
echo "vfkit: $(vfkit --version)"
;;
esac

echo ""
Expand Down
1 change: 1 addition & 0 deletions hack/jenkins/minikube_set_pending.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs=(
'Docker_Windows'
'Docker_Cloud_Shell'
'QEMU_macOS'
'VFkit_macOS'
)

STARTED_LIST_REMOTE="gs://minikube-builds/logs/${ghprbPullId}/${BUILD_NUMBER}/started_environments.txt"
Expand Down
39 changes: 39 additions & 0 deletions hack/jenkins/osx_integration_tests_vfkit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Copyright 2024 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# This script runs the integration tests on an OSX machine for the Hyperkit Driver

# The script expects the following env variables:
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
# COMMIT: Actual commit ID from upstream build
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The GitHub API access token. Injected by the Jenkins credential provider.


set -ex

ARCH="arm64"
OS="darwin"
DRIVER="vfkit"
JOB_NAME="VFkit_macOS"
EXTRA_TEST_ARGS=""
EXTERNAL="yes"

brew tap cfergeau/crc
brew install vfkit

source common.sh
Loading

0 comments on commit 5295883

Please sign in to comment.