提交 f03641f0 编写于 作者: T tstromberg

Merge branch 'master' into none-certs

# Release Notes
## Version 1.7.1 - 2020-02-05
* Create directory using os.MkDirAll, as mkdir -p does not work on windows [#6508](https://github.com/kubernetes/minikube/pull/6508)
* Revert role change from cluster-admin->system:persistent-volume-provisioner [#6511](https://github.com/kubernetes/minikube/pull/6511)
* gvisor fixes for v1.7.0 [#6512](https://github.com/kubernetes/minikube/pull/6512)
* Remove pod list stability double check [#6509](https://github.com/kubernetes/minikube/pull/6509)
* Use cluster-dns IP setup by kubeadm [#6472](https://github.com/kubernetes/minikube/pull/6472)
* Skip driver autodetection if driver is already set [#6503](https://github.com/kubernetes/minikube/pull/6503)
* Customizing host path for dynamically provisioned PersistentVolumes [#6156](https://github.com/kubernetes/minikube/pull/6156)
* Update kubeadm api version from v1beta1 to v1beta2 [#6150](https://github.com/kubernetes/minikube/pull/6150)
* Use profile name as cluster/node name [#6200](https://github.com/kubernetes/minikube/pull/6200)
Thank you to our wonderful and amazing contributors who contributed to this bug-fix release:
- Nanik T
- Ruben
- Sharif Elgamal
- Thomas Strömberg
- tstromberg
- Vijay Katam
- Zhongcheng Lao
## Version 1.7.0 - 2020-02-04
* Add Azure Container Registry support [#6483](https://github.com/kubernetes/minikube/pull/6483)
......
......@@ -15,12 +15,12 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 7
VERSION_BUILD ?= 0
VERSION_BUILD ?= 1
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).${VERSION_BUILD}
VERSION ?= v$(RAW_VERSION)
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).0
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
RPM_VERSION ?= $(DEB_VERSION)
......
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Copyright 2020 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.
......@@ -21,25 +21,29 @@ package cmd
import (
"fmt"
"io"
"net"
"os"
"strconv"
"strings"
"text/template"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/shell"
"github.com/docker/machine/libmachine/state"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/out"
)
var envTmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .DockerTLSVerify }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .DockerHost }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .DockerCertPath }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubeDockerdProfile }}{{ .Suffix }}{{ if .NoProxyVar }}{{ .Prefix }}{{ .NoProxyVar }}{{ .Delimiter }}{{ .NoProxyValue }}{{ .Suffix }}{{end}}{{ .UsageHint }}", constants.DockerTLSVerifyEnv, constants.DockerHostEnv, constants.DockerCertPathEnv, constants.MinikubeActiveDockerdEnv)
......@@ -108,18 +112,9 @@ var (
noProxy bool
forceShell string
unset bool
defaultShellDetector ShellDetector
defaultNoProxyGetter NoProxyGetter
)
// ShellDetector detects shell
type ShellDetector interface {
GetShell(string) (string, error)
}
// LibmachineShellDetector detects shell, using libmachine
type LibmachineShellDetector struct{}
// NoProxyGetter gets the no_proxy variable
type NoProxyGetter interface {
GetNoProxyVar() (string, string)
......@@ -128,7 +123,7 @@ type NoProxyGetter interface {
// EnvNoProxyGetter gets the no_proxy variable, using environment
type EnvNoProxyGetter struct{}
func generateUsageHint(profile string, userShell string) string {
func generateUsageHint(profile, sh string) string {
const usgPlz = "Please run command bellow to point your shell to minikube's docker-daemon :"
var usgCmd = fmt.Sprintf("minikube -p %s docker-env", profile)
var usageHintMap = map[string]string{
......@@ -154,148 +149,108 @@ REM @FOR /f "tokens=*" %%i IN ('%s') DO @%%i
`, usgPlz, usgCmd),
}
hint, ok := usageHintMap[userShell]
hint, ok := usageHintMap[sh]
if !ok {
return usageHintMap["bash"]
}
return hint
}
func shellCfgSet(api libmachine.API) (*ShellConfig, error) {
envMap, err := cluster.GetNodeDockerEnv(api)
if err != nil {
return nil, err
}
userShell, err := defaultShellDetector.GetShell(forceShell)
if err != nil {
return nil, err
}
shellCfg := &ShellConfig{
// shellCfgSet generates context variables for "docker-env"
func shellCfgSet(ec EnvConfig, envMap map[string]string) *ShellConfig {
s := &ShellConfig{
DockerCertPath: envMap[constants.DockerCertPathEnv],
DockerHost: envMap[constants.DockerHostEnv],
DockerTLSVerify: envMap[constants.DockerTLSVerifyEnv],
MinikubeDockerdProfile: envMap[constants.MinikubeActiveDockerdEnv],
UsageHint: generateUsageHint(viper.GetString(config.MachineProfile), userShell),
UsageHint: generateUsageHint(ec.profile, ec.shell),
}
if noProxy {
host, err := api.Load(viper.GetString(config.MachineProfile))
if err != nil {
return nil, errors.Wrap(err, "Error getting IP")
}
ip, err := host.Driver.GetIP()
if err != nil {
return nil, errors.Wrap(err, "Error getting host IP")
}
if ec.noProxy {
noProxyVar, noProxyValue := defaultNoProxyGetter.GetNoProxyVar()
// add the docker host to the no_proxy list idempotently
switch {
case noProxyValue == "":
noProxyValue = ip
case strings.Contains(noProxyValue, ip):
noProxyValue = ec.hostIP
case strings.Contains(noProxyValue, ec.hostIP):
// ip already in no_proxy list, nothing to do
default:
noProxyValue = fmt.Sprintf("%s,%s", noProxyValue, ip)
noProxyValue = fmt.Sprintf("%s,%s", noProxyValue, ec.hostIP)
}
shellCfg.NoProxyVar = noProxyVar
shellCfg.NoProxyValue = noProxyValue
s.NoProxyVar = noProxyVar
s.NoProxyValue = noProxyValue
}
switch userShell {
switch ec.shell {
case "fish":
shellCfg.Prefix = fishSetPfx
shellCfg.Suffix = fishSetSfx
shellCfg.Delimiter = fishSetDelim
s.Prefix = fishSetPfx
s.Suffix = fishSetSfx
s.Delimiter = fishSetDelim
case "powershell":
shellCfg.Prefix = psSetPfx
shellCfg.Suffix = psSetSfx
shellCfg.Delimiter = psSetDelim
s.Prefix = psSetPfx
s.Suffix = psSetSfx
s.Delimiter = psSetDelim
case "cmd":
shellCfg.Prefix = cmdSetPfx
shellCfg.Suffix = cmdSetSfx
shellCfg.Delimiter = cmdSetDelim
s.Prefix = cmdSetPfx
s.Suffix = cmdSetSfx
s.Delimiter = cmdSetDelim
case "emacs":
shellCfg.Prefix = emacsSetPfx
shellCfg.Suffix = emacsSetSfx
shellCfg.Delimiter = emacsSetDelim
s.Prefix = emacsSetPfx
s.Suffix = emacsSetSfx
s.Delimiter = emacsSetDelim
case "none":
shellCfg.Prefix = nonePfx
shellCfg.Suffix = noneSfx
shellCfg.Delimiter = noneDelim
shellCfg.UsageHint = ""
s.Prefix = nonePfx
s.Suffix = noneSfx
s.Delimiter = noneDelim
s.UsageHint = ""
default:
shellCfg.Prefix = bashSetPfx
shellCfg.Suffix = bashSetSfx
shellCfg.Delimiter = bashSetDelim
s.Prefix = bashSetPfx
s.Suffix = bashSetSfx
s.Delimiter = bashSetDelim
}
return shellCfg, nil
return s
}
func shellCfgUnset() (*ShellConfig, error) {
userShell, err := defaultShellDetector.GetShell(forceShell)
if err != nil {
return nil, err
}
shellCfg := &ShellConfig{
UsageHint: generateUsageHint(viper.GetString(config.MachineProfile), userShell),
// shellCfgUnset generates context variables for "docker-env -u"
func shellCfgUnset(ec EnvConfig) *ShellConfig {
s := &ShellConfig{
UsageHint: generateUsageHint(ec.profile, ec.shell),
}
if noProxy {
shellCfg.NoProxyVar, shellCfg.NoProxyValue = defaultNoProxyGetter.GetNoProxyVar()
if ec.noProxy {
s.NoProxyVar, s.NoProxyValue = defaultNoProxyGetter.GetNoProxyVar()
}
switch userShell {
switch ec.shell {
case "fish":
shellCfg.Prefix = fishUnsetPfx
shellCfg.Suffix = fishUnsetSfx
shellCfg.Delimiter = fishUnsetDelim
s.Prefix = fishUnsetPfx
s.Suffix = fishUnsetSfx
s.Delimiter = fishUnsetDelim
case "powershell":
shellCfg.Prefix = psUnsetPfx
shellCfg.Suffix = psUnsetSfx
shellCfg.Delimiter = psUnsetDelim
s.Prefix = psUnsetPfx
s.Suffix = psUnsetSfx
s.Delimiter = psUnsetDelim
case "cmd":
shellCfg.Prefix = cmdUnsetPfx
shellCfg.Suffix = cmdUnsetSfx
shellCfg.Delimiter = cmdUnsetDelim
s.Prefix = cmdUnsetPfx
s.Suffix = cmdUnsetSfx
s.Delimiter = cmdUnsetDelim
case "emacs":
shellCfg.Prefix = emacsUnsetPfx
shellCfg.Suffix = emacsUnsetSfx
shellCfg.Delimiter = emacsUnsetDelim
s.Prefix = emacsUnsetPfx
s.Suffix = emacsUnsetSfx
s.Delimiter = emacsUnsetDelim
case "none":
shellCfg.Prefix = nonePfx
shellCfg.Suffix = noneSfx
shellCfg.Delimiter = noneDelim
shellCfg.UsageHint = ""
s.Prefix = nonePfx
s.Suffix = noneSfx
s.Delimiter = noneDelim
s.UsageHint = ""
default:
shellCfg.Prefix = bashUnsetPfx
shellCfg.Suffix = bashUnsetSfx
shellCfg.Delimiter = bashUnsetDelim
}
return shellCfg, nil
}
func executeTemplateStdout(shellCfg *ShellConfig) error {
tmpl := template.Must(template.New("envConfig").Parse(envTmpl))
return tmpl.Execute(os.Stdout, shellCfg)
}
// GetShell detects the shell
func (LibmachineShellDetector) GetShell(userShell string) (string, error) {
if userShell != "" {
return userShell, nil
s.Prefix = bashUnsetPfx
s.Suffix = bashUnsetSfx
s.Delimiter = bashUnsetDelim
}
return shell.Detect()
return s
}
// GetNoProxyVar gets the no_proxy var
......@@ -312,30 +267,18 @@ func (EnvNoProxyGetter) GetNoProxyVar() (string, string) {
return noProxyVar, noProxyValue
}
// same as drivers.RunSSHCommandFromDriver, but allows errors
func runSSHCommandFromDriver(d drivers.Driver, command string) (string, error) {
// isDockerActive checks if Docker is active
func isDockerActive(d drivers.Driver) (bool, error) {
client, err := drivers.GetSSHClientFromDriver(d)
if err != nil {
return "", err
return false, err
}
output, err := client.Output("sudo systemctl is-active docker")
if err != nil {
return false, err
}
log.Debugf("About to run SSH command:\n%s", command)
output, err := client.Output(command)
log.Debugf("SSH cmd err, output: %v: %s", err, output)
return output, err
}
// same as host.RunSSHCommand, but allows errors
func runSSHCommand(h *host.Host, command string) (string, error) {
return runSSHCommandFromDriver(h.Driver, command)
}
// GetDockerActive checks if Docker is active
func GetDockerActive(host *host.Host) (bool, error) {
statusCmd := `sudo systemctl is-active docker`
status, err := runSSHCommand(host, statusCmd)
// systemd returns error code on inactive
s := strings.TrimSpace(status)
s := strings.TrimSpace(output)
return err == nil && s == "active", nil
}
......@@ -350,7 +293,9 @@ var dockerEnvCmd = &cobra.Command{
exit.WithError("Error getting client", err)
}
defer api.Close()
cc, err := config.Load(viper.GetString(config.MachineProfile))
profile := viper.GetString(config.MachineProfile)
cc, err := config.Load(profile)
if err != nil {
exit.WithError("Error getting config", err)
}
......@@ -361,43 +306,108 @@ var dockerEnvCmd = &cobra.Command{
if host.Driver.DriverName() == driver.None {
exit.UsageT(`'none' driver does not support 'minikube docker-env' command`)
}
hostSt, err := cluster.GetHostStatus(api, cc.Name)
if err != nil {
exit.WithError("Error getting host status", err)
}
if hostSt != state.Running.String() {
exit.WithCodeT(exit.Unavailable, `The docker host is currently not running`)
exit.WithCodeT(exit.Unavailable, `'{{.profile}}' is not running`, out.V{"profile": profile})
}
docker, err := GetDockerActive(host)
ok, err := isDockerActive(host.Driver)
if err != nil {
exit.WithError("Error getting service status", err)
}
if !docker {
exit.WithCodeT(exit.Unavailable, `The docker service is currently not active`)
if !ok {
exit.WithCodeT(exit.Unavailable, `The docker service within '{{.profile}}' is not active`, out.V{"profile": profile})
}
var shellCfg *ShellConfig
hostIP, err := host.Driver.GetIP()
if err != nil {
exit.WithError("Error getting host IP", err)
}
if unset {
shellCfg, err = shellCfgUnset()
ec := EnvConfig{
profile: profile,
driver: host.DriverName,
shell: forceShell,
hostIP: hostIP,
certsDir: localpath.MakeMiniPath("certs"),
noProxy: noProxy,
}
if ec.shell == "" {
ec.shell, err = shell.Detect()
if err != nil {
exit.WithError("Error unsetting shell variables", err)
exit.WithError("Error detecting shell", err)
}
} else {
shellCfg, err = shellCfgSet(api)
if err != nil {
exit.WithError("Error setting shell variables", err)
}
if unset {
if err := unsetScript(ec, os.Stdout); err != nil {
exit.WithError("Error generating unset output", err)
}
return
}
if err := executeTemplateStdout(shellCfg); err != nil {
exit.WithError("Error executing template", err)
if err := setScript(ec, os.Stdout); err != nil {
exit.WithError("Error generating set output", err)
}
},
}
// EnvConfig encapsulates all external inputs into shell generation
type EnvConfig struct {
profile string
shell string
driver string
hostIP string
certsDir string
noProxy bool
}
// setScript writes out a shell-compatible 'docker-env' script
func setScript(ec EnvConfig, w io.Writer) error {
tmpl := template.Must(template.New("envConfig").Parse(envTmpl))
envVars, err := dockerEnvVars(ec)
if err != nil {
return err
}
return tmpl.Execute(w, shellCfgSet(ec, envVars))
}
// setScript writes out a shell-compatible 'docker-env unset' script
func unsetScript(ec EnvConfig, w io.Writer) error {
tmpl := template.Must(template.New("envConfig").Parse(envTmpl))
return tmpl.Execute(w, shellCfgUnset(ec))
}
// dockerURL returns a the docker endpoint URL for an ip/port pair.
func dockerURL(ip string, port int) string {
return fmt.Sprintf("tcp://%s", net.JoinHostPort(ip, strconv.Itoa(port)))
}
// dockerEnvVars gets the necessary docker env variables to allow the use of minikube's docker daemon
func dockerEnvVars(ec EnvConfig) (map[string]string, error) {
env := map[string]string{
constants.DockerTLSVerifyEnv: "1",
constants.DockerHostEnv: dockerURL(ec.hostIP, constants.DockerDaemonPort),
constants.DockerCertPathEnv: ec.certsDir,
constants.MinikubeActiveDockerdEnv: ec.profile,
}
if driver.IsKIC(ec.driver) { // for kic we need to find out what port docker allocated during creation
port, err := oci.HostPortBinding(ec.driver, ec.profile, constants.DockerDaemonPort)
if err != nil {
return nil, errors.Wrapf(err, "get hostbind port for %d", constants.DockerDaemonPort)
}
env[constants.DockerCertPathEnv] = dockerURL(kic.DefaultBindIPV4, port)
}
return env, nil
}
func init() {
defaultShellDetector = &LibmachineShellDetector{}
defaultNoProxyGetter = &EnvNoProxyGetter{}
dockerEnvCmd.Flags().BoolVar(&noProxy, "no-proxy", false, "Add machine IP to NO_PROXY environment variable")
dockerEnvCmd.Flags().StringVar(&forceShell, "shell", "", "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect")
......
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Copyright 2020 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.
......@@ -17,25 +17,12 @@ limitations under the License.
package cmd
import (
"reflect"
"bytes"
"testing"
"github.com/docker/machine/libmachine/host"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/tests"
"github.com/google/go-cmp/cmp"
)
type FakeShellDetector struct {
Shell string
}
func (f FakeShellDetector) GetShell(_ string) (string, error) {
return f.Shell, nil
}
type FakeNoProxyGetter struct {
NoProxyVar string
NoProxyValue string
......@@ -45,297 +32,250 @@ func (f FakeNoProxyGetter) GetNoProxyVar() (string, string) {
return f.NoProxyVar, f.NoProxyValue
}
var defaultAPI = &tests.MockAPI{
FakeStore: tests.FakeStore{
Hosts: map[string]*host.Host{
constants.DefaultMachineName: {
Name: constants.DefaultMachineName,
Driver: &tests.MockDriver{},
},
},
},
}
// Most of the shell cfg isn't configurable
func newShellCfg(shell, prefix, suffix, delim string) *ShellConfig {
return &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", shell),
Prefix: prefix,
Suffix: suffix,
Delimiter: delim,
MinikubeDockerdProfile: "minikube",
}
}
func TestShellCfgSet(t *testing.T) {
func TestGenerateScripts(t *testing.T) {
var tests = []struct {
description string
api *tests.MockAPI
shell string
noProxyVar string
noProxyValue string
expectedShellCfg *ShellConfig
shouldErr bool
noProxyFlag bool
config EnvConfig
noProxyGetter *FakeNoProxyGetter
wantSet string
wantUnset string
}{
{
description: "no host specified",
api: &tests.MockAPI{
FakeStore: tests.FakeStore{
Hosts: make(map[string]*host.Host),
},
},
shell: "bash",
expectedShellCfg: nil,
shouldErr: true,
},
{
description: "default",
api: defaultAPI,
shell: "bash",
expectedShellCfg: newShellCfg("", bashSetPfx, bashSetSfx, bashSetDelim),
shouldErr: false,
},
{
description: "bash",
api: defaultAPI,
shell: "bash",
expectedShellCfg: newShellCfg("bash", bashSetPfx, bashSetSfx, bashSetDelim),
shouldErr: false,
},
{
description: "fish",
api: defaultAPI,
shell: "fish",
expectedShellCfg: newShellCfg("fish", fishSetPfx, fishSetSfx, fishSetDelim),
shouldErr: false,
},
{
description: "powershell",
api: defaultAPI,
shell: "powershell",
expectedShellCfg: newShellCfg("powershell", psSetPfx, psSetSfx, psSetDelim),
shouldErr: false,
},
{
description: "cmd",
api: defaultAPI,
shell: "cmd",
expectedShellCfg: newShellCfg("cmd", cmdSetPfx, cmdSetSfx, cmdSetDelim),
shouldErr: false,
},
{
description: "emacs",
api: defaultAPI,
shell: "emacs",
expectedShellCfg: newShellCfg("emacs", emacsSetPfx, emacsSetSfx, emacsSetDelim),
shouldErr: false,
},
{
description: "no proxy add uppercase",
api: defaultAPI,
shell: "bash",
noProxyVar: "NO_PROXY",
noProxyValue: "",
noProxyFlag: true,
expectedShellCfg: &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", "bash"),
Prefix: bashSetPfx,
Suffix: bashSetSfx,
Delimiter: bashSetDelim,
NoProxyVar: "NO_PROXY",
NoProxyValue: "127.0.0.1",
MinikubeDockerdProfile: "minikube",
},
EnvConfig{profile: "bash", shell: "bash", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs"},
nil,
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="bash"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash docker-env)
`,
},
{
description: "no proxy add lowercase",
api: defaultAPI,
shell: "bash",
noProxyVar: "no_proxy",
noProxyValue: "",
noProxyFlag: true,
expectedShellCfg: &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", "bash"),
Prefix: bashSetPfx,
Suffix: bashSetSfx,
Delimiter: bashSetDelim,
NoProxyVar: "no_proxy",
NoProxyValue: "127.0.0.1",
MinikubeDockerdProfile: "minikube",
},
EnvConfig{profile: "ipv6", shell: "bash", driver: "kvm2", hostIP: "fe80::215:5dff:fe00:a903", certsDir: "/certs"},
nil,
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://[fe80::215:5dff:fe00:a903]:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="ipv6"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p ipv6 docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p ipv6 docker-env)
`,
},
{
description: "no proxy idempotent",
api: defaultAPI,
shell: "bash",
noProxyVar: "no_proxy",
noProxyValue: "127.0.0.1",
noProxyFlag: true,
expectedShellCfg: &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", "bash"),
Prefix: bashSetPfx,
Suffix: bashSetSfx,
Delimiter: bashSetDelim,
NoProxyVar: "no_proxy",
NoProxyValue: "127.0.0.1",
MinikubeDockerdProfile: "minikube",
},
EnvConfig{profile: "fish", shell: "fish", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs"},
nil,
`set -gx DOCKER_TLS_VERIFY "1";
set -gx DOCKER_HOST "tcp://127.0.0.1:2376";
set -gx DOCKER_CERT_PATH "/certs";
set -gx MINIKUBE_ACTIVE_DOCKERD "fish";
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval (minikube -p fish docker-env)
`,
`set -e DOCKER_TLS_VERIFY;
set -e DOCKER_HOST;
set -e DOCKER_CERT_PATH;
set -e MINIKUBE_ACTIVE_DOCKERD;
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval (minikube -p fish docker-env)
`,
},
{
description: "no proxy list add",
api: defaultAPI,
shell: "bash",
noProxyVar: "no_proxy",
noProxyValue: "0.0.0.0",
noProxyFlag: true,
expectedShellCfg: &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", "bash"),
Prefix: bashSetPfx,
Suffix: bashSetSfx,
Delimiter: bashSetDelim,
NoProxyVar: "no_proxy",
NoProxyValue: "0.0.0.0,127.0.0.1",
MinikubeDockerdProfile: "minikube",
},
EnvConfig{profile: "powershell", shell: "powershell", driver: "hyperv", hostIP: "192.168.0.1", certsDir: "/certs"},
nil,
`$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.0.1:2376"
$Env:DOCKER_CERT_PATH = "/certs"
$Env:MINIKUBE_ACTIVE_DOCKERD = "powershell"
# Please run command bellow to point your shell to minikube's docker-daemon :
# & minikube -p powershell docker-env | Invoke-Expression
`,
`Remove-Item Env:\\DOCKER_TLS_VERIFY
Remove-Item Env:\\DOCKER_HOST
Remove-Item Env:\\DOCKER_CERT_PATH
Remove-Item Env:\\MINIKUBE_ACTIVE_DOCKERD
# Please run command bellow to point your shell to minikube's docker-daemon :
# & minikube -p powershell docker-env | Invoke-Expression
`,
},
{
description: "no proxy list already present",
api: defaultAPI,
shell: "bash",
noProxyVar: "no_proxy",
noProxyValue: "0.0.0.0,127.0.0.1",
noProxyFlag: true,
expectedShellCfg: &ShellConfig{
DockerCertPath: localpath.MakeMiniPath("certs"),
DockerTLSVerify: "1",
DockerHost: "tcp://127.0.0.1:2376",
UsageHint: generateUsageHint("minikube", "bash"),
Prefix: bashSetPfx,
Suffix: bashSetSfx,
Delimiter: bashSetDelim,
NoProxyVar: "no_proxy",
NoProxyValue: "0.0.0.0,127.0.0.1",
MinikubeDockerdProfile: "minikube",
},
},
}
EnvConfig{profile: "cmd", shell: "cmd", driver: "hyperv", hostIP: "192.168.0.1", certsDir: "/certs"},
nil,
`SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.0.1:2376
SET DOCKER_CERT_PATH=/certs
SET MINIKUBE_ACTIVE_DOCKERD=cmd
for _, test := range tests {
test := test
t.Run(test.description, func(t *testing.T) {
viper.Set(config.MachineProfile, constants.DefaultMachineName)
defaultShellDetector = &FakeShellDetector{test.shell}
defaultNoProxyGetter = &FakeNoProxyGetter{test.noProxyVar, test.noProxyValue}
noProxy = test.noProxyFlag
test.api.T = t
shellCfg, err := shellCfgSet(test.api)
if !reflect.DeepEqual(shellCfg, test.expectedShellCfg) {
t.Errorf("Shell cfgs differ: expected %+v, \n\n got %+v", test.expectedShellCfg, shellCfg)
}
if err != nil && !test.shouldErr {
t.Errorf("Unexpected error occurred: %s, error: %v", test.description, err)
}
if err == nil && test.shouldErr {
t.Errorf("Test didn't return error but should have: %s", test.description)
}
})
}
}
REM Please run command bellow to point your shell to minikube's docker-daemon :
REM @FOR /f "tokens=*" %i IN ('minikube -p cmd docker-env') DO @%i
`,
func TestShellCfgUnset(t *testing.T) {
`SET DOCKER_TLS_VERIFY=
SET DOCKER_HOST=
SET DOCKER_CERT_PATH=
SET MINIKUBE_ACTIVE_DOCKERD=
var tests = []struct {
description string
shell string
expectedShellCfg *ShellConfig
}{
{
description: "unset default",
shell: "bash",
expectedShellCfg: &ShellConfig{
Prefix: bashUnsetPfx,
Suffix: bashUnsetSfx,
Delimiter: bashUnsetDelim,
UsageHint: generateUsageHint("minikube", "bash"),
},
REM Please run command bellow to point your shell to minikube's docker-daemon :
REM @FOR /f "tokens=*" %i IN ('minikube -p cmd docker-env') DO @%i
`,
},
{
description: "unset bash",
shell: "bash",
expectedShellCfg: &ShellConfig{
Prefix: bashUnsetPfx,
Suffix: bashUnsetSfx,
Delimiter: bashUnsetDelim,
UsageHint: generateUsageHint("minikube", "bash"),
},
EnvConfig{profile: "emacs", shell: "emacs", driver: "hyperv", hostIP: "192.168.0.1", certsDir: "/certs"},
nil,
`(setenv "DOCKER_TLS_VERIFY" "1")
(setenv "DOCKER_HOST" "tcp://192.168.0.1:2376")
(setenv "DOCKER_CERT_PATH" "/certs")
(setenv "MINIKUBE_ACTIVE_DOCKERD" "emacs")
;; Please run command bellow to point your shell to minikube's docker-daemon :
;; (with-temp-buffer (shell-command "minikube -p emacs docker-env" (current-buffer)) (eval-buffer))
`,
`(setenv "DOCKER_TLS_VERIFY" nil)
(setenv "DOCKER_HOST" nil)
(setenv "DOCKER_CERT_PATH" nil)
(setenv "MINIKUBE_ACTIVE_DOCKERD" nil)
;; Please run command bellow to point your shell to minikube's docker-daemon :
;; (with-temp-buffer (shell-command "minikube -p emacs docker-env" (current-buffer)) (eval-buffer))
`,
},
{
description: "unset fish",
shell: "fish",
expectedShellCfg: &ShellConfig{
Prefix: fishUnsetPfx,
Suffix: fishUnsetSfx,
Delimiter: fishUnsetDelim,
UsageHint: generateUsageHint("minikube", "fish"),
},
EnvConfig{profile: "bash-no-proxy", shell: "bash", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs", noProxy: true},
&FakeNoProxyGetter{"NO_PROXY", "127.0.0.1"},
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="bash-no-proxy"
export NO_PROXY="127.0.0.1"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
unset NO_PROXY127.0.0.1
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy docker-env)
`,
},
{
description: "unset powershell",
shell: "powershell",
expectedShellCfg: &ShellConfig{
Prefix: psUnsetPfx,
Suffix: psUnsetSfx,
Delimiter: psUnsetDelim,
UsageHint: generateUsageHint("minikube", "powershell"),
},
EnvConfig{profile: "bash-no-proxy-lower", shell: "bash", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs", noProxy: true},
&FakeNoProxyGetter{"no_proxy", "127.0.0.1"},
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="bash-no-proxy-lower"
export no_proxy="127.0.0.1"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy-lower docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
unset no_proxy127.0.0.1
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy-lower docker-env)
`,
},
{
description: "unset cmd",
shell: "cmd",
expectedShellCfg: &ShellConfig{
Prefix: cmdUnsetPfx,
Suffix: cmdUnsetSfx,
Delimiter: cmdUnsetDelim,
UsageHint: generateUsageHint("minikube", "cmd"),
},
EnvConfig{profile: "bash-no-proxy-idempotent", shell: "bash", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs", noProxy: true},
&FakeNoProxyGetter{"no_proxy", "127.0.0.1"},
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="bash-no-proxy-idempotent"
export no_proxy="127.0.0.1"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy-idempotent docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
unset no_proxy127.0.0.1
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p bash-no-proxy-idempotent docker-env)
`,
},
{
description: "unset emacs",
shell: "emacs",
expectedShellCfg: &ShellConfig{
Prefix: emacsUnsetPfx,
Suffix: emacsUnsetSfx,
Delimiter: emacsUnsetDelim,
UsageHint: generateUsageHint("minikube", "emacs"),
},
EnvConfig{profile: "sh-no-proxy-add", shell: "bash", driver: "kvm2", hostIP: "127.0.0.1", certsDir: "/certs", noProxy: true},
&FakeNoProxyGetter{"NO_PROXY", "192.168.0.1,10.0.0.4"},
`export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:2376"
export DOCKER_CERT_PATH="/certs"
export MINIKUBE_ACTIVE_DOCKERD="sh-no-proxy-add"
export NO_PROXY="192.168.0.1,10.0.0.4,127.0.0.1"
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p sh-no-proxy-add docker-env)
`,
`unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset MINIKUBE_ACTIVE_DOCKERD
unset NO_PROXY192.168.0.1,10.0.0.4
# Please run command bellow to point your shell to minikube's docker-daemon :
# eval $(minikube -p sh-no-proxy-add docker-env)
`,
},
}
for _, tc := range tests {
t.Run(tc.config.profile, func(t *testing.T) {
defaultNoProxyGetter = tc.noProxyGetter
var b []byte
buf := bytes.NewBuffer(b)
if err := setScript(tc.config, buf); err != nil {
t.Errorf("setScript(%+v) error: %v", tc.config, err)
}
got := buf.String()
if diff := cmp.Diff(tc.wantSet, got); diff != "" {
t.Errorf("setScript(%+v) mismatch (-want +got):\n%s\n\nraw output:\n%s\nquoted: %q", tc.config, diff, got, got)
}
for _, test := range tests {
t.Run(test.description, func(t *testing.T) {
defaultShellDetector = &FakeShellDetector{test.shell}
defaultNoProxyGetter = &FakeNoProxyGetter{}
actual, _ := shellCfgUnset()
if !reflect.DeepEqual(actual, test.expectedShellCfg) {
t.Errorf("Actual shell config did not match expected: \n\n actual: \n%+v \n\n expected: \n%+v \n\n", actual, test.expectedShellCfg)
buf = bytes.NewBuffer(b)
if err := unsetScript(tc.config, buf); err != nil {
t.Errorf("unsetScript(%+v) error: %v", tc.config, err)
}
got = buf.String()
if diff := cmp.Diff(tc.wantUnset, got); diff != "" {
t.Errorf("unsetScript(%+v) mismatch (-want +got):\n%s\n\nraw output:\n%s\nquoted: %q", tc.config, diff, got, got)
}
})
}
}
......@@ -316,7 +316,7 @@ func runStart(cmd *cobra.Command, args []string) {
updateDriver(driverName)
}
k8sVersion, isUpgrade := getKubernetesVersion(existing)
k8sVersion := getKubernetesVersion(existing)
mc, n, err := generateCfgFromFlags(cmd, k8sVersion, driverName)
if err != nil {
exit.WithError("Failed to generate config", err)
......@@ -365,7 +365,7 @@ func runStart(cmd *cobra.Command, args []string) {
bs := setupKubeAdm(machineAPI, mc, n)
// pull images or restart cluster
bootstrapCluster(bs, cr, mRunner, mc, preExists, isUpgrade)
bootstrapCluster(bs, cr, mRunner, mc)
configureMounts()
// enable addons, both old and new!
......@@ -1187,9 +1187,8 @@ func tryRegistry(r command.Runner) {
}
// getKubernetesVersion ensures that the requested version is reasonable
func getKubernetesVersion(old *config.MachineConfig) (string, bool) {
func getKubernetesVersion(old *config.MachineConfig) string {
paramVersion := viper.GetString(kubernetesVersion)
isUpgrade := false
if paramVersion == "" { // if the user did not specify any version then ...
if old != nil { // .. use the old version from config (if any)
......@@ -1207,7 +1206,7 @@ func getKubernetesVersion(old *config.MachineConfig) (string, bool) {
nv := version.VersionPrefix + nvs.String()
if old == nil || old.KubernetesConfig.KubernetesVersion == "" {
return nv, isUpgrade
return nv
}
oldestVersion, err := semver.Make(strings.TrimPrefix(constants.OldestKubernetesVersion, version.VersionPrefix))
......@@ -1249,11 +1248,7 @@ func getKubernetesVersion(old *config.MachineConfig) (string, bool) {
if defaultVersion.GT(nvs) {
out.T(out.ThumbsUp, "Kubernetes {{.new}} is now available. If you would like to upgrade, specify: --kubernetes-version={{.new}}", out.V{"new": defaultVersion})
}
if nvs.GT(ovs) {
isUpgrade = true
}
return nv, isUpgrade
return nv
}
// setupKubeAdm adds any requested files into the VM before Kubernetes is started
......@@ -1296,14 +1291,7 @@ func configureRuntimes(runner cruntime.CommandRunner, drvName string, k8s config
}
// bootstrapCluster starts Kubernetes using the chosen bootstrapper
func bootstrapCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner command.Runner, mc config.MachineConfig, preexisting bool, isUpgrade bool) {
if isUpgrade || !preexisting {
out.T(out.Pulling, "Pulling images ...")
if err := bs.PullImages(mc.KubernetesConfig); err != nil {
out.T(out.FailureType, "Unable to pull images, which may be OK: {{.error}}", out.V{"error": err})
}
}
func bootstrapCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner command.Runner, mc config.MachineConfig) {
out.T(out.Launch, "Launching Kubernetes ... ")
if err := bs.StartCluster(mc); err != nil {
exit.WithLogEntries("Error starting cluster", err, logs.FindProblems(r, bs, runner))
......
......@@ -31,33 +31,28 @@ func TestGetKuberneterVersion(t *testing.T) {
description string
expectedVersion string
paramVersion string
upgrade bool
cfg *cfg.MachineConfig
}{
{
description: "kubernetes-version not given, no config",
expectedVersion: constants.DefaultKubernetesVersion,
paramVersion: "",
upgrade: false,
},
{
description: "kubernetes-version not given, config available",
expectedVersion: "v1.15.0",
paramVersion: "",
upgrade: false,
cfg: &cfg.MachineConfig{KubernetesConfig: cfg.KubernetesConfig{KubernetesVersion: "v1.15.0"}},
},
{
description: "kubernetes-version given, no config",
expectedVersion: "v1.15.0",
paramVersion: "v1.15.0",
upgrade: false,
},
{
description: "kubernetes-version given, config available",
expectedVersion: "v1.16.0",
paramVersion: "v1.16.0",
upgrade: true,
cfg: &cfg.MachineConfig{KubernetesConfig: cfg.KubernetesConfig{KubernetesVersion: "v1.15.0"}},
},
}
......@@ -65,17 +60,12 @@ func TestGetKuberneterVersion(t *testing.T) {
for _, test := range tests {
t.Run(test.description, func(t *testing.T) {
viper.SetDefault(kubernetesVersion, test.paramVersion)
version, upgrade := getKubernetesVersion(test.cfg)
version := getKubernetesVersion(test.cfg)
// check whether we are getting the expected version
if version != test.expectedVersion {
t.Fatalf("test failed because the expected version %s is not returned", test.expectedVersion)
}
// check whether the upgrade flag is correct
if test.upgrade != upgrade {
t.Fatalf("test failed expected upgrade is %t", test.upgrade)
}
})
}
}
......
[
{
"name": "v1.7.1",
"checksums": {
"darwin": "ac6b1eb8ff6a98f0f4a8f26fddd7a9fd8dbdd7a5029cf87a9315399d31e4f6ce",
"linux": "1313da4fce807f2d5cd4664d8a59422067a3377ddd37fa66df9aa0bb228e154b",
"windows": "640ad4ba69926be2ea64140a5d6d80122f030c8bf75ae4afeca11eeff865feac"
}
},
{
"name": "v1.7.0",
"checksums": {
......
......@@ -35,8 +35,6 @@ type LogOptions struct {
// Bootstrapper contains all the methods needed to bootstrap a kubernetes cluster
type Bootstrapper interface {
// PullImages pulls images necessary for a cluster. Success should not be required.
PullImages(config.KubernetesConfig) error
StartCluster(config.MachineConfig) error
UpdateCluster(config.MachineConfig) error
DeleteCluster(config.KubernetesConfig) error
......
......@@ -70,7 +70,7 @@ func getExtraOptsPodCidr() []config.ExtraOption {
func recentReleases() ([]string, error) {
// test the 6 most recent releases
versions := []string{"v1.17", "v1.16", "v1.15", "v1.14", "v1.13", "v1.12", "v1.11"}
versions := []string{"v1.19", "v1.18", "v1.17", "v1.16", "v1.15", "v1.14", "v1.13", "v1.12", "v1.11"}
foundNewest := false
foundDefault := false
......
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.18.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.18.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -36,4 +36,4 @@ kubernetesVersion: v1.18.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -42,4 +42,4 @@ kubernetesVersion: v1.18.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: "192.168.32.0/20"
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -45,4 +45,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -35,4 +35,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -36,4 +36,4 @@ kubernetesVersion: v1.19.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
\ No newline at end of file
serviceSubnet: 10.96.0.0/12
......@@ -390,23 +390,6 @@ func (k *Bootstrapper) DeleteCluster(k8s config.KubernetesConfig) error {
return nil
}
// PullImages downloads images that will be used by Kubernetes
func (k *Bootstrapper) PullImages(k8s config.KubernetesConfig) error {
version, err := bsutil.ParseKubernetesVersion(k8s.KubernetesVersion)
if err != nil {
return errors.Wrap(err, "parsing kubernetes version")
}
if version.LT(semver.MustParse("1.11.0")) {
return fmt.Errorf("pull command is not supported by kubeadm v%s", version)
}
rr, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s config images pull --config %s", bsutil.InvokeKubeadm(k8s.KubernetesVersion), bsutil.KubeadmYamlPath)))
if err != nil {
return errors.Wrapf(err, "running cmd: %q", rr.Command())
}
return nil
}
// SetupCerts sets up certificates within the cluster.
func (k *Bootstrapper) SetupCerts(k8s config.KubernetesConfig, n config.Node) error {
return bootstrapper.SetupCerts(k.c, k8s, n)
......
......@@ -18,7 +18,6 @@ package cluster
import (
"fmt"
"os"
"testing"
"time"
......@@ -338,73 +337,6 @@ func TestGetHostStatus(t *testing.T) {
checkState(state.Stopped.String())
}
func TestGetNodeDockerEnv(t *testing.T) {
RegisterMockDriver(t)
tempDir := tests.MakeTempDir()
defer os.RemoveAll(tempDir)
api := tests.NewMockAPI(t)
h, err := createHost(api, defaultMachineConfig)
if err != nil {
t.Fatalf("Error creating host: %v", err)
}
d := &tests.MockDriver{
BaseDriver: drivers.BaseDriver{
IPAddress: "127.0.0.1",
},
T: t,
}
h.Driver = d
envMap, err := GetNodeDockerEnv(api)
if err != nil {
t.Fatalf("Unexpected error getting env: %v", err)
}
dockerEnvKeys := [...]string{
constants.DockerTLSVerifyEnv,
constants.DockerHostEnv,
constants.DockerCertPathEnv,
constants.MinikubeActiveDockerdEnv,
}
for _, dockerEnvKey := range dockerEnvKeys {
if _, hasKey := envMap[dockerEnvKey]; !hasKey {
t.Fatalf("Expected envMap[\"%s\"] key to be defined", dockerEnvKey)
}
}
}
func TestGetNodeDockerEnvIPv6(t *testing.T) {
RegisterMockDriver(t)
tempDir := tests.MakeTempDir()
defer os.RemoveAll(tempDir)
api := tests.NewMockAPI(t)
h, err := createHost(api, defaultMachineConfig)
if err != nil {
t.Fatalf("Error creating host: %v", err)
}
d := &tests.MockDriver{
BaseDriver: drivers.BaseDriver{
IPAddress: "fe80::215:5dff:fe00:a903",
},
T: t,
}
h.Driver = d
envMap, err := GetNodeDockerEnv(api)
if err != nil {
t.Fatalf("Unexpected error getting env: %v", err)
}
expected := "tcp://[fe80::215:5dff:fe00:a903]:2376"
v := envMap["DOCKER_HOST"]
if v != expected {
t.Fatalf("Expected DOCKER_HOST to be defined as %s but was %s", expected, v)
}
}
func TestCreateSSHShell(t *testing.T) {
api := tests.NewMockAPI(t)
......
/*
Copyright 2020 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.
*/
package cluster
import (
"fmt"
"net"
"github.com/docker/machine/libmachine"
"github.com/pkg/errors"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
)
// GetNodeDockerEnv gets the necessary docker env variables to allow the use of docker through minikube's vm
func GetNodeDockerEnv(api libmachine.API) (map[string]string, error) {
pName := viper.GetString(config.MachineProfile)
host, err := CheckIfHostExistsAndLoad(api, pName)
if err != nil {
return nil, errors.Wrap(err, "Error checking that api exists and loading it")
}
ip := kic.DefaultBindIPV4
if !driver.IsKIC(host.Driver.DriverName()) { // kic externally accessible ip is different that node ip
ip, err = host.Driver.GetIP()
if err != nil {
return nil, errors.Wrap(err, "Error getting ip from host")
}
}
tcpPrefix := "tcp://"
port := constants.DockerDaemonPort
if driver.IsKIC(host.Driver.DriverName()) { // for kic we need to find out what port docker allocated during creation
port, err = oci.HostPortBinding(host.Driver.DriverName(), pName, constants.DockerDaemonPort)
if err != nil {
return nil, errors.Wrapf(err, "get hostbind port for %d", constants.DockerDaemonPort)
}
}
envMap := map[string]string{
constants.DockerTLSVerifyEnv: "1",
constants.DockerHostEnv: tcpPrefix + net.JoinHostPort(ip, fmt.Sprint(port)),
constants.DockerCertPathEnv: localpath.MakeMiniPath("certs"),
constants.MinikubeActiveDockerdEnv: pName,
}
return envMap, nil
}
......@@ -95,7 +95,7 @@ weight = 1
[params]
copyright = "The Kubernetes Authors -- "
# The latest release of minikube
latest_release = "1.6.2"
latest_release = "1.7.1"
privacy_policy = ""
......
......@@ -52,6 +52,14 @@ Lists all available minikube addons as well as their current statuses (enabled/d
```
minikube addons list [flags]
```
### Options
```
-h, --help help for list
-o, --output string minikube addons list --output OUTPUT. json, list (default "list")
```
## minikube addons open
Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list
......
......@@ -39,3 +39,11 @@ minikube cache list [flags]
For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#CacheListTemplate (default "{{.CacheImage}}\n")
-h, --help help for list
```
## minikube cache reload
reloads images previously added using the 'cache add' subcommand
```
minikube cache reload [flags]
```
\ No newline at end of file
......@@ -14,6 +14,7 @@ config modifies minikube config files using subcommands like "minikube config se
Configurable fields:
* vm-driver
* container-runtime
* feature-gates
* v
* cpus
......@@ -33,26 +34,13 @@ Configurable fields:
* bootstrapper
* ShowDriverDeprecationNotification
* ShowBootstrapperDeprecationNotification
* dashboard
* addon-manager
* default-storageclass
* efk
* ingress
* registry
* registry-creds
* freshpod
* default-storageclass
* storage-provisioner
* storage-provisioner-gluster
* metrics-server
* nvidia-driver-installer
* nvidia-gpu-device-plugin
* logviewer
* gvisor
* insecure-registry
* hyperv-virtual-switch
* disable-driver-mounts
* cache
* embed-certs
* native-ssh
### subcommands
......
......@@ -18,7 +18,7 @@ minikube logs [flags]
```
-f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.
-h, --help help for logs
-n, --length int Number of lines back to go within the log (default 50)
-n, --length int Number of lines back to go within the log (default 60)
--problems Show only log entries which point to known problems
```
......
---
title: "pause"
linkTitle: "pause"
weight: 1
date: 2020-02-05
description: >
pause the Kubernetes control plane or other namespaces
---
### Overview
The pause command allows you to freeze containers using the Linux [cgroup freezer](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt). Once frozen, processes will no longer consume CPU cycles, but will remain in memory.
By default, the pause command will pause the Kubernetes control plane (kube-system namespace), leaving your applications running. This reduces the background CPU usage of a minikube cluster to a negligable 2-3% of a CPU.
### Usage
```
minikube pause [flags]
```
### Options
```
-n, ----namespaces strings namespaces to pause (default [kube-system,kubernetes-dashboard,storage-gluster,istio-operator])
-A, --all-namespaces If set, pause all namespaces
-h, --help help for pause
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [unpause](unpause.md)
......@@ -49,3 +49,10 @@ Lists all valid minikube profiles and detects all possible invalid profiles.
```
minikube profile list [flags]
```
### Options
```
-h, --help help for list
-o, --output string The output format. One of 'json', 'table' (default "table")
```
......@@ -27,7 +27,7 @@ minikube service [flags] SERVICE
--format string Format to output service URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}")
-h, --help help for service
--https Open the service URL with https instead of http
--interval int The time interval for each check that wait performs in seconds (default 6)
--interval int The initial time interval for each check that wait performs in seconds (default 6)
-n, --namespace string The service namespace (default "default")
--url Display the kubernetes service URL in the CLI instead of opening it in the default browser
--wait int Amount of time to wait for a service in seconds (default 20)
......
......@@ -13,18 +13,10 @@ description: >
```
minikube ssh [flags]
```
```
### Options inherited from parent commands
### Options
```
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
-h, --help help for ssh
--native-ssh Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'. (default true)
```
......@@ -16,60 +16,69 @@ minikube start [flags]
### Options
```
--addons Enable addons. see `minikube addons list` for a list of valid addon names.
--apiserver-ips ipSlice A set of apiserver IP Addresses 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 (default [])
--apiserver-name string The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA")
--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)
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-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 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
--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")
--dns-proxy Enable proxy for NAT DNS requests (virtualbox)
--docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value)
--docker-opt stringArray Specify arbitrary flags to pass to the Docker daemon. (format: key=value)
--download-only If true, only download and cache files for later use - don't install or start anything.
--embed-certs if true, will embed the certs in kubeconfig.
--enable-default-cni Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni".
--extra-config ExtraOption 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, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr
--feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental features.
--force Force minikube to perform possibly dangerous operations
-h, --help help for start
--host-dns-resolver Enable host resolver for NAT DNS requests (virtualbox) (default true)
--host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24")
--hyperkit-vpnkit-sock string Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.
--hyperkit-vsock-ports strings List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).
--hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)
--image-mirror-country string Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn
--image-repository string Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
--iso-url string Location of the minikube iso. (default "https://storage.googleapis.com/minikube/iso/minikube-v1.3.0.iso")
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3) (default "v1.15.2")
--kvm-gpu Enable experimental NVIDIA GPU support in minikube
--kvm-hidden Hide the hypervisor signature from the guest in minikube
--kvm-network string The KVM network name. (only supported with KVM driver) (default "default")
--kvm-qemu-uri string The KVM QEMU connection URI. (works only with kvm2 driver on linux) (default "qemu:///system")
--memory string Amount of RAM allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g). (default "2000mb")
--mount This will start the mount daemon and automatically mount files into minikube.
--mount-string string The argument to pass the minikube mount command on start. (default "/Users:/minikube-host")
--network-plugin string The name of the network plugin.
--nfs-share strings Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now)
--nfs-shares-root string Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now) (default "/nfsshares")
--no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)
--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 hyperkit vmware] (default "virtualbox")
--wait Wait until Kubernetes core services are healthy before exiting. (default true)
--wait-timeout duration max time to wait per Kubernetes core services to be healthy. (default 3m0s)
```
--addons minikube addons list Enable addons. see minikube addons list for a list of valid addon names.
--apiserver-ips ipSlice A set of apiserver IP Addresses 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 (default [])
--apiserver-name string The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA")
--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)
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-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 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
--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")
--dns-proxy Enable proxy for NAT DNS requests (virtualbox driver only)
--docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value)
--docker-opt stringArray Specify arbitrary flags to pass to the Docker daemon. (format: key=value)
--download-only If true, only download and cache files for later use - don't install or start anything.
--dry-run dry-run mode. Validates configuration, but does not mutate system state
--embed-certs if true, will embed the certs in kubeconfig.
--enable-default-cni Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni".
--extra-config ExtraOption 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, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr
--feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental features.
--force Force minikube to perform possibly dangerous operations
-h, --help help for start
--host-dns-resolver Enable host resolver for NAT DNS requests (virtualbox driver only) (default true)
--host-only-cidr string The CIDR to be used for the minikube VM (virtualbox driver only) (default "192.168.99.1/24")
--host-only-nic-type string NIC Type used for host only network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only) (default "virtio")
--hyperkit-vpnkit-sock string Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock (hyperkit driver only)
--hyperkit-vsock-ports strings List of guest VSock ports that should be exposed as sockets on the host (hyperkit driver only)
--hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (hyperv driver only)
--image-mirror-country string Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn.
--image-repository string Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
--interactive Allow user prompts for more information (default true)
--iso-url string Location of the minikube iso. (default "https://storage.googleapis.com/minikube/iso/minikube-v1.7.0.iso")
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3)
--kvm-gpu Enable experimental NVIDIA GPU support in minikube
--kvm-hidden Hide the hypervisor signature from the guest in minikube (kvm2 driver only)
--kvm-network string The KVM network name. (kvm2 driver only) (default "default")
--kvm-qemu-uri string The KVM QEMU connection URI. (kvm2 driver only) (default "qemu:///system")
--memory string Amount of RAM allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g). (default "2000mb")
--mount This will start the mount daemon and automatically mount files into minikube.
--mount-string string The argument to pass the minikube mount command on start. (default "/Users:/minikube-host")
--nat-nic-type string NIC Type used for host only network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only) (default "virtio")
--native-ssh Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'. (default true)
--network-plugin string The name of the network plugin.
--nfs-share strings Local folders to share with Guest via NFS mounts (hyperkit driver only)
--nfs-shares-root string Where to root the NFS Shares, defaults to /nfsshares (hyperkit driver only) (default "/nfsshares")
--no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started (virtualbox driver only)
--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 (hyperkit driver only)
--vm-driver string Driver is one of: virtualbox, parallels, vmwarefusion, hyperkit, vmware, docker (experimental) (defaults to auto-detect)
--wait Block until the apiserver is servicing API requests (default true)
--wait-timeout duration max time to wait per Kubernetes core services to be healthy. (default 6m0s)```
### Options inherited from parent commands
......
......@@ -23,13 +23,30 @@ minikube status [flags]
### Options
```
--format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "host: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubectl: {{.Kubeconfig}}\n")
-f, --format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "host: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubeconfig: {{.Kubeconfig}}\n")
-h, --help help for status
-o, --output string minikube status --output OUTPUT. json, text (default "text")
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
......
---
title: "unpause"
linkTitle: "unpause"
weight: 1
date: 2020-02-05
description: >
unpause the Kubernetes control plane or other namespaces
---
### Usage
```
minikube unpause [flags]
```
### Options
```
-n, ----namespaces strings namespaces to unpause (default [kube-system,kubernetes-dashboard,storage-gluster,istio-operator])
-A, --all-namespaces If set, unpause all namespaces
-h, --help help for unpause
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [pause](pause.md)
---
title: "docker"
linkTitle: "docker"
weight: 3
date: 2020-02-05
description: >
Docker driver (EXPERIMENTAL)
---
## Overview
The Docker driver is an experimental VM-free driver that ships with minikube v1.7.
This driver was inspired by the [kind project](https://kind.sigs.k8s.io/), and uses a modified version of its base image.
## Special features
No hypervisor required when run on Linux.
## Limitations
As an experimental driver, not all commands are supported on all platforms. Notably: `mount,` `service`, `tunnel`, and others. Most of these limitations will be addressed by minikube v1.8 (March 2020)
## Issues
* [Full list of open 'kic-driver' issues](https://github.com/kubernetes/minikube/labels/co%2Fkic-driver)
## Troubleshooting
* Run `minikube start --alsologtostderr -v=1` to debug crashes
......@@ -21,8 +21,8 @@ Download and install minikube to /usr/local/bin:
Download and install minikube:
```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_{{< latest >}}.deb \
&& sudo dpkg -i minikube_{{< latest >}}.deb
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_{{< latest >}}-0_amd64.deb \
&& sudo dpkg -i minikube_{{< latest >}}-0_amd64.deb
```
{{% /tab %}}
......@@ -32,8 +32,8 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_{{< la
Download and install minikube:
```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-{{< latest >}}.rpm \
&& sudo rpm -ivh minikube-{{< latest >}}.rpm
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-{{< latest >}}-0.x86_64.rpm \
&& sudo rpm -ivh minikube-{{< latest >}}-0.x86_64.rpm
```
{{% /tab %}}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册