提交 f2f53e94 编写于 作者: A Aaron Prindle

Added hyperv virtual switch configuration flag for hyperv driver. Also

updated docs.
上级 792ad7a7
......@@ -45,6 +45,7 @@ const (
hostOnlyCIDR = "host-only-cidr"
containerRuntime = "container-runtime"
networkPlugin = "network-plugin"
hypervVirtualSwitch = "hyperv-virtual-switch"
)
var (
......@@ -69,15 +70,16 @@ func runStart(cmd *cobra.Command, args []string) {
defer api.Close()
config := cluster.MachineConfig{
MinikubeISO: viper.GetString(isoURL),
Memory: viper.GetInt(memory),
CPUs: viper.GetInt(cpus),
DiskSize: calculateDiskSizeInMB(viper.GetString(humanReadableDiskSize)),
VMDriver: viper.GetString(vmDriver),
DockerEnv: dockerEnv,
InsecureRegistry: insecureRegistry,
RegistryMirror: registryMirror,
HostOnlyCIDR: viper.GetString(hostOnlyCIDR),
MinikubeISO: viper.GetString(isoURL),
Memory: viper.GetInt(memory),
CPUs: viper.GetInt(cpus),
DiskSize: calculateDiskSizeInMB(viper.GetString(humanReadableDiskSize)),
VMDriver: viper.GetString(vmDriver),
DockerEnv: dockerEnv,
InsecureRegistry: insecureRegistry,
RegistryMirror: registryMirror,
HostOnlyCIDR: viper.GetString(hostOnlyCIDR),
HypervVirtualSwitch: viper.GetString(hypervVirtualSwitch),
}
var host *host.Host
......@@ -197,6 +199,7 @@ func init() {
startCmd.Flags().Int(cpus, constants.DefaultCPUS, "Number of CPUs allocated to the minikube VM")
startCmd.Flags().String(humanReadableDiskSize, constants.DefaultDiskSize, "Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g)")
startCmd.Flags().String(hostOnlyCIDR, "192.168.99.1/24", "The CIDR to be used for the minikube VM (only supported with Virtualbox driver)")
startCmd.Flags().String(hypervVirtualSwitch, "", "The hyperv virtual switch name. Defaults to first found. (only supported with driver)")
startCmd.Flags().StringSliceVar(&dockerEnv, "docker-env", nil, "Environment variables to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().StringSliceVar(&insecureRegistry, "insecure-registry", nil, "Insecure Docker registries to pass to the Docker daemon")
startCmd.Flags().StringSliceVar(&registryMirror, "registry-mirror", nil, "Registry mirrors to pass to the Docker daemon")
......
......@@ -15,22 +15,23 @@ minikube start
### Options
```
--container-runtime string The container runtime to be used
--cpus int Number of CPUs allocated to the minikube VM (default 2)
--disk-size string Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g) (default "20g")
--docker-env value Environment variables to pass to the Docker daemon. (format: key=value) (default [])
--extra-config value A set of key=value pairs that describe configuration that may be passed to different components.
--container-runtime string The container runtime to be used
--cpus int Number of CPUs allocated to the minikube VM (default 2)
--disk-size string Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g) (default "20g")
--docker-env value Environment variables to pass to the Docker daemon. (format: key=value) (default [])
--extra-config value A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
Valid components are: kubelet, apiserver, controller-manager, etcd, proxy, scheduler.
--host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24")
--insecure-registry value Insecure Docker registries to pass to the Docker daemon (default [])
--iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/minikube-0.7.iso")
--kubernetes-version string The kubernetes version that the minikube VM will (ex: v1.2.3)
--host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24")
--hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with driver)
--insecure-registry value Insecure Docker registries to pass to the Docker daemon (default [])
--iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/minikube-0.7.iso")
--kubernetes-version string The kubernetes version that the minikube VM will (ex: v1.2.3)
OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64) (default "v1.4.3")
--memory int Amount of RAM allocated to the minikube VM (default 2048)
--network-plugin string The name of the network plugin
--registry-mirror value Registry mirrors to pass to the Docker daemon (default [])
--vm-driver string VM driver is one of: [virtualbox vmwarefusion kvm xhyve hyperv] (default "virtualbox")
--memory int Amount of RAM allocated to the minikube VM (default 2048)
--network-plugin string The name of the network plugin
--registry-mirror value Registry mirrors to pass to the Docker daemon (default [])
--vm-driver string VM driver is one of: [virtualbox vmwarefusion kvm xhyve hyperv] (default "virtualbox")
```
### Options inherited from parent commands
......
......@@ -179,15 +179,16 @@ type sshAble interface {
// MachineConfig contains the parameters used to start a cluster.
type MachineConfig struct {
MinikubeISO string
Memory int
CPUs int
DiskSize int
VMDriver string
DockerEnv []string // Each entry is formatted as KEY=VALUE.
InsecureRegistry []string
RegistryMirror []string
HostOnlyCIDR string // Only used by the virtualbox driver
MinikubeISO string
Memory int
CPUs int
DiskSize int
VMDriver string
DockerEnv []string // Each entry is formatted as KEY=VALUE.
InsecureRegistry []string
RegistryMirror []string
HostOnlyCIDR string // Only used by the virtualbox driver
HypervVirtualSwitch string
}
// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
......
......@@ -25,6 +25,7 @@ import (
func createHypervHost(config MachineConfig) drivers.Driver {
d := hyperv.NewDriver(constants.MachineName, constants.Minipath)
d.Boot2DockerURL = config.GetISOFileURI()
d.VSwitch = config.HypervVirtualSwitch
d.MemSize = config.Memory
d.CPU = config.CPUs
d.DiskSize = int(config.DiskSize)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册