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

Remove deprecated drivers: kvm-old and xhyve #4781

Merged
merged 12 commits into from
Jul 17, 2019
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ release-minikube: out/minikube checksum
gsutil cp out/minikube-$(GOOS)-$(GOARCH) $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH)
gsutil cp out/minikube-$(GOOS)-$(GOARCH).sha256 $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH).sha256

out/docker-machine-driver-kvm2:
out/docker-machine-driver-kvm2: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
go build \
-installsuffix "static" \
-ldflags="$(KVM2_LDFLAGS)" \
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ var configTestCases = []configTestCase{
"log_dir": "/etc/hosts",
"show-libmachine-logs": true,
"v": 5,
"vm-driver": "kvm"
"vm-driver": "kvm2"
}`,
config: map[string]interface{}{
"vm-driver": constants.DriverKvmOld,
"vm-driver": constants.DriverKvm2,
"cpus": 4,
"disk-size": "20g",
"v": 5,
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

var minikubeConfig = pkgConfig.MinikubeConfig{
"vm-driver": constants.DriverKvmOld,
"vm-driver": constants.DriverKvm2,
"cpus": 12,
"show-libmachine-logs": true,
}
Expand Down
15 changes: 4 additions & 11 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const (
cpus = "cpus"
humanReadableDiskSize = "disk-size"
vmDriver = "vm-driver"
xhyveDiskDriver = "xhyve-disk-driver"
nfsSharesRoot = "nfs-shares-root"
nfsShare = "nfs-share"
kubernetesVersion = "kubernetes-version"
Expand Down Expand Up @@ -163,7 +162,8 @@ func initKubernetesFlags() {
// initDriverFlags inits the commandline flags for vm drivers
func initDriverFlags() {
startCmd.Flags().String(vmDriver, constants.DefaultVMDriver, fmt.Sprintf("VM driver is one of: %v", constants.SupportedVMDrivers))
// kvm

// kvm2
startCmd.Flags().String(kvmNetwork, "default", "The KVM network name. (only supported with KVM driver)")
startCmd.Flags().String(kvmQemuURI, "qemu:///system", "The KVM QEMU connection URI. (works only with kvm2 driver on linux)")
startCmd.Flags().Bool(kvmGPU, false, "Enable experimental NVIDIA GPU support in minikube")
Expand All @@ -184,11 +184,6 @@ func initDriverFlags() {

// hyperv
startCmd.Flags().String(hypervVirtualSwitch, "", "The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)")

// xhyveDiskDriver
startCmd.Flags().String(xhyveDiskDriver, "ahci-hd", "The disk driver to use [ahci-hd|virtio-blk] (only supported with xhyve driver)")
startCmd.Flags().Bool(disableDriverMounts, false, "Disables the filesystem mounts provided by the hypervisors (vboxfs, xhyve-9p)")

}

// initNetworkingFlags inits the commandline flags for connectivity related flags for start
Expand All @@ -206,9 +201,8 @@ func initNetworkingFlags() {
var startCmd = &cobra.Command{
Use: "start",
Short: "Starts a local kubernetes cluster",
Long: `Starts a local kubernetes cluster using VM. This command
assumes you have already installed one of the VM drivers: virtualbox/parallels/vmwarefusion/kvm/xhyve/hyperv.`,
Run: runStart,
Long: "Starts a local kubernetes cluster",
Run: runStart,
}

// runStart handles the executes the flow of "minikube start"
Expand Down Expand Up @@ -569,7 +563,6 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
ContainerRuntime: viper.GetString(containerRuntime),
HyperkitVpnKitSock: viper.GetString(vpnkitSock),
HyperkitVSockPorts: viper.GetStringSlice(vsockPorts),
XhyveDiskDriver: viper.GetString(xhyveDiskDriver),
NFSShare: viper.GetStringSlice(nfsShare),
NFSSharesRoot: viper.GetString(nfsSharesRoot),
DockerEnv: dockerEnv,
Expand Down
7 changes: 3 additions & 4 deletions docs/cli_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ minikube service [command]

---
### start
**Description -** Starts a local kubernetes cluster using VM. This command assumes you have already installed one of the VM drivers: **virtualbox/parallels/vmwarefusion/kvm/xhyve/hyperv**.
**Description -** Starts a local kubernetes cluster.
**Usage -** `minikube start [flags]`
**Available Flags -**
```
Expand All @@ -259,7 +259,7 @@ minikube service [command]
--container-runtime string The container runtime to be used (docker, crio, containerd) (default "docker")
--cpus int Number of CPUs allocated to the minikube VM (default 2)
--cri-socket string The cri socket path to be used
--disable-driver-mounts Disables the filesystem mounts provided by the hypervisors (vboxfs, xhyve-9p)
--disable-driver-mounts Disables the filesystem mounts provided by the hypervisors (vboxfs)
--disk-size string Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g) (default "20000mb")
--dns-domain string The cluster dns domain name used in the kubernetes cluster (default "cluster.local")
--docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value)
Expand Down Expand Up @@ -295,8 +295,7 @@ minikube service [command]
--registry-mirror strings Registry mirrors to pass to the Docker daemon
--service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12")
--uuid string Provide VM UUID to restore MAC address (only supported with Hyperkit driver).
--vm-driver string VM driver is one of: [virtualbox parallels vmwarefusion kvm xhyve hyperv hyperkit kvm2 vmware none] (default "virtualbox")
--xhyve-disk-driver string The disk driver to use [ahci-hd|virtio-blk] (only supported with xhyve driver) (default "ahci-hd")
--vm-driver string VM driver is one of: [virtualbox parallels vmwarefusion kvm hyperv hyperkit kvm2 vmware none] (default "virtualbox")
```

---
Expand Down
38 changes: 8 additions & 30 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,35 +318,15 @@ func engineOptions(config cfg.MachineConfig) *engine.Options {
return &o
}

func preCreateHost(config *cfg.MachineConfig) {
switch config.VMDriver {
case constants.DriverKvmOld:
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
console.Warning(`The kvm driver is deprecated and support for it will be removed in a future release.
Please consider switching to the kvm2 driver, which is intended to replace the kvm driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver for more information.
To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`)
}
case constants.DriverXhyve:
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
console.Warning(`The xhyve driver is deprecated and support for it will be removed in a future release.
Please consider switching to the hyperkit driver, which is intended to replace the xhyve driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver for more information.
To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`)
}
case constants.DriverVmwareFusion:
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
console.Warning(`The vmwarefusion driver is deprecated and support for it will be removed in a future release.
Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.
To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`)
}
}
}

func createHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error) {
preCreateHost(&config)
console.OutStyle(console.StartingVM, "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...", config.VMDriver, config.CPUs, config.Memory, config.DiskSize)
if config.VMDriver == constants.DriverVmwareFusion && viper.GetBool(cfg.ShowDriverDeprecationNotification) {
console.Warning(`The vmwarefusion driver is deprecated and support for it will be removed in a future release.
Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.
To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`)
}

def, err := registry.Driver(config.VMDriver)
if err != nil {
if err == registry.ErrDriverNotFound {
Expand Down Expand Up @@ -407,8 +387,6 @@ func GetHostDockerEnv(api libmachine.API) (map[string]string, error) {
// GetVMHostIP gets the ip address to be used for mapping host -> VM and VM -> host
func GetVMHostIP(host *host.Host) (net.IP, error) {
switch host.DriverName {
case constants.DriverKvmOld:
return net.ParseIP("192.168.42.1"), nil
case constants.DriverKvm2:
return net.ParseIP("192.168.39.1"), nil
case constants.DriverHyperv:
Expand All @@ -432,7 +410,7 @@ func GetVMHostIP(host *host.Host) (net.IP, error) {
return []byte{}, errors.Wrap(err, "Error getting VM/Host IP address")
}
return ip, nil
case constants.DriverXhyve, constants.DriverHyperkit:
case constants.DriverHyperkit:
return net.ParseIP("192.168.64.1"), nil
case constants.DriverVmware:
vmIPString, err := host.Driver.GetIP()
Expand Down
2 changes: 0 additions & 2 deletions pkg/minikube/cluster/default_drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ import (
// Import all the default drivers
_ "k8s.io/minikube/pkg/minikube/drivers/hyperkit"
_ "k8s.io/minikube/pkg/minikube/drivers/hyperv"
_ "k8s.io/minikube/pkg/minikube/drivers/kvm"
_ "k8s.io/minikube/pkg/minikube/drivers/kvm2"
_ "k8s.io/minikube/pkg/minikube/drivers/none"
_ "k8s.io/minikube/pkg/minikube/drivers/parallels"
_ "k8s.io/minikube/pkg/minikube/drivers/virtualbox"
_ "k8s.io/minikube/pkg/minikube/drivers/vmware"
_ "k8s.io/minikube/pkg/minikube/drivers/vmwarefusion"
_ "k8s.io/minikube/pkg/minikube/drivers/xhyve"
)
2 changes: 1 addition & 1 deletion pkg/minikube/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var configTestCases = []configTestCase{
"vm-driver": "kvm"
}`,
config: map[string]interface{}{
"vm-driver": constants.DriverKvmOld,
"vm-driver": constants.DriverKvm2,
"cpus": 4,
"disk-size": "20g",
"v": 5,
Expand Down
3 changes: 1 addition & 2 deletions pkg/minikube/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type MachineConfig struct {
ContainerRuntime string
HyperkitVpnKitSock string // Only used by the Hyperkit driver
HyperkitVSockPorts []string // Only used by the Hyperkit driver
XhyveDiskDriver string // Only used by the xhyve driver
DockerEnv []string // Each entry is formatted as KEY=VALUE.
InsecureRegistry []string
RegistryMirror []string
Expand All @@ -51,7 +50,7 @@ type MachineConfig struct {
KVMHidden bool // Only used by kvm2
Downloader util.ISODownloader `json:"-"`
DockerOpt []string // Each entry is formatted as KEY=VALUE.
DisableDriverMounts bool // Only used by virtualbox and xhyve
DisableDriverMounts bool // Only used by virtualbox
NFSShare []string
NFSSharesRoot string
UUID string // Only used by hyperkit to restore the mac address
Expand Down
8 changes: 0 additions & 8 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ func ArchTag(hasTag bool) string {
// DriverNone is the none driver.
const DriverNone = "none"

// DriverKvmOld is the depricated kvm driver option name
const DriverKvmOld = "kvm"

// DriverKvm2 is the kvm2 driver option name for in linux
const DriverKvm2 = "kvm2"

Expand All @@ -83,9 +80,6 @@ const DriverVmwareFusion = "vmwarefusion"
// DriverHyperv is the hyperv driver option for windows
const DriverHyperv = "hyperv"

// DriverXhyve is the depricated xhyve driver option name
const DriverXhyve = "xhyve"

// DriverParallels is the parallels driver option name
const DriverParallels = "parallels"

Expand All @@ -95,8 +89,6 @@ var SupportedVMDrivers = [...]string{
DriverVirtualbox,
DriverParallels,
DriverVmwareFusion,
DriverKvmOld,
DriverXhyve,
DriverHyperv,
DriverHyperkit,
DriverKvm2,
Expand Down
19 changes: 0 additions & 19 deletions pkg/minikube/drivers/kvm/doc.go

This file was deleted.

76 changes: 0 additions & 76 deletions pkg/minikube/drivers/kvm/driver.go

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/minikube/drivers/xhyve/doc.go

This file was deleted.

Loading