Merge branch 'master' of https://github.com/kubernetes/minikube into upgrade-kic

pull/7858/head
Priya Wadhwa 2020-04-23 10:55:07 -07:00
commit 96e03d68e8
69 changed files with 125 additions and 43 deletions

View File

@ -26,6 +26,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil/kverify"
"k8s.io/minikube/pkg/minikube/config"
@ -98,6 +99,7 @@ const (
nodes = "nodes"
preload = "preload"
deleteOnFailure = "delete-on-failure"
kicBaseImage = "base-image"
)
// initMinikubeFlags includes commandline flags for minikube.
@ -118,6 +120,7 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(downloadOnly, false, "If true, only download and cache files for later use - don't install or start anything.")
startCmd.Flags().Bool(cacheImages, true, "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none.")
startCmd.Flags().StringSlice(isoURL, download.DefaultISOURLs(), "Locations to fetch the minikube ISO from.")
startCmd.Flags().String(kicBaseImage, kic.BaseImage, "The base image to use for docker/podman drivers. Intended for local development.")
startCmd.Flags().Bool(keepContext, false, "This will keep the existing kubectl context and will create a minikube context.")
startCmd.Flags().Bool(embedCerts, false, "if true, will embed the certs in kubeconfig.")
startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd).")

View File

@ -101,6 +101,10 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
mkdir -p /var/lib/docker
mount --bind /mnt/$PARTNAME/var/lib/docker /var/lib/docker
mkdir -p /mnt/$PARTNAME/var/lib/containerd
mkdir -p /var/lib/containerd
mount --bind /mnt/$PARTNAME/var/lib/containerd /var/lib/containerd
mkdir -p /mnt/$PARTNAME/var/lib/containers
mkdir -p /var/lib/containers
mount --bind /mnt/$PARTNAME/var/lib/containers /var/lib/containers

View File

@ -75,34 +75,13 @@ github-release -v release ${RELEASE_FLAGS} \
--name "${TAGNAME}" \
--description "${DESCRIPTION}"
# Uploading the files into github
FILES_TO_UPLOAD=(
'minikube-linux-amd64'
'minikube-linux-amd64.sha256'
'minikube-darwin-amd64'
'minikube-darwin-amd64.sha256'
'minikube-windows-amd64.exe'
'minikube-windows-amd64.exe.sha256'
'minikube-installer.exe'
"minikube_${DEB_VERSION}-0_amd64.deb"
"minikube-${RPM_VERSION}-0.x86_64.rpm"
'docker-machine-driver-kvm2'
'docker-machine-driver-kvm2.sha256'
'docker-machine-driver-hyperkit'
'docker-machine-driver-hyperkit.sha256'
)
# ISO files are special, as they are generated pre-release tagging
ISO_FILES=("minikube-v${VERSION}.iso" "minikube-v${VERSION}.iso.sha256")
for DOWNLOAD in "${ISO_FILES[@]}"
do
gsutil cp "gs://${ISO_BUCKET}/${DOWNLOAD}" out/ \
&& FILES_TO_UPLOAD+=("${DOWNLOAD}") \
|| echo "${DOWNLOAD} was not generated for this release"
# ISO files are built from a separate process, and may not be included in this release
for path in $(gsutil ls "gs://${ISO_BUCKET}/minikube-v${VERSION}*" || true); do
gsutil cp "${path}" out/
done
for UPLOAD in "${FILES_TO_UPLOAD[@]}"
do
# Upload all end-user assets other than preload files, as they are release independent
for file in out/minikube[_-]* out/docker-machine-*; do
n=0
until [ $n -ge 5 ]
do
@ -110,8 +89,8 @@ do
--user "${GITHUB_ORGANIZATION}" \
--repo "${GITHUB_REPO}" \
--tag "${TAGNAME}" \
--name "$UPLOAD" \
--file "out/$UPLOAD" && break
--name "$(basename ${file})" \
--file "${file}" && break
n=$((n+1))
sleep 15
done

View File

@ -50,6 +50,8 @@ var componentToKubeadmConfigKey = map[string]string{
ControllerManager: "controllerManager",
Scheduler: "scheduler",
Kubeadm: "kubeadm",
// The KubeProxy is handled in different config block
Kubeproxy: "",
// The Kubelet is not configured in kubeadm, only in systemd.
Kubelet: "",
}
@ -178,6 +180,9 @@ func optionPairsForComponent(component string, version semver.Version, cp config
return nil
}
// kubeadm extra args should not be included in the kubeadm config in the extra args section (instead, they must
// be inserted explicitly in the appropriate places or supplied from the command line); here we remove all of the
// kubeadm extra args from the slice
// createExtraComponentConfig generates a map of component to extra args for all of the components except kubeadm
func createExtraComponentConfig(extraOptions config.ExtraOptionSlice, version semver.Version, componentFeatureArgs string, cp config.Node) ([]componentOptions, error) {
extraArgsSlice, err := newComponentOptions(extraOptions, version, componentFeatureArgs, cp)
@ -185,9 +190,6 @@ func createExtraComponentConfig(extraOptions config.ExtraOptionSlice, version se
return nil, err
}
// kubeadm extra args should not be included in the kubeadm config in the extra args section (instead, they must
// be inserted explicitly in the appropriate places or supplied from the command line); here we remove all of the
// kubeadm extra args from the slice
for i, extraArgs := range extraArgsSlice {
if extraArgs.Component == Kubeadm {
extraArgsSlice = append(extraArgsSlice[:i], extraArgsSlice[i+1:]...)
@ -197,6 +199,12 @@ func createExtraComponentConfig(extraOptions config.ExtraOptionSlice, version se
return extraArgsSlice, nil
}
// createKubeProxyOptions generates a map of extra config for kube-proxy
func createKubeProxyOptions(extraOptions config.ExtraOptionSlice) map[string]string {
kubeProxyOptions := extraOptions.AsMap().Get(Kubeproxy)
return kubeProxyOptions
}
func convertToFlags(opts map[string]string) string {
var flags []string
var keys []string

View File

@ -82,5 +82,9 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "{{.PodSubnet }}"
metricsBindAddress: {{.AdvertiseAddress}}:10249
{{- range $i, $val := printMapInOrder .KubeProxyOptions ": " }}
{{$val}}
{{- end}}
`))

View File

@ -80,5 +80,9 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "{{.PodSubnet }}"
metricsBindAddress: {{.AdvertiseAddress}}:10249
{{- range $i, $val := printMapInOrder .KubeProxyOptions ": " }}
{{$val}}
{{- end}}
`))

View File

@ -83,6 +83,7 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana
NoTaintMaster bool
NodeIP string
ControlPlaneAddress string
KubeProxyOptions map[string]string
}{
CertDir: vmpath.GuestKubernetesCertsDir,
ServiceCIDR: constants.DefaultServiceCIDR,
@ -102,6 +103,7 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana
DNSDomain: k8s.DNSDomain,
NodeIP: n.IP,
ControlPlaneAddress: cp.IP,
KubeProxyOptions: createKubeProxyOptions(k8s.ExtraOptions),
}
if k8s.ServiceCIDR != "" {
@ -135,6 +137,7 @@ const (
Apiserver = "apiserver"
Scheduler = "scheduler"
ControllerManager = "controller-manager"
Kubeproxy = "kube-proxy"
)
// InvokeKubeadm returns the invocation command for Kubeadm

View File

@ -55,6 +55,11 @@ func getExtraOpts() []config.ExtraOption {
Key: "dry-run",
Value: "true",
},
config.ExtraOption{
Component: Kubeproxy,
Key: "mode",
Value: "iptables",
},
}
}

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -60,4 +60,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -51,4 +51,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -57,4 +57,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -60,4 +60,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -51,4 +51,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -57,4 +57,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -60,4 +60,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -50,4 +50,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -51,4 +51,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -57,4 +57,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -58,4 +58,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -49,4 +49,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -55,4 +55,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -58,4 +58,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -49,4 +49,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -55,4 +55,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: "192.168.32.0/20"
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -58,4 +58,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -48,4 +48,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -49,4 +49,5 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249

View File

@ -55,4 +55,6 @@ evictionHard:
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
clusterCIDR: ""
metricsBindAddress: 1.1.1.1:10249
mode: "iptables"

View File

@ -25,7 +25,6 @@ import (
"github.com/spf13/viper"
"golang.org/x/sync/errgroup"
cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/download"
@ -102,11 +101,12 @@ func doCacheBinaries(k8sVersion string) error {
// BeginDownloadKicArtifacts downloads the kic image + preload tarball, returns true if preload is available
func beginDownloadKicArtifacts(g *errgroup.Group) {
glog.Info("Beginning downloading kic artifacts")
if !image.ExistsImageInDaemon(kic.BaseImage) {
baseImage := viper.GetString("base-image")
if !image.ExistsImageInDaemon(baseImage) {
out.T(out.Pulling, "Pulling base image ...")
g.Go(func() error {
glog.Infof("Downloading %s to local daemon", kic.BaseImage)
return image.WriteImageToDaemon(kic.BaseImage)
glog.Infof("Downloading %s to local daemon", baseImage)
return image.WriteImageToDaemon(baseImage)
})
}
}

View File

@ -26,6 +26,7 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/golang/glog"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
@ -59,7 +60,7 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
return kic.NewDriver(kic.Config{
MachineName: driver.MachineName(cc, n),
StorePath: localpath.MiniPath(),
ImageDigest: kic.BaseImage,
ImageDigest: viper.GetString("base-image"),
CPU: cc.CPUs,
Memory: cc.Memory,
OCIBinary: oci.Docker,

View File

@ -89,9 +89,9 @@ func status() registry.State {
ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, path, "Get-WindowsOptionalFeature", "-FeatureName", "Microsoft-Hyper-V-All", "-Online")
cmd := exec.CommandContext(ctx, path, "@(Get-Wmiobject Win32_ComputerSystem).HypervisorPresent")
out, err := cmd.CombinedOutput()
if err != nil {
if string(out) != "True\r\n" {
errorMessage := fmt.Errorf("%s failed:\n%s", strings.Join(cmd.Args, " "), out)
fixMessage := "Start PowerShell as Administrator, and run: 'Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All'"

View File

@ -26,6 +26,7 @@ import (
"github.com/blang/semver"
"github.com/docker/machine/libmachine/drivers"
"github.com/golang/glog"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
@ -50,10 +51,11 @@ func init() {
}
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
baseImage := viper.GetString("base-image")
return kic.NewDriver(kic.Config{
MachineName: driver.MachineName(cc, n),
StorePath: localpath.MiniPath(),
ImageDigest: strings.Split(kic.BaseImage, "@")[0], // for podman does not support docker images references with both a tag and digest.
ImageDigest: strings.Split(baseImage, "@")[0], // for podman does not support docker images references with both a tag and digest.
CPU: cc.CPUs,
Memory: cc.Memory,
OCIBinary: oci.Podman,

View File

@ -27,6 +27,7 @@ minikube start [flags]
--apiserver-names stringArray A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine
--apiserver-port int The apiserver listening port (default 8443)
--auto-update-drivers If set, automatically updates drivers to the latest version. Defaults to true. (default true)
--base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.9@sha256:82a826cc03c3e59ead5969b8020ca138de98f366c1907293df91fc57205dbb53")
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true)
--container-runtime string The container runtime to be used (docker, crio, containerd). (default "docker")
--cpus int Number of CPUs allocated to Kubernetes. (default 2)

View File

@ -6,7 +6,7 @@ aliases:
---
## Overview
Hyper-V is a native hypervisor built in to modern versions of Microsoft Windows.
[Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/) is a native hypervisor built in to modern versions of Microsoft Windows.
{{% readfile file="/docs/drivers/includes/hyperv_usage.inc" %}}
@ -14,7 +14,9 @@ Hyper-V is a native hypervisor built in to modern versions of Microsoft Windows.
The `minikube start` command supports additional hyperv specific flags:
* **`--hyperv-virtual-switch`**: The hyperv virtual switch name. Defaults to first found
* **`--hyperv-virtual-switch`**: Name of the virtual switch the minikube VM should use. Defaults to first found
* **`--hyperv-use-external-switch`**: Use external virtual switch over Default Switch if virtual switch not explicitly specified, creates a new one if not found. If the adapter is not specified, the driver first looks up LAN adapters before other adapters (WiFi, ...). Or the user may specify an adapter to attach to the external switch. Default false
* **`--hyperv-external-adapter`**: External adapter on which the new external switch is created if no existing external switch is found. Since Windows 10 only allows one external switch for the same adapter, it finds the virtual switch before creating one. The external switch is created and named "minikube"
## Issues

View File

@ -1,6 +1,6 @@
## Requirements
* Windows 10 Enterprise, Pro, or Education ([system requirements](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-requirements))
* 64-bit versions of Windows 10 Enterprise, Pro, or Education ([system requirements](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-requirements))
* Hyper-V enabled
## Enabling Hyper-V