From 17925ba7e59a0f2793caf3728f327a5f435559a9 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Tue, 29 Jan 2019 07:50:03 -0800 Subject: [PATCH 01/26] Update persistent_volumes.md Summarinzing the way CSI is implemented in minikube w/ hostpath. --- docs/persistent_volumes.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/persistent_volumes.md b/docs/persistent_volumes.md index 5e605be78ccb..13939b9d6147 100644 --- a/docs/persistent_volumes.md +++ b/docs/persistent_volumes.md @@ -1,6 +1,7 @@ ## Persistent Volumes -Minikube supports [PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) of type `hostPath`. -These PersistentVolumes are mapped to a directory inside the Minikube VM. +Minikube supports [PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) of type `hostPath` out of the box. These PersistentVolumes are mapped to a directory inside the running Minikube instance (usually a VM, unless you use `--vm-driver=none`. + +## A note on VMs The Minikube VM boots into a tmpfs, so most directories will not be persisted across reboots (`minikube stop`). However, Minikube is configured to persist files stored under the following directories in the Minikube VM: @@ -28,3 +29,10 @@ spec: ``` You can also achieve persistence by creating a PV in a mounted host folder. + +## Dynamic provisioning and CSI + +In addition, minikube implements a very simple, canonical implementation of CSI as a controller that runs alongside its deployment. This manages provisioning of *hostPath* volumes via the CSI interface (rather then via the previous, in-tree hostPath provider). + +The default CSI [Storage Provisioner Controller](https://github.com/kubernetes/minikube/blob/master/pkg/storage/storage_provisioner.go) is managed internally, in the minikube codebase. This controller provides pods with dynamically, CSI managed storage, which is a good way to experiment with CSI as well as to test your pod's behaviour when persistent storage is mapped to it. You can see the running storage controller if you check the `kube-system` namespace. + From 327fdd8d4bf86ac307bdebd836fb80594abc8bf8 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 6 Mar 2019 13:32:33 -0800 Subject: [PATCH 02/26] Update kubeadm config generation to be compatible with v1.14.0-beta.1 --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 10 ++- .../bootstrapper/kubeadm/kubeadm_test.go | 81 +++++++++++++++++-- .../bootstrapper/kubeadm/templates.go | 67 ++++++++++++--- pkg/minikube/bootstrapper/kubeadm/versions.go | 21 +++-- pkg/util/constants.go | 7 +- 5 files changed, 162 insertions(+), 24 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index f0cf0727396b..15824c583cf1 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -510,11 +510,15 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) (string, er } b := bytes.Buffer{} - kubeadmConfigTemplate := kubeadmConfigTemplateV1Alpha1 + configTmpl := configTmplV1Alpha1 if version.GTE(semver.MustParse("1.12.0")) { - kubeadmConfigTemplate = kubeadmConfigTemplateV1Alpha3 + configTmpl = configTmplV1Alpha3 } - if err := kubeadmConfigTemplate.Execute(&b, opts); err != nil { + // v1beta1 works in v1.13, but isn't required until v1.14. + if version.GTE(semver.MustParse("1.14.0-alpha.0")) { + configTmpl = configTmplV1Beta1 + } + if err := configTmpl.Execute(&b, opts); err != nil { return "", err } diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go index 01ad19cd03dc..f4fd70862ed0 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go @@ -17,8 +17,10 @@ limitations under the License. package kubeadm import ( + "strings" "testing" + "github.com/google/go-cmp/cmp" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/cruntime" "k8s.io/minikube/pkg/util" @@ -104,6 +106,72 @@ schedulerExtraArgs: `, }, { + description: "extra args, v1.14.0", + cfg: config.KubernetesConfig{ + NodeIP: "192.168.1.101", + KubernetesVersion: "v1.14.0-beta1", + NodeName: "extra-args-minikube-114", + ExtraOptions: util.ExtraOptionSlice{ + util.ExtraOption{ + Component: Apiserver, + Key: "fail-no-swap", + Value: "true", + }, + util.ExtraOption{ + Component: ControllerManager, + Key: "kube-api-burst", + Value: "32", + }, + }, + }, + expectedCfg: `apiVersion: kubeadm.k8s.io/v1beta1 +kind: InitConfiguration +localAPIEndpoint: + advertiseAddress: 192.168.1.101 + bindPort: 8443 +bootstrapTokens: +- groups: + - system:bootstrappers:kubeadm:default-node-token + ttl: 24h0m0s + usages: + - signing + - authentication +nodeRegistration: + criSocket: /var/run/dockershim.sock + name: extra-args-minikube-114 + taints: [] +--- +apiVersion: kubeadm.k8s.io/v1beta1 +kind: ClusterConfiguration +apiServer: + extraArgs: + enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"fail-no-swap: "true" +controllerManager: + extraArgs: + kube-api-burst: "32" +certificatesDir: /var/lib/minikube/certs/ +clusterName: kubernetes +controlPlaneEndpoint: localhost:8443 +dns: + type: CoreDNS +etcd: + local: + dataDir: /data/minikube +kubernetesVersion: v1.14.0-beta1 +networking: + dnsDomain: cluster.local + podSubnet: "" + serviceSubnet: 10.96.0.0/12 +--- +apiVersion: kubelet.config.k8s.io/v1beta1 +kind: KubeletConfiguration +imageGCHighThresholdPercent: 100 +evictionHard: + nodefs.available: "0%" + nodefs.inodesFree: "0%" + imagefs.available: "0%" +`, + }, { description: "two extra args for one component", cfg: config.KubernetesConfig{ NodeIP: "192.168.1.101", @@ -264,18 +332,21 @@ apiServerExtraArgs: } t.Run(test.description, func(t *testing.T) { - actualCfg, err := generateConfig(test.cfg, runtime) + got, err := generateConfig(test.cfg, runtime) if err != nil && !test.shouldErr { t.Errorf("got unexpected error generating config: %v", err) return } if err == nil && test.shouldErr { - t.Errorf("expected error but got none, config: %s", actualCfg) + t.Errorf("expected error but got none, config: %s", got) return } - if actualCfg != test.expectedCfg { - t.Errorf("actual config does not match expected. actual:\n%sexpected:\n%s", actualCfg, test.expectedCfg) - return + + // cmp.Diff doesn't present diffs of multi-line text well + gotSplit := strings.Split(got, "\n") + wantSplit := strings.Split(test.expectedCfg, "\n") + if diff := cmp.Diff(gotSplit, wantSplit); diff != "" { + t.Errorf("unexpected diff: (-want +got)\n%s\ngot: %s\n", diff, got) } }) } diff --git a/pkg/minikube/bootstrapper/kubeadm/templates.go b/pkg/minikube/bootstrapper/kubeadm/templates.go index 8b35b2b827b5..172342723065 100644 --- a/pkg/minikube/bootstrapper/kubeadm/templates.go +++ b/pkg/minikube/bootstrapper/kubeadm/templates.go @@ -22,7 +22,8 @@ import ( "text/template" ) -var kubeadmConfigTemplateV1Alpha1 = template.Must(template.New("kubeadmConfigTemplate-v1alpha1").Funcs(template.FuncMap{ +// configTmplV1Alpha1 is for Kubernetes v1.11 +var configTmplV1Alpha1 = template.Must(template.New("configTmpl-v1alpha1").Funcs(template.FuncMap{ "printMapInOrder": printMapInOrder, }).Parse(`apiVersion: kubeadm.k8s.io/v1alpha1 kind: MasterConfiguration @@ -39,16 +40,16 @@ etcd: dataDir: {{.EtcdDataDir}} nodeName: {{.NodeName}} {{if .CRISocket}}criSocket: {{.CRISocket}} -{{end}}{{range .ExtraArgs}}{{.Component}}:{{range $i, $val := printMapInOrder .Options ": " }} +{{end}}{{range .ExtraArgs}}{{.Component}}ExtraArgs:{{range $i, $val := printMapInOrder .Options ": " }} {{$val}}{{end}} {{end}}{{if .FeatureArgs}}featureGates: {{range $i, $val := .FeatureArgs}} {{$i}}: {{$val}}{{end}} {{end}}`)) -var kubeadmConfigTemplateV1Alpha3 = template.Must(template.New("kubeadmConfigTemplate-v1alpha3").Funcs(template.FuncMap{ +// configTmplV1Alpha3 is for Kubernetes v1.12 +var configTmplV1Alpha3 = template.Must(template.New("configTmpl-v1alpha3").Funcs(template.FuncMap{ "printMapInOrder": printMapInOrder, -}).Parse(` -apiVersion: kubeadm.k8s.io/v1alpha3 +}).Parse(`apiVersion: kubeadm.k8s.io/v1alpha3 kind: InitConfiguration apiEndpoint: advertiseAddress: {{.AdvertiseAddress}} @@ -67,7 +68,7 @@ nodeRegistration: --- apiVersion: kubeadm.k8s.io/v1alpha3 kind: ClusterConfiguration -{{range .ExtraArgs}}{{.Component}}:{{range $i, $val := printMapInOrder .Options ": " }} +{{range .ExtraArgs}}{{.Component}}ExtraArgs:{{range $i, $val := printMapInOrder .Options ": " }} {{$val}}{{end}} {{end}}{{if .FeatureArgs}}featureGates: {{range $i, $val := .FeatureArgs}} {{$i}}: {{$val}}{{end}} @@ -86,14 +87,62 @@ networking: --- apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration -# disable disk resource management by default, as it doesn't work well within the minikube environment. +evictionHard: + nodefs.available: "0%" + nodefs.inodesFree: "0%" + imagefs.available: "0%" +`)) + +// configTmplV1Beta1 is for Kubernetes v1.13+ +var configTmplV1Beta1 = template.Must(template.New("configTmpl-v1beta1").Funcs(template.FuncMap{ + "printMapInOrder": printMapInOrder, +}).Parse(`apiVersion: kubeadm.k8s.io/v1beta1 +kind: InitConfiguration +localAPIEndpoint: + advertiseAddress: {{.AdvertiseAddress}} + bindPort: {{.APIServerPort}} +bootstrapTokens: +- groups: + - system:bootstrappers:kubeadm:default-node-token + ttl: 24h0m0s + usages: + - signing + - authentication +nodeRegistration: + criSocket: {{if .CRISocket}}{{.CRISocket}}{{else}}/var/run/dockershim.sock{{end}} + name: {{.NodeName}} + taints: [] +--- +apiVersion: kubeadm.k8s.io/v1beta1 +kind: ClusterConfiguration +{{range .ExtraArgs}}{{.Component}}: + extraArgs: + {{range $i, $val := printMapInOrder .Options ": " }}{{$val}}{{end}} +{{end}}{{if .FeatureArgs}}featureGates: {{range $i, $val := .FeatureArgs}} + {{$i}}: {{$val}}{{end}} +{{end -}} +certificatesDir: {{.CertDir}} +clusterName: kubernetes +controlPlaneEndpoint: localhost:{{.APIServerPort}} +dns: + type: CoreDNS +etcd: + local: + dataDir: {{.EtcdDataDir}} +kubernetesVersion: {{.KubernetesVersion}} +networking: + dnsDomain: cluster.local + podSubnet: "" + serviceSubnet: {{.ServiceCIDR}} +--- +apiVersion: kubelet.config.k8s.io/v1beta1 +kind: KubeletConfiguration imageGCHighThresholdPercent: 100 -# Don't evict jobs, as we only have a single node to run on. evictionHard: nodefs.available: "0%" nodefs.inodesFree: "0%" imagefs.available: "0%" - `)) +`)) var kubeletSystemdTemplate = template.Must(template.New("kubeletSystemdTemplate").Parse(` [Unit] diff --git a/pkg/minikube/bootstrapper/kubeadm/versions.go b/pkg/minikube/bootstrapper/kubeadm/versions.go index fc2201cab2b6..87f7d28fc6b5 100644 --- a/pkg/minikube/bootstrapper/kubeadm/versions.go +++ b/pkg/minikube/bootstrapper/kubeadm/versions.go @@ -65,10 +65,11 @@ type ComponentExtraArgs struct { Options map[string]string } +// mapping of component to the section name in kubeadm. var componentToKubeadmConfigKey = map[string]string{ - Apiserver: "apiServerExtraArgs", - ControllerManager: "controllerManagerExtraArgs", - Scheduler: "schedulerExtraArgs", + Apiserver: "apiServer", + ControllerManager: "controllerManager", + Scheduler: "scheduler", // The Kubelet is not configured in kubeadm, only in systemd. Kubelet: "", } @@ -246,7 +247,7 @@ var versionSpecificOpts = []VersionedExtraOption{ Option: util.ExtraOption{ Component: Apiserver, Key: "admission-control", - Value: strings.Join(util.DefaultAdmissionControllers, ","), + Value: strings.Join(util.DefaultLegacyAdmissionControllers, ","), }, LessThanOrEqual: semver.MustParse("1.10.1000"), // Semver doesn't support wildcards. GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"), @@ -255,10 +256,20 @@ var versionSpecificOpts = []VersionedExtraOption{ Option: util.ExtraOption{ Component: Apiserver, Key: "enable-admission-plugins", - Value: strings.Join(util.DefaultAdmissionControllers, ","), + Value: strings.Join(util.DefaultLegacyAdmissionControllers, ","), }, GreaterThanOrEqual: semver.MustParse("1.11.0-alpha.0"), + LessThanOrEqual: semver.MustParse("1.13.1000"), }, + { + Option: util.ExtraOption{ + Component: Apiserver, + Key: "enable-admission-plugins", + Value: strings.Join(util.DefaultV114AdmissionControllers, ","), + }, + GreaterThanOrEqual: semver.MustParse("1.14.0-alpha.0"), + }, + { Option: util.ExtraOption{ Component: Kubelet, diff --git a/pkg/util/constants.go b/pkg/util/constants.go index 8c1f85333249..ee089e295788 100644 --- a/pkg/util/constants.go +++ b/pkg/util/constants.go @@ -32,8 +32,8 @@ const ( DefaultServiceCIDR = "10.96.0.0/12" ) -var DefaultAdmissionControllers = []string{ - "Initializers", +// DefaultV114AdmissionControllers are admission controllers we default to in v1.14.x +var DefaultV114AdmissionControllers = []string{ "NamespaceLifecycle", "LimitRanger", "ServiceAccount", @@ -45,6 +45,9 @@ var DefaultAdmissionControllers = []string{ "ResourceQuota", } +// DefaultLegacyAdmissionControllers are admission controllers we default to in order Kubernetes releases +var DefaultLegacyAdmissionControllers = append(DefaultV114AdmissionControllers, "Initializers") + // GetServiceClusterIP returns the first IP of the ServiceCIDR func GetServiceClusterIP(serviceCIDR string) (net.IP, error) { ip, _, err := net.ParseCIDR(serviceCIDR) From 4a7e68c6b7a9d8e9fdb11676843f7b71eeec4eee Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 8 Mar 2019 09:51:08 -0800 Subject: [PATCH 03/26] Add detection for #3818 - no providers available --- pkg/minikube/logs/logs.go | 2 +- pkg/minikube/logs/logs_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index 4f833eaa439d..a5bda4793922 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -33,7 +33,7 @@ import ( ) // rootCauseRe is a regular expression that matches known failure root causes -var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --`) +var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted`) // importantPods are a list of pods to retrieve logs for, in addition to the bootstrapper logs. var importantPods = []string{ diff --git a/pkg/minikube/logs/logs_test.go b/pkg/minikube/logs/logs_test.go index 245f5aa4d384..487fba654fc2 100644 --- a/pkg/minikube/logs/logs_test.go +++ b/pkg/minikube/logs/logs_test.go @@ -28,10 +28,11 @@ func TestIsProblem(t *testing.T) { }{ {"almost", false, "F2350 I would love to be an unknown flag, but I am not -- :( --"}, {"apiserver-required-flag #1962", true, "error: [service-account-issuer is a required flag when BoundServiceAccountTokenVolume is enabled, --service-account-signing-key-file and --service-account-issuer are required flags"}, - {"kubelet-eviction #", true, "I0213 07:16:44.041623 2410 eviction_manager.go:187] eviction manager: pods kube-apiserver-minikube_kube-system(87f41e2e0629c3deb5c2239e08d8045d) evicted, waiting for pod to be cleaned up"}, + {"kubelet-eviction #3611", true, `eviction_manager.go:187] eviction manager: pods kube-proxy-kfs8p_kube-system(27fd6b4b-33cf-11e9-ae1d-00155d4b0144) evicted, waiting for pod to be cleaned up`}, {"kubelet-unknown-flag #3655", true, "F0212 14:55:46.443031 2693 server.go:148] unknown flag: --AllowedUnsafeSysctls"}, {"apiserver-auth-mode #2852", true, `{"log":"Error: unknown flag: --Authorization.Mode\n","stream":"stderr","time":"2018-06-17T22:16:35.134161966Z"}`}, {"apiserver-admission #3524", true, "error: unknown flag: --GenericServerRunOptions.AdmissionControl"}, + {"no-providers-available #3818", true, ` kubelet.go:1662] Failed creating a mirror pod for "kube-apiserver-minikube_kube-system(c7d572aebd3d33b17fa78ae6395b6d0a)": pods "kube-apiserver-minikube" is forbidden: no providers available to validate pod request`}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { From f968cb7709ab7e5aedec1a46e18b32bd93920548 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 8 Mar 2019 10:52:13 -0800 Subject: [PATCH 04/26] Don't try to run the images pull command on old versions of kubeadm --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index f0cf0727396b..be970d1286e3 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -314,6 +314,14 @@ func (k *KubeadmBootstrapper) DeleteCluster(k8s config.KubernetesConfig) error { // PullImages downloads images that will be used by RestartCluster func (k *KubeadmBootstrapper) PullImages(k8s config.KubernetesConfig) error { + version, err := 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) + } + cmd := fmt.Sprintf("sudo kubeadm config images pull --config %s", constants.KubeadmConfigFile) if err := k.c.Run(cmd); err != nil { return errors.Wrapf(err, "running cmd: %s", cmd) From 0c67b606040974ba600ecdad689abfb5bf2508a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 2 Mar 2019 19:39:18 +0100 Subject: [PATCH 05/26] Add Version() function to the Manager interface Helps with troubleshooting container runtimes --- pkg/minikube/cruntime/containerd.go | 16 ++++++++++++++++ pkg/minikube/cruntime/crio.go | 14 ++++++++++++++ pkg/minikube/cruntime/cruntime.go | 2 ++ pkg/minikube/cruntime/docker.go | 11 +++++++++++ pkg/minikube/cruntime/rkt.go | 14 ++++++++++++++ 5 files changed, 57 insertions(+) diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index e46a30e5daa9..4bd4712386f6 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -18,6 +18,7 @@ package cruntime import ( "fmt" + "strings" "github.com/golang/glog" ) @@ -33,6 +34,21 @@ func (r *Containerd) Name() string { return "containerd" } +// Version retrieves the current version of this runtime +func (r *Containerd) Version() string { + ver, err := r.Runner.CombinedOutput("containerd --version") + if err != nil { + return "" + } + + // containerd github.com/containerd/containerd v1.2.0 c4446665cb9c30056f4998ed953e6d4ff22c7c39 + words := strings.Split(ver, " ") + if len(words) >= 4 && words[0] == "containerd" { + return strings.Replace(words[2], "v", "", 1) + } + return "" +} + // SocketPath returns the path to the socket file for containerd func (r *Containerd) SocketPath() string { if r.Socket != "" { diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 93aa426ddf3d..0c5d3bacf1d6 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -18,6 +18,7 @@ package cruntime import ( "fmt" + "strings" "github.com/golang/glog" ) @@ -33,6 +34,19 @@ func (r *CRIO) Name() string { return "CRI-O" } +// Version retrieves the current version of this runtime +func (r *CRIO) Version() string { + ver, err := r.Runner.CombinedOutput("crio --version") + if err != nil { + return "" + } + + // crio version 1.13.0 + // commit: "" + line := strings.Split(ver, "\n")[0] + return strings.Replace(line, "crio version ", "", 1) +} + // SocketPath returns the path to the socket file for CRIO func (r *CRIO) SocketPath() string { if r.Socket != "" { diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index a254e69e1dfa..3981bed50b79 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -34,6 +34,8 @@ type CommandRunner interface { type Manager interface { // Name is a human readable name for a runtime Name() string + // Version retrieves the current version of this runtime + Version() string // Enable idempotently enables this runtime on a host Enable() error // Disable idempotently disables this runtime on a host diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 6fd55fe4ed43..647d77796a22 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -37,6 +37,17 @@ func (r *Docker) Name() string { return "Docker" } +// Version retrieves the current version of this runtime +func (r *Docker) Version() string { + // Note: the server daemon has to be running, for this call to return successfully + ver, err := r.Runner.CombinedOutput("docker version --format '{{.Server.Version}}'") + if err != nil { + return "" + } + + return strings.Split(ver, "\n")[0] +} + // SocketPath returns the path to the socket file for Docker func (r *Docker) SocketPath() string { return r.Socket diff --git a/pkg/minikube/cruntime/rkt.go b/pkg/minikube/cruntime/rkt.go index c1ef983ccc41..20e74d9ae64b 100644 --- a/pkg/minikube/cruntime/rkt.go +++ b/pkg/minikube/cruntime/rkt.go @@ -18,6 +18,7 @@ package cruntime import ( "fmt" + "strings" "github.com/golang/glog" ) @@ -33,6 +34,19 @@ func (r *Rkt) Name() string { return "rkt" } +// Version retrieves the current version of this runtime +func (r *Rkt) Version() string { + ver, err := r.Runner.CombinedOutput("rkt version") + if err != nil { + return "" + } + + // rkt Version: 1.24.0 + // appc Version: 0.8.10 + line := strings.Split(ver, "\n")[0] + return strings.Replace(line, "rkt Version: ", "", 1) +} + // SocketPath returns the path to the socket file for rkt/rktlet func (r *Rkt) SocketPath() string { if r.Socket != "" { From 9b2fad571033d8fbfbe81864d4391433ba287c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 2 Mar 2019 19:42:28 +0100 Subject: [PATCH 06/26] Show current version of the container runtime --- cmd/minikube/cmd/start.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 0cd95e48bd04..1a9481e33d08 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -479,6 +479,10 @@ func configureRuntimes(h *host.Host, runner bootstrapper.CommandRunner) cruntime if err != nil { exit.WithError("Failed to enable container runtime", err) } + version := cr.Version() + if version != "" { + console.OutStyle(cr.Name(), "Version of container runtime is %s", version) + } return cr } From 112a66c21ac5f9abbb138d77248854246f4daf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 10:18:26 +0100 Subject: [PATCH 07/26] Add some error reporting to the version method --- cmd/minikube/cmd/start.go | 4 ++-- pkg/minikube/cruntime/containerd.go | 8 ++++---- pkg/minikube/cruntime/crio.go | 6 +++--- pkg/minikube/cruntime/cruntime.go | 2 +- pkg/minikube/cruntime/docker.go | 6 +++--- pkg/minikube/cruntime/rkt.go | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 1a9481e33d08..7080189d8602 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -479,8 +479,8 @@ func configureRuntimes(h *host.Host, runner bootstrapper.CommandRunner) cruntime if err != nil { exit.WithError("Failed to enable container runtime", err) } - version := cr.Version() - if version != "" { + version, err := cr.Version() + if err == nil { console.OutStyle(cr.Name(), "Version of container runtime is %s", version) } return cr diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 4bd4712386f6..0e4f7a5362bf 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -35,18 +35,18 @@ func (r *Containerd) Name() string { } // Version retrieves the current version of this runtime -func (r *Containerd) Version() string { +func (r *Containerd) Version() (string, error) { ver, err := r.Runner.CombinedOutput("containerd --version") if err != nil { - return "" + return "", err } // containerd github.com/containerd/containerd v1.2.0 c4446665cb9c30056f4998ed953e6d4ff22c7c39 words := strings.Split(ver, " ") if len(words) >= 4 && words[0] == "containerd" { - return strings.Replace(words[2], "v", "", 1) + return strings.Replace(words[2], "v", "", 1), nil } - return "" + return "", fmt.Errorf("unknown version: %q", ver) } // SocketPath returns the path to the socket file for containerd diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 0c5d3bacf1d6..c3e7a72963bf 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -35,16 +35,16 @@ func (r *CRIO) Name() string { } // Version retrieves the current version of this runtime -func (r *CRIO) Version() string { +func (r *CRIO) Version() (string, error) { ver, err := r.Runner.CombinedOutput("crio --version") if err != nil { - return "" + return "", err } // crio version 1.13.0 // commit: "" line := strings.Split(ver, "\n")[0] - return strings.Replace(line, "crio version ", "", 1) + return strings.Replace(line, "crio version ", "", 1), nil } // SocketPath returns the path to the socket file for CRIO diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index 3981bed50b79..af904c797b3c 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -35,7 +35,7 @@ type Manager interface { // Name is a human readable name for a runtime Name() string // Version retrieves the current version of this runtime - Version() string + Version() (string, error) // Enable idempotently enables this runtime on a host Enable() error // Disable idempotently disables this runtime on a host diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 647d77796a22..5ba542d65b89 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -38,14 +38,14 @@ func (r *Docker) Name() string { } // Version retrieves the current version of this runtime -func (r *Docker) Version() string { +func (r *Docker) Version() (string, error) { // Note: the server daemon has to be running, for this call to return successfully ver, err := r.Runner.CombinedOutput("docker version --format '{{.Server.Version}}'") if err != nil { - return "" + return "", err } - return strings.Split(ver, "\n")[0] + return strings.Split(ver, "\n")[0], nil } // SocketPath returns the path to the socket file for Docker diff --git a/pkg/minikube/cruntime/rkt.go b/pkg/minikube/cruntime/rkt.go index 20e74d9ae64b..4e80e67b4e4e 100644 --- a/pkg/minikube/cruntime/rkt.go +++ b/pkg/minikube/cruntime/rkt.go @@ -35,16 +35,16 @@ func (r *Rkt) Name() string { } // Version retrieves the current version of this runtime -func (r *Rkt) Version() string { +func (r *Rkt) Version() (string, error) { ver, err := r.Runner.CombinedOutput("rkt version") if err != nil { - return "" + return "", err } // rkt Version: 1.24.0 // appc Version: 0.8.10 line := strings.Split(ver, "\n")[0] - return strings.Replace(line, "rkt Version: ", "", 1) + return strings.Replace(line, "rkt Version: ", "", 1), nil } // SocketPath returns the path to the socket file for rkt/rktlet From 7d1fdab6bcfac4298c317919756c6097d8994cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 10:37:55 +0100 Subject: [PATCH 08/26] Add unit test for container runtime version This only tests the happy path of the current iso versions. --- pkg/minikube/cruntime/cruntime_test.go | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index 1e26c35ec731..d86b9bbd219a 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -134,6 +134,10 @@ func (f *FakeRunner) CombinedOutput(cmd string) (string, error) { return f.docker(args, root) case "crictl": return f.crictl(args, root) + case "crio": + return f.crio(args, root) + case "containerd": + return f.containerd(args, root) default: return "", nil } @@ -181,7 +185,29 @@ func (f *FakeRunner) docker(args []string, root bool) (string, error) { delete(f.containers, id) } + case "version": + if args[1] == "--format" && args[2] == "'{{.Server.Version}}'" { + return "18.06.2-ce", nil + } + + } + return "", nil +} +// crio is a fake implementation of crio +func (f *FakeRunner) crio(args []string, root bool) (string, error) { + switch cmd := args[0]; cmd { + case "--version": + return "crio version 1.13.0", nil + } + return "", nil +} + +// containerd is a fake implementation of containerd +func (f *FakeRunner) containerd(args []string, root bool) (string, error) { + switch cmd := args[0]; cmd { + case "--version": + return "containerd github.com/containerd/containerd v1.2.0 c4446665cb9c30056f4998ed953e6d4ff22c7c39", nil } return "", nil } @@ -284,6 +310,33 @@ func (f *FakeRunner) systemctl(args []string, root bool) (string, error) { return out, nil } +func TestVersion(t *testing.T) { + var tests = []struct { + runtime string + want string + }{ + {"docker", "18.06.2-ce"}, + {"cri-o", "1.13.0"}, + {"containerd", "1.2.0"}, + } + for _, tc := range tests { + t.Run(tc.runtime, func(t *testing.T) { + runner := NewFakeRunner(t) + r, err := New(Config{Type: tc.runtime, Runner: runner}) + if err != nil { + t.Fatalf("New(%s): %v", tc.runtime, err) + } + got, err := r.Version() + if err != nil { + t.Fatalf("Version(%s): %v", tc.runtime, err) + } + if got != tc.want { + t.Errorf("Version(%s) = %q, want: %q", tc.runtime, got, tc.want) + } + }) + } +} + // defaultServices reflects the default boot state for the minikube VM var defaultServices = map[string]serviceState{ "docker": Running, From fd710756e3f21d74da92979c7844c10bf129f237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 12:09:21 +0100 Subject: [PATCH 09/26] Add make target to run markdownlint on md files --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 77bec70d4745..c4e0283e6448 100755 --- a/Makefile +++ b/Makefile @@ -66,6 +66,11 @@ KVM_DRIVER_FILES := ./cmd/drivers/kvm/ MINIKUBE_TEST_FILES := ./cmd/... ./pkg/... +# npm install -g markdownlint-cli +MARKDOWNLINT ?= markdownlint + +MINIKUBE_MARKDOWN_FILES := README.md docs CONTRIBUTING.md CHANGELOG.md + MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS) SOURCE_DIRS = cmd pkg test @@ -227,6 +232,10 @@ gendocs: out/docs/minikube.md fmt: @gofmt -l -s -w $(SOURCE_DIRS) +.PHONY: mdlint +mdlint: + @$(MARKDOWNLINT) $(MINIKUBE_MARKDOWN_FILES) + out/docs/minikube.md: $(shell find cmd) $(shell find pkg/minikube/constants) pkg/minikube/assets/assets.go cd $(GOPATH)/src/$(REPOPATH) && go run -ldflags="$(MINIKUBE_LDFLAGS)" hack/gen_help_text.go From fbd3da22e9852e77ee1af6515f5a7b5eb871eb85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 12:11:44 +0100 Subject: [PATCH 10/26] Add markdownlint config file, address some issues Mostly related to whitespace (newlines / trailing), lots of issues remaining to fix in the docs directory. As usual linting takes most effort when you start, but from there it is easier to keep code and docs clean. --- .markdownlint.json | 6 +++ CHANGELOG.md | 128 ++++++++++++++++++++++++++++++--------------- README.md | 8 +-- 3 files changed, 95 insertions(+), 47 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 000000000000..a317bea90b32 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "no-inline-html": false, + "no-trailing-punctuation": false, + "ul-style": false, + "line_length": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 51990d0a6bac..2174f139b3b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Minikube Release Notes -# Version 0.35.0 - 2019-03-06 +## Version 0.35.0 - 2019-03-06 * Update default Kubernetes version to v1.13.4 (latest stable) [#3807](https://github.com/kubernetes/minikube/pull/3807) * Update docker/machine to fix the AMD bug [#3809](https://github.com/kubernetes/minikube/pull/3809) @@ -34,7 +34,7 @@ Thank you to the following contributors who made this release possible: - Yaroslav Skopets - Yoan Blanc -# Version 0.34.1 - 2019-02-16 +## Version 0.34.1 - 2019-02-16 * Make non-zero ssh error codes less dramatic [#3703](https://github.com/kubernetes/minikube/pull/3703) * Only call trySSHPowerOff if we are using hyperv [#3702](https://github.com/kubernetes/minikube/pull/3702) @@ -48,7 +48,7 @@ Thank you to the folks who contributed to this bugfix release: - Joerg Schad - Thomas Strömberg -# Version 0.34.0 - 2019-02-15 +## Version 0.34.0 - 2019-02-15 * Initial implementation of 'console' package for stylized & localized console output 😂 [#3638](https://github.com/kubernetes/minikube/pull/3638) * Podman 1.0.0 [#3584](https://github.com/kubernetes/minikube/pull/3584) @@ -82,6 +82,7 @@ Thank you to the folks who contributed to this bugfix release: * Fix for issue #3044 - mounted timestamps incorrect with windows host [#3285](https://github.com/kubernetes/minikube/pull/3285) Huge thank you for this release towards our contributors: + - Abhilash Pallerlamudi - Alberto Alvarez - Anders Björklund @@ -107,11 +108,11 @@ Huge thank you for this release towards our contributors: - Yugo Horie - Zhongcheng Lao -# Version 0.33.1 - 2019-01-18 +## Version 0.33.1 - 2019-01-18 * Install upstream runc into /usr/bin/docker-runc [#3545](https://github.com/kubernetes/minikube/pull/3545) -# Version 0.33.0 - 2019-01-17 +## Version 0.33.0 - 2019-01-17 * Set default Kubernetes version to v1.13.2 (latest stable) [#3527](https://github.com/kubernetes/minikube/pull/3527) * Update to opencontainers/runc HEAD as of 2019-01-15 [#3535](https://github.com/kubernetes/minikube/pull/3535) @@ -159,7 +160,7 @@ Thank you to all to everyone who contributed to this massive release: - Thomas Strömberg - wujeff -# Version 0.32.0 - 12/21/2018 +## Version 0.32.0 - 12/21/2018 * Make Kubernetes v1.12.4 the default [#3482](https://github.com/kubernetes/minikube/pull/3482) * Update kubeadm restart commands to support v1.13.x [#3483](https://github.com/kubernetes/minikube/pull/3483) @@ -187,7 +188,7 @@ Shout-out to the amazing members of the minikube community who made this release - RA489 - Thomas Strömberg -# Version 0.31.0 - 12/08/2018 +## Version 0.31.0 - 12/08/2018 * Enable gvisor addon in minikube [#3399](https://github.com/kubernetes/minikube/pull/3399) * LoadBalancer emulation with `minikube tunnel` [#3015](https://github.com/kubernetes/minikube/pull/3015) @@ -200,17 +201,17 @@ Shout-out to the amazing members of the minikube community who made this release * Include ISO URL and reduce stutter in download error message [#3221](https://github.com/kubernetes/minikube/pull/3221) * Add apiserver check to "status", and block "start" until it's healthy. [#3401](https://github.com/kubernetes/minikube/pull/3401) * Containerd improvements - * Only restart docker service if container runtime is docker [#3426](https://github.com/kubernetes/minikube/pull/3426) + * Only restart docker service if container runtime is docker [#3426](https://github.com/kubernetes/minikube/pull/3426) * Restart containerd after stopping alternate runtimes [#3343](https://github.com/kubernetes/minikube/pull/3343) * CRI-O improvements * Stop docker daemon, when running cri-o [#3211](https://github.com/kubernetes/minikube/pull/3211) - * Upgrade to crio v1.11.8 [#3313](https://github.com/kubernetes/minikube/pull/3313) + * Upgrade to crio v1.11.8 [#3313](https://github.com/kubernetes/minikube/pull/3313) * Add config parameter for the cri socket path [#3154](https://github.com/kubernetes/minikube/pull/3154) - -* Ton of Build and CI improvements +* Ton of Build and CI improvements * Ton of documentation updates -Huge thank you for this release towards our contributors: +Huge thank you for this release towards our contributors: + - Akihiro Suda - Alexander Ilyin - Anders Björklund @@ -234,8 +235,7 @@ Huge thank you for this release towards our contributors: - xichengliudui - Yongkun Anfernee Gui - -# Version 0.30.0 - 10/04/2018 +## Version 0.30.0 - 10/04/2018 * **Fix for [CVE-2018-1002103](https://github.com/kubernetes/minikube/issues/3208): Dashboard vulnerable to DNS rebinding attack** [#3210](https://github.com/kubernetes/minikube/pull/3210) * Initial support for Kubernetes 1.12+ [#3180](https://github.com/kubernetes/minikube/pull/3180) @@ -250,6 +250,7 @@ Huge thank you for this release towards our contributors: * Significant improvements to kvm2 networking [#3148](https://github.com/kubernetes/minikube/pull/3148) Huge thank you for this release towards our contributors: + - Anders F Björklund - Bob Killen - David Genest @@ -264,7 +265,8 @@ Huge thank you for this release towards our contributors: - Sven Anderson - Thomas Strömberg -# Version 0.29.0 - 09/27/2018 +## Version 0.29.0 - 09/27/2018 + * Issue #3037 change dependency management to dep [#3136](https://github.com/kubernetes/minikube/pull/3136) * Update dashboard version to v1.10.0 [#3122](https://github.com/kubernetes/minikube/pull/3122) * fix: --format outputs any string, --https only subsitute http URL scheme [#3114](https://github.com/kubernetes/minikube/pull/3114) @@ -285,7 +287,7 @@ Huge thank you for this release towards our contributors: * Update to go 1.10.1 everywhere. [#2777](https://github.com/kubernetes/minikube/pull/2777) * Allow to override build date with SOURCE_DATE_EPOCH [#3009](https://github.com/kubernetes/minikube/pull/3009) -Huge Thank You for this release to our contributors: +Huge Thank You for this release to our contributors: - Aaron Prindle - AdamDang @@ -319,10 +321,12 @@ Huge Thank You for this release to our contributors: - wangxy518 - yanxuean -# Version 0.28.2 - 7/20/2018 +## Version 0.28.2 - 7/20/2018 + * Nvidia driver installation fixed [#2996](https://github.com/kubernetes/minikube/pull/2986) -# Version 0.28.1 - 7/16/2018 +## Version 0.28.1 - 7/16/2018 + * vboxsf Host Mounting fixed (Linux Kernel version downgraded to 4.15 from 4.16) [#2986](https://github.com/kubernetes/minikube/pull/2986) * cri-tools udpated to 1.11.1 [#2986](https://github.com/kubernetes/minikube/pull/2986) * Feature Gates support added to kubeadm bootstrapper [#2951](https://github.com/kubernetes/minikube/pull/2951) @@ -331,7 +335,8 @@ Huge Thank You for this release to our contributors: * nginx ingress controller updated to 0.16.2 [#2930](https://github.com/kubernetes/minikube/pull/2930) * heketi and gluster dependencies added to minikube ISO [#2925](https://github.com/kubernetes/minikube/pull/2925) -# Version 0.28.0 - 6/12/2018 +## Version 0.28.0 - 6/12/2018 + * Minikube status command fixes [#2894](https://github.com/kubernetes/minikube/pull/2894) * Boot changes to support virsh console [#2887](https://github.com/kubernetes/minikube/pull/2887) * ISO changes to update to Linux 4.16 [#2883](https://github.com/kubernetes/minikube/pull/2883) @@ -344,20 +349,23 @@ Huge Thank You for this release to our contributors: * Heapster updated to 1.5.3 [#2821](https://github.com/kubernetes/minikube/pull/2821) * Fix for clock skew in certificate creation [#2823](https://github.com/kubernetes/minikube/pull/2823) -# Version 0.27.0 - 5/14/2018 +## Version 0.27.0 - 5/14/2018 + * Start the default network for the kvm2 driver [#2806](https://github.com/kubernetes/minikube/pull/2806) * Fix 1.9.x versions of Kubernetes with the kubeadm bootstrapper [#2791](https://github.com/kubernetes/minikube/pull/2791) * Switch the ingress addon from an RC to a Deployment [#2788](https://github.com/kubernetes/minikube/pull/2788) * Update nginx ingress controller to 0.14.0 [#2780](https://github.com/kubernetes/minikube/pull/2780) * Disable dnsmasq on network for kvm driver [#2745](https://github.com/kubernetes/minikube/pull/2745) -# Version 0.26.1 - 4/17/2018 +## Version 0.26.1 - 4/17/2018 + * Mark hyperkit, kvm2 and none drivers as supported [#2734](https://github.com/kubernetes/minikube/pull/2723) and [#2728](https://github.com/kubernetes/minikube/pull/2728) * Bug fix for hyper-v driver [#2719](https://github.com/kubernetes/minikube/pull/2719) * Add back CRI preflight ignore [#2723](https://github.com/kubernetes/minikube/pull/2723) * Fix preflight checks on clusters <1.9 [#2721](https://github.com/kubernetes/minikube/pull/2721) -# Version 0.26.0 - 4/3/2018 +## Version 0.26.0 - 4/3/2018 + * Update to Kubernetes 1.10 [#2657](https://github.com/kubernetes/minikube/pull/2657) * Update Nginx Ingress Plugin to 0.12.0 [#2644](https://github.com/kubernetes/minikube/pull/2644) * [Minikube ISO] Add SSHFS Support to the Minikube ISO [#2600](https://github.com/kubernetes/minikube/pull/2600) @@ -372,7 +380,8 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Add Netfilter module to the ISO for Calico [#2490](https://github.com/kubernetes/minikube/pull/2490) * Add memory and request limit to EFK Addon [#2465](https://github.com/kubernetes/minikube/pull/2465) -# Version 0.25.0 - 1/26/2018 +## Version 0.25.0 - 1/26/2018 + * Add freshpod addon [#2423](https://github.com/kubernetes/minikube/pull/2423) * List addons in consistent sort order [#2446](https://github.com/kubernetes/minikube/pull/2446) * [Minikube ISO] Upgrade Docker to 17.09 [#2427](https://github.com/kubernetes/minikube/pull/2427) @@ -389,11 +398,13 @@ Huge Thank You for this release to our contributors: * Upgrade to Kubernetes 1.9 [#2343](https://github.com/kubernetes/minikube/pull/2343) * [hyperkit] Support NFS Sharing [#2337](https://github.com/kubernetes/minikube/pull/2337) -# Version 0.24.1 - 11/30/2017 +## Version 0.24.1 - 11/30/2017 + * Add checksum verification for localkube * Bump minikube iso to v0.23.6 -# Version 0.24.0 - 11/29/2017 +## Version 0.24.0 - 11/29/2017 + * Deprecated xhyve and kvm drivers [#2227](https://github.com/kubernetes/minikube/pull/2227) * Added support for a "rootfs" layer in .minikube/files [#2110](https://github.com/kubernetes/minikube/pull/2110) * Added a `cache` command to cache non-minikube images [#2203](https://github.com/kubernetes/minikube/pull/2203) @@ -406,7 +417,8 @@ Huge Thank You for this release to our contributors: * Bug fix to use the minikube context instead of the current kubectl context [#2128](https://github.com/kubernetes/minikube/pull/2128) * Added zsh autocompletion [#2194](https://github.com/kubernetes/minikube/pull/2194) -# Version 0.23.0 - 10/26/2017 +## Version 0.23.0 - 10/26/2017 + * Upgraded to go 1.9 [#2113](https://github.com/kubernetes/minikube/pull/2113) * Localkube is no longer packaged in minikube bin-data [#2089](https://github.com/kubernetes/minikube/pull/2089) * Upgraded to Kubernetes 1.8 [#2088](https://github.com/kubernetes/minikube/pull/2088) @@ -423,7 +435,8 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Upgraded to Docker 17.05-ce [#1542](https://github.com/kubernetes/minikube/pull/1542) * [Minikube ISO] Upgraded to CRI-O v1.0.0 [#2069](https://github.com/kubernetes/minikube/pull/2069) -# Version 0.22.3 - 10/3/2017 +## Version 0.22.3 - 10/3/2017 + * Update dnsmasq to 1.14.5 [2022](https://github.com/kubernetes/minikube/pull/2022) * Windows cache path fix [2000](https://github.com/kubernetes/minikube/pull/2000) * Windows path fix [1981](https://github.com/kubernetes/minikube/pull/1982) @@ -433,15 +446,18 @@ Huge Thank You for this release to our contributors: * [MINIKUBE ISO] Added cri-o runtime [1998](https://github.com/kubernetes/minikube/pull/1998) -# Version 0.22.2 - 9/15/2017 +## Version 0.22.2 - 9/15/2017 + * Fix path issue on windows [1954](https://github.com/kubernetes/minikube/pull/1959) * Added experimental kubeadm bootstrapper [1903](https://github.com/kubernetes/minikube/pull/1903) * Fixed Hyper-V KVP daemon [1958](https://github.com/kubernetes/minikube/pull/1958) -# Version 0.22.1 - 9/6/2017 +## Version 0.22.1 - 9/6/2017 + * Fix for chmod error on windows [1933](https://github.com/kubernetes/minikube/pull/1933) -# Version 0.22.0 - 9/6/2017 +## Version 0.22.0 - 9/6/2017 + * Made secure serving the default for all components and disabled insecure serving [#1694](https://github.com/kubernetes/minikube/pull/1694) * Increased minikube boot speed by caching docker images [#1881](https://github.com/kubernetes/minikube/pull/1881) * Added .minikube/files directory which gets moved into the VM at /files each VM start[#1917](https://github.com/kubernetes/minikube/pull/1917) @@ -452,7 +468,8 @@ Huge Thank You for this release to our contributors: * [MINIKUBE ISO] Update cni-bin to v0.6.0-rc1 [#1760](https://github.com/kubernetes/minikube/pull/1760) -# Version 0.21.0 - 7/25/2017 +## Version 0.21.0 - 7/25/2017 + * Added check for extra arguments to minikube delete [#1718](https://github.com/kubernetes/minikube/pull/1718) * Add GCR URL Env Var to Registry-Creds addon [#1436](https://github.com/kubernetes/minikube/pull/1436) * Bump version of Registry-Creds addon to v1.8 [#1711](https://github.com/kubernetes/minikube/pull/1711) @@ -482,6 +499,7 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Add ebtables util and enable kernel module [#1713](https://github.com/kubernetes/minikube/pull/1713) ## Version 0.20.0 - 6/17/2017 + * Updated default Kubernetes version to 1.6.4 * Added Local Registry Addon `minikube addons enable registry` [#1583](https://github.com/kubernetes/minikube/pull/1583) * Fixed kube-DNS addon failures @@ -500,6 +518,7 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Use buildroot branch 2017-02 ## Version 0.19.1 - 5/30/2017 + * Fixed issue where using TPRs could cause localkube to crash * Added mount daemon that can be started using `minikube start --mount --mount-string="/path/to/mount"`. Cleanup of mount handled by `minikube delete` * Added minikube "none" driver which does not require a VM but instead launches k8s components on the host. This allows minikube to be used in cloud environments that don't support nested virtualizations. This can be launched by running `sudo minikube start --vm-driver=none --use-vendored-driver` @@ -509,6 +528,7 @@ Huge Thank You for this release to our contributors: * Fixed vbox interface issue with minikube mount ## Version 0.19.0 - 5/3/2017 + * Updated nginx ingress to v0.9-beta.4 * Updated kube-dns to 1.14.1 * Added optional `--profile` flag to all `minikube` commands to support multiple minikube instances @@ -517,6 +537,7 @@ Huge Thank You for this release to our contributors: * Fixed issue where using TPRs could cause localkube to crash ## Version 0.18.0 - 4/6/2017 + * Upgraded default kubernetes version to v1.6.0 * Mount command on macOS xhyve * Pods can now write to files mounted by `minikube mount` @@ -541,6 +562,7 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Added CIFS-utils ## Version 0.17.1 - 3/2/2017 + * Removed vendored KVM driver so minikube doesn't have a dependency on libvirt-bin * [Minikube ISO] Added ethtool @@ -551,6 +573,7 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] `/tmp/hostpath_pv` and `/tmp/hostpath-provisioner` are now persisted ## Version 0.17.0 - 3/2/2017 + * Added external hostpath provisioner to localkube * Added unit test coverage * Added API Name as configuration option @@ -561,6 +584,7 @@ Huge Thank You for this release to our contributors: * Added `minikube mount` command for 9p server ## Version 0.16.0 - 2/2/2017 + * Updated minikube ISO to [v1.0.6](https://github.com/kubernetes/minikube/tree/v0.16.0/deploy/iso/minikube-iso/CHANGELOG.md) * Updated Registry Creds addon to v1.5 * Added check for minimum disk size @@ -577,6 +601,7 @@ Huge Thank You for this release to our contributors: * [Minikube ISO] Fixed vboxFS permission error ## Version 0.15.0 - 1/10/2017 + * Update Dashboard to v1.5.1, fixes a CSRF vulnerability in the dashboard * Updated Kube-DNS addon to v1.9 * Now supports kubenet as a network plugin @@ -588,6 +613,7 @@ Huge Thank You for this release to our contributors: * Switched integration tests to use golang subtest framework ## Version 0.14.0 - 12/14/2016 + * Update to k8s v1.5.1 * Update Addon-manager to v6.1 * Update Dashboard to v1.5 @@ -598,10 +624,12 @@ Huge Thank You for this release to our contributors: * Refactor integration tests ## Version 0.13.1 - 12/5/2016 + * Fix `service list` command * Dashboard dowgnraded to v1.4.2, correctly shows PetSets again ## Version 0.13.0 - 12/1/2016 + * Added heapster addon, disabled by default * Added `minikube addon open` command * Added Linux Virtualbox Integration tests @@ -614,11 +642,13 @@ Huge Thank You for this release to our contributors: * Update dashboard version to 1.5.0 ## Version 0.12.2 - 10/31/2016 + * Fixed dashboard command * Added support for net.IP to the configurator * Updated dashboard version to 1.4.2 ## Version 0.12.1 - 10/28/2016 + * Added docker-env support to the buildroot provisioner * `minikube service` command now supports multiple ports * Added `minikube service list` command @@ -629,6 +659,7 @@ Huge Thank You for this release to our contributors: * Add option to specify network name for KVM ## Version 0.12.0 - 10/21/2016 + * Added support for the KUBECONFIG env var during 'minikube start' * Updated default k8s version to v1.4.3 * Updated addon-manager to v5.1 @@ -641,6 +672,7 @@ Huge Thank You for this release to our contributors: * Added support for IPv6 addresses in docker env ## Version 0.11.0 - 10/6/2016 + * Added a "configurator" allowing users to configure the Kubernetes components with arbitrary values. * Made Kubernetes v1.4.0 the default version in minikube * Pre-built binaries are now built with go 1.7.1 @@ -648,6 +680,7 @@ Huge Thank You for this release to our contributors: * Bug fixes ## Version 0.10.0 - 9/15/2016 + * Updated the Kubernetes dashboard to v1.4.0 * Added experimental rkt support * Enabled DynamicProvisioning of volumes @@ -657,6 +690,7 @@ Huge Thank You for this release to our contributors: * Renamed the created VM from minikubeVM to minikube ## Version 0.9.0 - 9/1/2016 + * Added Hyper-V support for Windows * Added debug-level logging for show-libmachine-logs * Added ISO checksum validation for cached ISOs @@ -665,6 +699,7 @@ Huge Thank You for this release to our contributors: * xhyve driver will now receive the same IP across starts/delete ## Version 0.8.0 - 8/17/2016 + * Added a --registry-mirror flag to `minikube start`. * Updated Kubernetes components to v1.3.5. * Changed the `dashboard` and `service` commands to wait for the underlying services to be ready. @@ -677,9 +712,11 @@ Huge Thank You for this release to our contributors: * Minikube will now cache downloaded localkube versions. ## Version 0.7.1 - 7/27/2016 + * Fixed a filepath issue which caused `minikube start` to not work properly on Windows ## Version 0.7.0 - 7/26/2016 + * Added experimental support for Windows. * Changed the etc DNS port to avoid a conflict with deis/router. * Added a `insecure-registry` flag to `minikube start` to support insecure docker registries. @@ -692,6 +729,7 @@ Huge Thank You for this release to our contributors: * Added additional supported shells for `minikube docker-env` (fish, cmd, powershell, tcsh, bash, zsh). ## Version 0.6.0 - 7/13/2016 + * Added a `--disk-size` flag to `minikube start`. * Fixed a bug regarding auth tokens not being reconfigured properly after VM restart * Added a new `get-k8s-versions` command, to get the available kubernetes versions so that users know what versions are available when trying to select the kubernetes version to use @@ -699,6 +737,7 @@ Huge Thank You for this release to our contributors: * Documentation Updates ## Version 0.5.0 - 7/6/2016 + * Updated Kubernetes components to v1.3.0 * Added experimental support for KVM and XHyve based drivers. See the [drivers documentation](DRIVERS.md) for usage. * Fixed a bug causing cluster state to be deleted after a `minikube stop`. @@ -707,6 +746,7 @@ Huge Thank You for this release to our contributors: * Added a `--cpus` flag to `minikube start`. ## Version 0.4.0 - 6/27/2016 + * Updated Kubernetes components to v1.3.0-beta.1 * Updated the Kubernetes Dashboard to v1.1.0 * Added a check for updates to minikube. @@ -717,20 +757,22 @@ Huge Thank You for this release to our contributors: regenerated whenever `minikube start` is run. ## Version 0.3.0 - 6/10/2016 - * Added a `minikube dashboard` command to open the Kubernetes Dashboard. - * Updated Docker to version 1.11.1. - * Updated Kubernetes components to v1.3.0-alpha.5-330-g760c563. - * Generated documentation for all commands. Documentation [is here](https://github.com/kubernetes/minikube/blob/master/docs/minikube.md). +* Added a `minikube dashboard` command to open the Kubernetes Dashboard. +* Updated Docker to version 1.11.1. +* Updated Kubernetes components to v1.3.0-alpha.5-330-g760c563. +* Generated documentation for all commands. Documentation [is here](https://github.com/kubernetes/minikube/blob/master/docs/minikube.md). ## Version 0.2.0 - 6/3/2016 - * conntrack is now bundled in the ISO. - * DNS is now working. - * Minikube now uses the iptables based proxy mode. - * Internal libmachine logging is now hidden by default. - * There is a new `minikube ssh` command to ssh into the minikube VM. - * Dramatically improved integration test coverage - * Switched to glog instead of fmt.Print* + +* conntrack is now bundled in the ISO. +* DNS is now working. +* Minikube now uses the iptables based proxy mode. +* Internal libmachine logging is now hidden by default. +* There is a new `minikube ssh` command to ssh into the minikube VM. +* Dramatically improved integration test coverage +* Switched to glog instead of fmt.Print* ## Version 0.1.0 - 5/29/2016 - * Initial minikube release. + +* Initial minikube release. diff --git a/README.md b/README.md index 7dae733bf279..9ccc11bb7b05 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ## What is minikube? -minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. +minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. @@ -31,7 +31,7 @@ Our [goal](https://github.com/kubernetes/minikube/blob/master/docs/contributors/ minikube runs the official stable release of Kubernetes, with support for standard Kubernetes features like: -* [LoadBalancer](https://github.com/kubernetes/minikube/blob/master/docs/tunnel.md) - using `minikube tunnel` +* [LoadBalancer](https://github.com/kubernetes/minikube/blob/master/docs/tunnel.md) - using `minikube tunnel` * Multi-cluster - using `minikube start -p ` * NodePorts - using `minikube service` * [Persistent Volumes](https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md) @@ -56,7 +56,7 @@ As well as developer-friendly features: ## Community -minikube is a Kubernetes [#sig-cluster-lifecycle](https://github.com/kubernetes/community/tree/master/sig-cluster-lifecycle) project. +minikube is a Kubernetes [#sig-cluster-lifecycle](https://github.com/kubernetes/community/tree/master/sig-cluster-lifecycle) project. * [**#minikube on Kubernetes Slack**](https://kubernetes.slack.com) - Live chat with minikube developers! * [minikube-users mailing list](https://groups.google.com/forum/#!forum/minikube-users) @@ -81,7 +81,7 @@ See the [installation guide](https://kubernetes.io/docs/tasks/tools/install-mini * using [chocolatey](https://chocolatey.org/) `choco install minikube` * manually: Download and run the [installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe) -* *Linux* +* *Linux* * Requires either the [kvm2 driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver) (recommended), or VirtualBox * VT-x/AMD-v virtualization must be enabled in BIOS * manually: `curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && sudo install minikube-linux-amd64 /usr/local/bin/minikube` From 90527daf72846e9f36c7667c9a735e04d1417069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 15:57:10 +0100 Subject: [PATCH 11/26] Update list of cached images for kubernetes 1.14 --- pkg/minikube/constants/constants.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index c042bb6ace86..f7d80590f0c4 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -185,7 +185,8 @@ func GetKubeadmCachedImages(kubernetesVersionStr string) []string { "k8s.gcr.io/kube-apiserver-amd64:" + kubernetesVersionStr, } - ge_v1_13 := semver.MustParseRange(">=1.13.0") + ge_v1_14 := semver.MustParseRange(">=1.14.0") + v1_13 := semver.MustParseRange(">=1.13.0 <1.14.0") v1_12 := semver.MustParseRange(">=1.12.0 <1.13.0") v1_11 := semver.MustParseRange(">=1.11.0 <1.12.0") v1_10 := semver.MustParseRange(">=1.10.0 <1.11.0") @@ -197,7 +198,17 @@ func GetKubeadmCachedImages(kubernetesVersionStr string) []string { glog.Errorln("Error parsing version semver: ", err) } - if ge_v1_13(kubernetesVersion) { + if ge_v1_14(kubernetesVersion) { + images = append(images, []string{ + "k8s.gcr.io/pause:3.1", + "k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.13", + "k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.13", + "k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.13", + "k8s.gcr.io/etcd:3.3.10", + "k8s.gcr.io/coredns:1.3.1", + }...) + + } else if v1_13(kubernetesVersion) { images = append(images, []string{ "k8s.gcr.io/pause-amd64:3.1", "k8s.gcr.io/pause:3.1", From 8e6dbf80534c1efb380ff7724b259f157bdddc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 20:02:52 +0100 Subject: [PATCH 12/26] Run markdownlint on all the md files in docs --- .markdownlint.json | 4 +- docs/README.md | 4 +- docs/accessing_etcd.md | 7 +++- docs/addons.md | 4 +- docs/alternative_runtimes.md | 9 +++-- docs/cache.md | 2 +- docs/configuring_kubernetes.md | 4 +- docs/contributors/README.md | 4 +- docs/contributors/adding_a_dependency.md | 3 +- docs/contributors/adding_an_addon.md | 47 ++++++++++++------------ docs/contributors/adding_driver.md | 47 ++++++++++++------------ docs/contributors/build_guide.md | 23 ++++++++---- docs/contributors/ci_builds.md | 12 +++--- docs/contributors/minikube_iso.md | 7 ++-- docs/contributors/principles.md | 3 +- docs/contributors/releasing_minikube.md | 38 +++++++++---------- docs/debugging.md | 5 ++- docs/drivers.md | 22 +++++------ docs/env_vars.md | 4 +- docs/gpu.md | 25 ++++++++----- docs/host_folder_mount.md | 2 +- docs/http_proxy.md | 17 ++++----- docs/insecure_registry.md | 4 +- docs/networking.md | 38 +++++++++---------- docs/openid_connect_auth.md | 5 +-- docs/persistent_volumes.md | 5 ++- docs/reusing_the_docker_daemon.md | 4 +- docs/tunnel.md | 44 +++++++++++----------- docs/vmdriver-none.md | 2 +- 29 files changed, 212 insertions(+), 183 deletions(-) diff --git a/.markdownlint.json b/.markdownlint.json index a317bea90b32..3e6170a22564 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,6 +1,8 @@ { "no-inline-html": false, "no-trailing-punctuation": false, + "blanks-around-fences": false, + "commands-show-output": false, "ul-style": false, - "line_length": false + "line-length": false } diff --git a/docs/README.md b/docs/README.md index b41fc305f554..33fe2ce50372 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ -## Advanced Topics and Tutorials +# Advanced Topics and Tutorials -### Cluster Configuration +## Cluster Configuration * **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube with rkt as the container runtime diff --git a/docs/accessing_etcd.md b/docs/accessing_etcd.md index 0eae3e5597cd..80bd17f5842f 100644 --- a/docs/accessing_etcd.md +++ b/docs/accessing_etcd.md @@ -1,6 +1,9 @@ -## Accessing Host Resources From Inside A Pod -### When you have a VirtualBox driver +# Accessing Host Resources From Inside A Pod + +## When you have a VirtualBox driver + In order to access host resources from inside a pod, run the following command to determine the host IP you can use: + ```shell ip addr ``` diff --git a/docs/addons.md b/docs/addons.md index 7c83db3ab41d..e8430beaea11 100644 --- a/docs/addons.md +++ b/docs/addons.md @@ -1,6 +1,7 @@ -## Add-ons +# Add-ons Minikube has a set of built in addons that can be used enabled, disabled, and opened inside of the local k8s environment. Below is an example of this functionality for the `heapster` addon: + ```shell $ minikube addons list - registry: disabled @@ -26,6 +27,7 @@ Waiting, endpoint for service is not ready yet... Waiting, endpoint for service is not ready yet... Created new window in existing browser session. ``` + The currently supported addons include: * [Kubernetes Dashboard](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard) diff --git a/docs/alternative_runtimes.md b/docs/alternative_runtimes.md index 45e40212e340..4771fe0278a3 100644 --- a/docs/alternative_runtimes.md +++ b/docs/alternative_runtimes.md @@ -1,4 +1,6 @@ -### Using rkt container engine +# Alternative runtimes + +## Using rkt container engine To use [rkt](https://github.com/coreos/rkt) as the container runtime run: @@ -6,8 +8,7 @@ To use [rkt](https://github.com/coreos/rkt) as the container runtime run: $ minikube start --container-runtime=rkt ``` - -### Using CRI-O +## Using CRI-O To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run: @@ -27,7 +28,7 @@ $ minikube start --container-runtime=cri-o \ --extra-config=kubelet.image-service-endpoint=unix:///var/run/crio/crio.sock ``` -### Using containerd +## Using containerd To use [containerd](https://github.com/containerd/containerd) as the container runtime, run: diff --git a/docs/cache.md b/docs/cache.md index 6026c52574f1..f0efcc295061 100644 --- a/docs/cache.md +++ b/docs/cache.md @@ -1,4 +1,4 @@ -## Caching Images +# Caching Images Minikube supports caching non-minikube images using the `minikube cache` command. Images can be added to the cache by running `minikube cache add `, and deleted by running `minikube cache delete `. diff --git a/docs/configuring_kubernetes.md b/docs/configuring_kubernetes.md index 60d9761f934e..fead92402890 100644 --- a/docs/configuring_kubernetes.md +++ b/docs/configuring_kubernetes.md @@ -1,11 +1,11 @@ -## Configuring Kubernetes +# Configuring Kubernetes Minikube has a "configurator" feature that allows users to configure the Kubernetes components with arbitrary values. To use this feature, you can use the `--extra-config` flag on the `minikube start` command. This flag is repeated, so you can pass it several times with several different values to set multiple options. -### Kubeadm bootstrapper +## Kubeadm bootstrapper The kubeadm bootstrapper can be configured by the `--extra-config` flag on the `minikube start` command. It takes a string of the form `component.key=value` where `component` is one of the strings diff --git a/docs/contributors/README.md b/docs/contributors/README.md index 74138c751969..0e17ea28d71f 100644 --- a/docs/contributors/README.md +++ b/docs/contributors/README.md @@ -1,10 +1,11 @@ -## Contributing +# Contributing * **New contributors** ([contributors.md](https://github.com/kubernetes/minikube/blob/master/CONTRIBUTING.md)): Process for new contributors, CLA instructions * **Roadmap** ([roadmap.md](roadmap.md)): The roadmap for future minikube development ## New Features and Dependencies + * **Adding a dependency** ([adding_a_dependency.md](adding_a_dependency.md)): How to add or update vendored code * **Adding a new addon** ([adding_an_addon.md](adding_an_addon.md)): How to add a new addon to minikube for `minikube addons` @@ -12,6 +13,7 @@ * **Adding a new driver** ([adding_driver.md](adding_driver.md)): How to add a new driver to minikube for `minikube create --vm-driver=` ## Building and Releasing + * **Build Guide** ([build_guide.md](build_guide.md)): How to build minikube from source * **ISO Build Guide** ([minikube_iso.md](minikube_iso.md)): How to build and hack on the ISO image that minikube uses diff --git a/docs/contributors/adding_a_dependency.md b/docs/contributors/adding_a_dependency.md index d758b16d6c5f..39ce27240567 100644 --- a/docs/contributors/adding_a_dependency.md +++ b/docs/contributors/adding_a_dependency.md @@ -1,4 +1,5 @@ -#### Adding a New Dependency +# Adding a New Dependency + Minikube uses `dep` to manage vendored dependencies. See the `dep` [documentation](https://golang.github.io/dep/docs/introduction.html) for installation and usage instructions. diff --git a/docs/contributors/adding_an_addon.md b/docs/contributors/adding_an_addon.md index 0010e343248e..fff6bc005b66 100644 --- a/docs/contributors/adding_an_addon.md +++ b/docs/contributors/adding_an_addon.md @@ -1,4 +1,5 @@ -#### Adding a New Addon +# Adding a New Addon + To add a new addon to minikube the following steps are required: * For the new addon's .yaml file(s): @@ -15,12 +16,12 @@ To add a new addon to minikube the following steps are required: var settings = []Setting{ ..., // add other addon setting - { - name: "efk", - set: SetBool, - validations: []setFn{IsValidAddon}, - callbacks: []setFn{EnableOrDisableAddon}, - }, + { + name: "efk", + set: SetBool, + validations: []setFn{IsValidAddon}, + callbacks: []setFn{EnableOrDisableAddon}, + }, } ``` @@ -32,22 +33,22 @@ To add a new addon to minikube the following steps are required: ..., // add other addon asset "efk": NewAddon([]*BinDataAsset{ - NewBinDataAsset( - "deploy/addons/efk/efk-configmap.yaml", - constants.AddonsPath, - "efk-configmap.yaml", - "0640"), - NewBinDataAsset( - "deploy/addons/efk/efk-rc.yaml", - constants.AddonsPath, - "efk-rc.yaml", - "0640"), - NewBinDataAsset( - "deploy/addons/efk/efk-svc.yaml", - constants.AddonsPath, - "efk-svc.yaml", - "0640"), - }, false, "efk"), + NewBinDataAsset( + "deploy/addons/efk/efk-configmap.yaml", + constants.AddonsPath, + "efk-configmap.yaml", + "0640"), + NewBinDataAsset( + "deploy/addons/efk/efk-rc.yaml", + constants.AddonsPath, + "efk-rc.yaml", + "0640"), + NewBinDataAsset( + "deploy/addons/efk/efk-svc.yaml", + constants.AddonsPath, + "efk-svc.yaml", + "0640"), + }, false, "efk"), } ``` diff --git a/docs/contributors/adding_driver.md b/docs/contributors/adding_driver.md index b06318e708c9..3d9b0d5f6689 100644 --- a/docs/contributors/adding_driver.md +++ b/docs/contributors/adding_driver.md @@ -1,6 +1,6 @@ # Adding new driver (Deprecated) -New drivers should be added into https://github.com/machine-drivers +New drivers should be added into Minikube relies on docker machine drivers to manage machines. This document talks about how to add an existing docker machine driver into minikube registry, so that minikube can use the driver @@ -26,7 +26,7 @@ Registry is what minikube uses to register all the supported drivers. The driver their drivers in registry, and minikube runtime will look at the registry to find a driver and use the driver metadata to determine what workflow to apply while those drivers are being used. -The godoc of registry is available here: https://godoc.org/k8s.io/minikube/pkg/minikube/registry +The godoc of registry is available here: [DriverDef](https://godoc.org/k8s.io/minikube/pkg/minikube/registry#DriverDef) is the main struct to define a driver metadata. Essentially, you need to define 4 things at most, which is @@ -52,33 +52,33 @@ All drivers are located in `k8s.io/minikube/pkg/minikube/drivers`. Take `vmwaref package vmwarefusion import ( - "github.com/docker/machine/drivers/vmwarefusion" - "github.com/docker/machine/libmachine/drivers" - cfg "k8s.io/minikube/pkg/minikube/config" - "k8s.io/minikube/pkg/minikube/constants" - "k8s.io/minikube/pkg/minikube/registry" + "github.com/docker/machine/drivers/vmwarefusion" + "github.com/docker/machine/libmachine/drivers" + cfg "k8s.io/minikube/pkg/minikube/config" + "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/registry" ) func init() { - registry.Register(registry.DriverDef{ - Name: "vmwarefusion", - Builtin: true, - ConfigCreator: createVMwareFusionHost, - DriverCreator: func() drivers.Driver { - return vmwarefusion.NewDriver("", "") - }, - }) + registry.Register(registry.DriverDef{ + Name: "vmwarefusion", + Builtin: true, + ConfigCreator: createVMwareFusionHost, + DriverCreator: func() drivers.Driver { + return vmwarefusion.NewDriver("", "") + }, + }) } func createVMwareFusionHost(config cfg.MachineConfig) interface{} { - d := vmwarefusion.NewDriver(cfg.GetMachineName(), constants.GetMinipath()).(*vmwarefusion.Driver) - d.Boot2DockerURL = config.Downloader.GetISOFileURI(config.MinikubeISO) - d.Memory = config.Memory - d.CPU = config.CPUs - d.DiskSize = config.DiskSize - d.SSHPort = 22 - d.ISO = d.ResolveStorePath("boot2docker.iso") - return d + d := vmwarefusion.NewDriver(cfg.GetMachineName(), constants.GetMinipath()).(*vmwarefusion.Driver) + d.Boot2DockerURL = config.Downloader.GetISOFileURI(config.MinikubeISO) + d.Memory = config.Memory + d.CPU = config.CPUs + d.DiskSize = config.DiskSize + d.SSHPort = 22 + d.ISO = d.ResolveStorePath("boot2docker.iso") + return d } ``` @@ -98,4 +98,3 @@ In summary, the process includes the following steps: 2. Add import in `pkg/minikube/cluster/default_drivers.go` Any Questions: please ping your friend [@anfernee](https://github.com/anfernee) - diff --git a/docs/contributors/build_guide.md b/docs/contributors/build_guide.md index b80068358e9b..67a12be71a97 100644 --- a/docs/contributors/build_guide.md +++ b/docs/contributors/build_guide.md @@ -1,20 +1,23 @@ -### Build Requirements +# Build Guide + +## Build Requirements + * A recent Go distribution (>=1.12) * If you're not on Linux, you'll need a Docker installation * minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine -#### Prerequisites for different GNU/Linux distributions +### Prerequisites for different GNU/Linux distributions -##### Fedora -On Fedora you need to install _glibc-static_ +#### Fedora +On Fedora you need to install _glibc-static_ ```shell $ sudo dnf install -y glibc-static ``` ### Building from Source -Clone minikube into your go path under `$GOPATH/src/k8s.io` +Clone minikube into your go path under `$GOPATH/src/k8s.io` ```shell $ git clone https://github.com/kubernetes/minikube.git $GOPATH/src/k8s.io/minikube $ cd $GOPATH/src/k8s.io/minikube @@ -25,20 +28,23 @@ Note: Make sure that you uninstall any previous versions of minikube before buil from the source. ### Building from Source in Docker (using Debian stretch image with golang) + Clone minikube: ```shell $ git clone https://github.com/kubernetes/minikube.git ``` + Build (cross compile for linux / OS X and Windows) using make: ```shell $ cd minikube $ docker run --rm -v "$PWD":/go/src/k8s.io/minikube -w /go/src/k8s.io/minikube golang:stretch make cross ``` + Check "out" directory: ```shell $ ls out/ -docker-machine-driver-hyperkit.d minikube minikube.d test.d -docker-machine-driver-kvm2.d minikube-linux-amd64 storage-provisioner.d +docker-machine-driver-hyperkit.d minikube minikube.d test.d +docker-machine-driver-kvm2.d minikube-linux-amd64 storage-provisioner.d ``` ### Run Instructions @@ -77,11 +83,14 @@ You can run these against minikube by following these steps: * Run `make quick-release` in the k8s repo. * Start up a minikube cluster with: `minikube start`. * Set following two environment variables: + ```shell export KUBECONFIG=$HOME/.kube/config export KUBERNETES_CONFORMANCE_TEST=y ``` + * Run the tests (from the k8s repo): + ```shell go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]" --check-version-skew=false ``` diff --git a/docs/contributors/ci_builds.md b/docs/contributors/ci_builds.md index 0bfe2645b80a..07304aea7547 100644 --- a/docs/contributors/ci_builds.md +++ b/docs/contributors/ci_builds.md @@ -1,9 +1,11 @@ -### CI Builds +# CI Builds We publish CI builds of minikube, built at every Pull Request. Builds are available at (substitute in the relevant PR number): -- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-darwin-amd64 -- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-linux-amd64 -- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-windows-amd64.exe + +- +- +- We also publish CI builds of minikube-iso, built at every Pull Request that touches deploy/iso/minikube-iso. Builds are available at: -- https://storage.googleapis.com/minikube-builds/PR_NUMBER/minikube-testing.iso + +- diff --git a/docs/contributors/minikube_iso.md b/docs/contributors/minikube_iso.md index a4d2fc678240..6b4c1dd4038a 100644 --- a/docs/contributors/minikube_iso.md +++ b/docs/contributors/minikube_iso.md @@ -1,8 +1,9 @@ -## minikube ISO image +# minikube ISO image This includes the configuration for an alternative bootable ISO image meant to be used in conjunction with minikube. It includes: + - systemd as the init system - rkt - docker @@ -13,9 +14,10 @@ It includes: ### Requirements * Linux + ```shell sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \ - unzip bc gcc-multilib automake libtool locales + unzip bc gcc-multilib automake libtool locales ``` Either import your private key or generate a sign-only key using `gpg2 --gen-key`. @@ -69,7 +71,6 @@ $ git status ### Saving buildroot/kernel configuration changes - To make any kernel configuration changes and save them, execute: ```shell diff --git a/docs/contributors/principles.md b/docs/contributors/principles.md index 6a84b5a41fbb..f740678d6b78 100644 --- a/docs/contributors/principles.md +++ b/docs/contributors/principles.md @@ -22,5 +22,4 @@ Here are some specific minikube features that align with our goal: ## Non-Goals * Simplifying Kubernetes production deployment experience - * Supporting all possible deployment configurations of Kubernetes like various types of storage, networking, etc. - +* Supporting all possible deployment configurations of Kubernetes like various types of storage, networking, etc. diff --git a/docs/contributors/releasing_minikube.md b/docs/contributors/releasing_minikube.md index 3a1ab83c3956..c17fb388ef2d 100644 --- a/docs/contributors/releasing_minikube.md +++ b/docs/contributors/releasing_minikube.md @@ -7,16 +7,16 @@ ## Build a new ISO -Major releases always get a new ISO. Minor bugfixes may or may not require it: check for changes in the `deploy/iso` folder. +Major releases always get a new ISO. Minor bugfixes may or may not require it: check for changes in the `deploy/iso` folder. Note: you can build the ISO using the `hack/jenkins/build_iso.sh` script locally. - * navigate to the minikube ISO jenkins job - * Ensure that you are logged in (top right) - * Click "▶️ Build with Parameters" (left) - * For `ISO_VERSION`, type in the intended release version (same as the minikube binary's version) - * For `ISO_BUCKET`, type in `minikube/iso` - * Click *Build* +* navigate to the minikube ISO jenkins job +* Ensure that you are logged in (top right) +* Click "▶️ Build with Parameters" (left) +* For `ISO_VERSION`, type in the intended release version (same as the minikube binary's version) +* For `ISO_BUCKET`, type in `minikube/iso` +* Click *Build* The build will take roughly 50 minutes. @@ -47,7 +47,7 @@ env BUILD_IN_DOCKER=y make cross checksum Once submitted, HEAD will use the new ISO. Please pay attention to test failures, as this is our integration test across platforms. If there are known acceptable failures, please add a PR comment linking to the appropriate issue. -## Update Release Notes +## Update Release Notes Run the following script to update the release notes: @@ -59,11 +59,11 @@ Merge the output into CHANGELOG.md. See [PR#3175](https://github.com/kubernetes/ ## Tag the Release -NOTE: Confirm that all release-related PR's have been submitted before doing this step. +NOTE: Confirm that all release-related PR's have been submitted before doing this step. Do this in a direct clone of the upstream kubernetes/minikube repository (not your fork!): -``` +```shell version= git fetch git checkout master @@ -76,12 +76,12 @@ git push origin v$version This step uses the git tag to publish new binaries to GCS and create a github release: - * navigate to the minikube "Release" jenkins job - * Ensure that you are logged in (top right) - * Click "▶️ Build with Parameters" (left) - * `VERSION_MAJOR`, `VERSION_MINOR`, and `VERSION_BUILD` should reflect the values in your Makefile - * For `ISO_SHA256`, run: `gsutil cat gs://minikube/iso/minikube-v.iso.sha256` - * Click *Build* +* navigate to the minikube "Release" jenkins job +* Ensure that you are logged in (top right) +* Click "▶️ Build with Parameters" (left) +* `VERSION_MAJOR`, `VERSION_MINOR`, and `VERSION_BUILD` should reflect the values in your Makefile +* For `ISO_SHA256`, run: `gsutil cat gs://minikube/iso/minikube-v.iso.sha256` +* Click *Build* ## Check releases.json @@ -95,8 +95,8 @@ These are downstream packages that are being maintained by others and how to upg | Package Manager | URL | TODO | | --- | --- | --- | -| Arch Linux AUR | https://aur.archlinux.org/packages/minikube/ | "Flag as package out-of-date" -| Brew Cask | https://github.com/Homebrew/homebrew-cask/blob/master/Casks/minikube.rb | The release job creates a new PR in [Homebrew/homebrew-cask](https://github.com/Homebrew/homebrew-cask) with an updated version and SHA256, double check that it's created. +| Arch Linux AUR | | "Flag as package out-of-date" +| Brew Cask | | The release job creates a new PR in [Homebrew/homebrew-cask](https://github.com/Homebrew/homebrew-cask) with an updated version and SHA256, double check that it's created. ## Verification @@ -104,7 +104,7 @@ Verify release checksums by running`make check-release` ## Update docs -If there are major changes, please send a PR to update https://kubernetes.io/docs/setup/minikube/ +If there are major changes, please send a PR to update ## Announce! diff --git a/docs/debugging.md b/docs/debugging.md index 903cf8329f98..cb02133ffac8 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -1,5 +1,7 @@ -### Debugging Issues With Minikube +# Debugging Issues With Minikube + To debug issues with minikube (not *Kubernetes* but **minikube** itself), you can use the `-v` flag to see debug level info. The specified values for `-v` will do the following (the values are all encompassing in that higher values will give you all lower value outputs as well): + * `--v=0` will output **INFO** level logs * `--v=1` will output **WARNING** level logs * `--v=2` will output **ERROR** level logs @@ -11,6 +13,5 @@ Example: If you need to access additional tools for debugging, minikube also includes the [CoreOS toolbox](https://github.com/coreos/toolbox) - You can ssh into the toolbox and access these additional commands using: `minikube ssh toolbox` diff --git a/docs/drivers.md b/docs/drivers.md index 2f3590de1848..2d0bdd88d311 100644 --- a/docs/drivers.md +++ b/docs/drivers.md @@ -14,7 +14,7 @@ the host PATH: * [HyperV](#hyperv-driver) * [VMware](#vmware-unified-driver) -#### KVM2 driver +## KVM2 driver To install the KVM2 driver, first install and configure the prereqs: @@ -36,14 +36,14 @@ sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm sudo yum install libvirt-daemon-kvm qemu-kvm ``` -Enable,start, and verify the libvirtd service has started. +Enable,start, and verify the libvirtd service has started. + ```shell sudo systemctl enable libvirtd.service sudo systemctl start libvirtd.service sudo systemctl status libvirtd.service ``` - Then you will need to add yourself to libvirt group (older distributions may use libvirtd instead) `sudo usermod -a -G libvirt $(whoami)` @@ -59,8 +59,7 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine- && sudo install docker-machine-driver-kvm2 /usr/local/bin/ ``` - -NOTE: Ubuntu users on a release older than 18.04, or anyone experiencing [#3206: Error creating new host: dial tcp: missing address.](https://github.com/kubernetes/minikube/issues/3206) you will need to build your own driver until [#3689](https://github.com/kubernetes/minikube/issues/3689) is resolved. Building this binary will require [Go v1.11](https://golang.org/dl/) or newer to be installed. +NOTE: Ubuntu users on a release older than 18.04, or anyone experiencing [#3206: Error creating new host: dial tcp: missing address.](https://github.com/kubernetes/minikube/issues/3206) you will need to build your own driver until [#3689](https://github.com/kubernetes/minikube/issues/3689) is resolved. Building this binary will require [Go v1.11](https://golang.org/dl/) or newer to be installed. ```shell sudo apt install libvirt-dev @@ -90,18 +89,17 @@ and run minikube as usual: minikube start ``` -#### Hyperkit driver +## Hyperkit driver The Hyperkit driver will eventually replace the existing xhyve driver. It is built from the minikube source tree, and uses [moby/hyperkit](http://github.com/moby/hyperkit) as a Go library. To install the hyperkit driver via brew: - ```shell brew install docker-machine-driver-hyperkit -# docker-machine-driver-hyperkit need root owner and uid +# docker-machine-driver-hyperkit need root owner and uid sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit ``` @@ -139,7 +137,7 @@ and run minikube as usual: minikube start ``` -#### HyperV driver +## HyperV driver Hyper-v users may need to create a new external network switch as described [here](https://docs.docker.com/machine/drivers/hyper-v/). This step may prevent a problem in which `minikube start` hangs indefinitely, unable to ssh into the minikube virtual machine. In this add, add the `--hyperv-virtual-switch=switch-name` argument to the `minikube start` command. @@ -150,6 +148,7 @@ To use the driver: ```shell minikube start --vm-driver hyperv --hyperv-virtual-switch=switch-name ``` + or, to use hyperv as a default driver: ```shell @@ -162,12 +161,12 @@ and run minikube as usual: minikube start ``` -#### VMware unified driver +## VMware unified driver The VMware unified driver will eventually replace the existing vmwarefusion driver. The new unified driver supports both VMware Fusion (on macOS) and VMware Workstation (on Linux and Windows) -To install the vmware unified driver, head over at https://github.com/machine-drivers/docker-machine-driver-vmware/releases and download the release for your operating system. +To install the vmware unified driver, head over at and download the release for your operating system. The driver must be: @@ -201,4 +200,3 @@ and run minikube as usual: ```shell minikube start ``` - diff --git a/docs/env_vars.md b/docs/env_vars.md index 3afe898697b2..f531d4615e6e 100644 --- a/docs/env_vars.md +++ b/docs/env_vars.md @@ -3,7 +3,7 @@ ## Config option variables -minikube supports passing environment variables instead of flags for every value listed in `minikube config list`. This is done by passing an environment variable with the prefix `MINIKUBE_`. +minikube supports passing environment variables instead of flags for every value listed in `minikube config list`. This is done by passing an environment variable with the prefix `MINIKUBE_`. For example the `minikube start --iso-url="$ISO_URL"` flag can also be set by setting the `MINIKUBE_ISO_URL="$ISO_URL"` environment variable. @@ -46,7 +46,7 @@ MINIKUBE_ENABLE_PROFILING=1 minikube start Output: -``` +``` text 2017/01/09 13:18:00 profile: cpu profiling enabled, /tmp/profile933201292/cpu.pprof Starting local Kubernetes cluster... Kubectl is now configured to use the cluster. diff --git a/docs/gpu.md b/docs/gpu.md index ab3b00c2e69f..1d2faa2dd123 100644 --- a/docs/gpu.md +++ b/docs/gpu.md @@ -32,35 +32,38 @@ host to the minikube VM. Doing so has a few prerequisites: - Once you reboot the system after doing the above, you should be ready to use GPUs with kvm2. Run the following command to start minikube: - ``` + ```shell minikube start --vm-driver kvm2 --gpu ``` + This command will check if all the above conditions are satisfied and passthrough spare GPUs found on the host to the VM. If this succeeded, run the following commands: - ``` + ```shell minikube addons enable nvidia-gpu-device-plugin minikube addons enable nvidia-driver-installer ``` + This will install the NVIDIA driver (that works for GeForce/Quadro cards) on the VM. - If everything succeeded, you should be able to see `nvidia.com/gpu` in the capacity: - ``` + ```shell kubectl get nodes -ojson | jq .items[].status.capacity ``` ### Where can I learn more about GPU passthrough? + See the excellent documentation at -https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF + ### Why are so many manual steps required to use GPUs with kvm2 on minikube? + These steps require elevated privileges which minikube doesn't run with and they are disruptive to the host, so we decided to not do them automatically. - ## Using NVIDIA GPU on minikube on Linux with `--vm-driver=none` NOTE: This approach used to expose GPUs here is different than the approach used @@ -70,26 +73,28 @@ to expose GPUs with `--vm-driver=kvm2`. Please don't mix these instructions. - Install the nvidia driver, nvidia-docker and configure docker with nvidia as the default runtime. See instructions at - https://github.com/NVIDIA/nvidia-docker + - Start minikube: - ``` + ```shell minikube start --vm-driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost ``` - Install NVIDIA's device plugin: - ``` + ```shell kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v1.10/nvidia-device-plugin.yml ``` - ## Why does minikube not support NVIDIA GPUs on macOS? + VM drivers supported by minikube for macOS doesn't support GPU passthrough: + - [mist64/xhyve#108](https://github.com/mist64/xhyve/issues/108) - [moby/hyperkit#159](https://github.com/moby/hyperkit/issues/159) - [VirtualBox docs](http://www.virtualbox.org/manual/ch09.html#pcipassthrough) Also: + - For quite a while, all Mac hardware (both laptops and desktops) have come with Intel or AMD GPUs (and not with NVIDIA GPUs). Recently, Apple added [support for eGPUs](https://support.apple.com/en-us/HT208544), but even then all the @@ -98,8 +103,8 @@ Also: - nvidia-docker [doesn't support macOS](https://github.com/NVIDIA/nvidia-docker/issues/101) either. - ## Why does minikube not support NVIDIA GPUs on Windows? + minikube supports Windows host through Hyper-V or VirtualBox. - VirtualBox doesn't support PCI passthrough for [Windows diff --git a/docs/host_folder_mount.md b/docs/host_folder_mount.md index d19de3e827c3..92f454cbc1e2 100644 --- a/docs/host_folder_mount.md +++ b/docs/host_folder_mount.md @@ -1,5 +1,5 @@ +# Mounting Host Folders -## Mounting Host Folders `minikube mount /path/to/dir/to/mount:/vm-mount-path` is the recommended way to mount directories into minikube so that they can be used in your local Kubernetes cluster. The command works on all supported platforms. Below is an example workflow for using `minikube mount`: ```shell diff --git a/docs/http_proxy.md b/docs/http_proxy.md index cbd513916486..88e7a1a5589b 100644 --- a/docs/http_proxy.md +++ b/docs/http_proxy.md @@ -1,4 +1,4 @@ -## Using Minikube with an HTTP Proxy +# Using Minikube with an HTTP Proxy minikube requires access to the internet via HTTP, HTTPS, and DNS protocols. If a HTTP proxy is required to access the internet, you may need to pass the proxy connection information to both minikube and Docker using environment variables: @@ -17,7 +17,7 @@ One important note: If NO_PROXY is required by non-Kubernetes applications, such ### macOS and Linux -``` +```shell export HTTP_PROXY=http:// export HTTPS_PROXY=https:// export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.1/24 @@ -30,7 +30,7 @@ To make the exported variables permanent, consider adding the declarations to ~/ ### Windows -``` +```shell set HTTP_PROXY=http:// set HTTPS_PROXY=https:// set NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.1/24 @@ -45,7 +45,7 @@ To set these environment variables permanently, consider adding these to your [s ### unable to cache ISO... connection refused -``` +```text Unable to start VM: unable to cache ISO: https://storage.googleapis.com/minikube/iso/minikube.iso: failed to download: failed to download to temp file: download failed: 5 error(s) occurred: @@ -57,8 +57,8 @@ This error indicates that the host:port combination defined by HTTPS_PROXY or HT ## Unable to pull images..Client.Timeout exceeded while awaiting headers -``` -Unable to pull images, which may be OK: +```text +Unable to pull images, which may be OK: failed to pull image "k8s.gcr.io/kube-apiserver:v1.13.3": output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection @@ -69,7 +69,7 @@ This error indicates that the container runtime running within the VM does not h ## x509: certificate signed by unknown authority -``` +```text [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.13.3: output: Error response from daemon: Get https://k8s.gcr.io/v2/: x509: certificate signed by unknown authority @@ -83,7 +83,6 @@ Ask your IT department for the appropriate PEM file, and add it to: Then run `minikube delete` and `minikube start`. - ## Additional Information -- [Configure Docker to use a proxy server](https://docs.docker.com/network/proxy/) +* [Configure Docker to use a proxy server](https://docs.docker.com/network/proxy/) diff --git a/docs/insecure_registry.md b/docs/insecure_registry.md index 448ecdb4ecf5..fa02d603d322 100644 --- a/docs/insecure_registry.md +++ b/docs/insecure_registry.md @@ -1,4 +1,4 @@ -## Enabling Docker Insecure Registry +# Enabling Docker Insecure Registry Minikube allows users to configure the docker engine's `--insecure-registry` flag. You can use the `--insecure-registry` flag on the `minikube start` command to enable insecure communication between the docker engine and registries listening to requests from the CIDR range. @@ -8,7 +8,9 @@ with TLS certificates. Because the default service cluster IP is known to be ava deployed inside the cluster by creating the cluster with `minikube start --insecure-registry "10.0.0.0/24"`. ## Private Container Registries + **GCR/ECR/Docker**: Minikube has an addon, `registry-creds` which maps credentials into Minikube to support pulling from Google Container Registry (GCR), Amazon's EC2 Container Registry (ECR), and Private Docker registries. You will need to run `minikube addons configure registry-creds` and `minikube addons enable registry-creds` to get up and running. An example of this is below: + ```shell $ minikube addons configure registry-creds Do you want to enable AWS Elastic Container Registry? [y/n]: n diff --git a/docs/networking.md b/docs/networking.md index 5efff8bf5fc8..3e0bbef34692 100644 --- a/docs/networking.md +++ b/docs/networking.md @@ -1,4 +1,4 @@ -## Networking +# Networking The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command. Any services of type `NodePort` can be accessed over that IP address, on the NodePort. @@ -11,52 +11,52 @@ We also have a shortcut for fetching the minikube IP and a service's `NodePort`: `minikube service --url $SERVICE` -### LoadBalancer emulation (`minikube tunnel`) +## LoadBalancer emulation (`minikube tunnel`) -Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command. +Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command. ````shell minikube tunnel -```` +```` Will output: -``` +```text out/minikube tunnel Password: ***** -Status: +Status: machine: minikube pid: 59088 route: 10.96.0.0/12 -> 192.168.99.101 minikube: Running services: [] - errors: + errors: minikube: no errors router: no errors loadbalancer emulator: no errors -```` +```` Tunnel might ask you for password for creating and deleting network routes. - -# Cleaning up orphaned routes + +## Cleaning up orphaned routes If the `minikube tunnel` shuts down in an unclean way, it might leave a network route around. -This case the ~/.minikube/tunnels.json file will contain an entry for that tunnel. -To cleanup orphaned routes, run: -```` +This case the ~/.minikube/tunnels.json file will contain an entry for that tunnel. +To cleanup orphaned routes, run: + +````shell minikube tunnel --cleanup ```` -# (Advanced) Running tunnel as root to avoid entering password multiple times +## (Advanced) Running tunnel as root to avoid entering password multiple times -`minikube tunnel` runs as a separate daemon, creates a network route on the host to the service CIDR of the cluster using the cluster's IP address as a gateway. -Adding a route requires root privileges for the user, and thus there are differences in how to run `minikube tunnel` depending on the OS. +`minikube tunnel` runs as a separate daemon, creates a network route on the host to the service CIDR of the cluster using the cluster's IP address as a gateway. +Adding a route requires root privileges for the user, and thus there are differences in how to run `minikube tunnel` depending on the OS. -Recommended way to use on Linux with KVM2 driver and MacOSX with Hyperkit driver: +Recommended way to use on Linux with KVM2 driver and MacOSX with Hyperkit driver: `sudo -E minikube tunnel` -Using VirtualBox on Windows, Mac and Linux _both_ `minikube start` and `minikube tunnel` needs to be started from the same Administrator user session otherwise [VBoxManage can't recognize the created VM](https://forums.virtualbox.org/viewtopic.php?f=6&t=81551). - +Using VirtualBox on Windows, Mac and Linux _both_ `minikube start` and `minikube tunnel` needs to be started from the same Administrator user session otherwise [VBoxManage can't recognize the created VM](https://forums.virtualbox.org/viewtopic.php?f=6&t=81551). diff --git a/docs/openid_connect_auth.md b/docs/openid_connect_auth.md index 27345e0a61aa..aeb016c6a511 100644 --- a/docs/openid_connect_auth.md +++ b/docs/openid_connect_auth.md @@ -2,8 +2,7 @@ Minikube `kube-apiserver` can be configured to support OpenID Connect Authentication. -Read more about OpenID Connect Authentication for Kubernetes here: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#openid-connect-tokens - +Read more about OpenID Connect Authentication for Kubernetes here: ## Configuring the API Server @@ -21,7 +20,7 @@ minikube start \ ## Configuring kubectl -You can use the kubectl `oidc` authenticator to create a kubeconfig as shown in the Kubernetes docs: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#option-1-oidc-authenticator +You can use the kubectl `oidc` authenticator to create a kubeconfig as shown in the Kubernetes docs: `minikube start` already creates a kubeconfig that includes a `cluster`, in order to use it with your `oidc` authenticator kubeconfig, you can run: diff --git a/docs/persistent_volumes.md b/docs/persistent_volumes.md index ff811e7a5c73..0f734ee6169f 100644 --- a/docs/persistent_volumes.md +++ b/docs/persistent_volumes.md @@ -1,7 +1,8 @@ -## Persistent Volumes +# Persistent Volumes + Minikube supports [PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) of type `hostPath` out of the box. These PersistentVolumes are mapped to a directory inside the running Minikube instance (usually a VM, unless you use `--vm-driver=none`). For more information on how this works, read the Dynamic Provisioning section below. -### A note on mounts, persistence, and Minikube hosts +## A note on mounts, persistence, and Minikube hosts Minikube is configured to persist files stored under the following directories, which are made in the Minikube VM (or on your localhost if running on bare metal). You may lose data from other directories on reboots. diff --git a/docs/reusing_the_docker_daemon.md b/docs/reusing_the_docker_daemon.md index 1d39b02cf0f1..53aeb730353b 100644 --- a/docs/reusing_the_docker_daemon.md +++ b/docs/reusing_the_docker_daemon.md @@ -1,4 +1,4 @@ -### Reusing the Docker daemon +# Reusing the Docker daemon When using a single VM of Kubernetes it's really handy to reuse the Docker daemon inside the VM; as this means you don't have to build on your host machine and push the image into a docker registry - you can just build inside the same docker daemon as minikube which speeds up local experiments. @@ -7,7 +7,9 @@ To be able to work with the docker daemon on your mac/linux host use the docker- ```shell eval $(minikube docker-env) ``` + You should now be able to use docker on the command line on your host mac/linux machine talking to the docker daemon inside the minikube VM: + ```shell docker ps ``` diff --git a/docs/tunnel.md b/docs/tunnel.md index 30aae4c99308..ba83e7bf8201 100644 --- a/docs/tunnel.md +++ b/docs/tunnel.md @@ -57,7 +57,7 @@ and deleted via: sudo ip route delete 10.0.0.0/8 ``` -The routing table can be queried with `netstat -nr -f inet` +The routing table can be queried with `netstat -nr -f inet` ### OSX @@ -87,41 +87,41 @@ route ADD 10.0.0.0 MASK 255.0.0.0 and deleted via: ```shell -route DELETE 10.0.0.0 +route DELETE 10.0.0.0 ``` The routing table can be queried with `route print -4` -### Handling unclean shutdowns +### Handling unclean shutdowns + +Unclean shutdowns of the tunnel process can result in partially executed cleanup process, leaving network routes in the routing table. +We will keep track of the routes created by each tunnel in a centralized location in the main minikube config directory. +This list serves as a registry for tunnels containing information about -Unclean shutdowns of the tunnel process can result in partially executed cleanup process, leaving network routes in the routing table. -We will keep track of the routes created by each tunnel in a centralized location in the main minikube config directory. -This list serves as a registry for tunnels containing information about -- machine profile -- process ID +- machine profile +- process ID - and the route that was created -The cleanup command cleans the routes from both the routing table and the registry for tunnels that are not running: - -``` +The cleanup command cleans the routes from both the routing table and the registry for tunnels that are not running: + +```shell minikube tunnel --cleanup ``` -Updating the tunnel registry and the routing table is an atomic transaction: +Updating the tunnel registry and the routing table is an atomic transaction: -- create route in the routing table + create registry entry if both are successful, otherwise rollback -- delete route in the routing table + remove registry entry if both are successful, otherwise rollback +- create route in the routing table + create registry entry if both are successful, otherwise rollback +- delete route in the routing table + remove registry entry if both are successful, otherwise rollback -*Note*: because we don't support currently real multi cluster setup (due to overlapping CIDRs), the handling of running/not-running processes is not strictly required however it is forward looking. +*Note*: because we don't support currently real multi cluster setup (due to overlapping CIDRs), the handling of running/not-running processes is not strictly required however it is forward looking. -### Handling routing table conflicts +### Handling routing table conflicts -A routing table conflict happens when a destination CIDR of the route required by the tunnel overlaps with an existing route. -Minikube tunnel will warn the user if this happens and should not create the rule. +A routing table conflict happens when a destination CIDR of the route required by the tunnel overlaps with an existing route. +Minikube tunnel will warn the user if this happens and should not create the rule. There should not be any automated removal of conflicting routes. -*Note*: If the user removes the minikube config directory, this might leave conflicting rules in the network routing table that will have to be cleaned up manually. - +*Note*: If the user removes the minikube config directory, this might leave conflicting rules in the network routing table that will have to be cleaned up manually. ## Load Balancer Controller @@ -138,7 +138,7 @@ sleep Note that the Minikube ClusterIP can change over time (during system reboots) and this loop should also handle reconciliation of those changes. -## Handling multiple clusters +## Handling multiple clusters -Multiple clusters are currently not supported due to our inability to specify ServiceCIDR. +Multiple clusters are currently not supported due to our inability to specify ServiceCIDR. This causes conflicting routes having the same destination CIDR. diff --git a/docs/vmdriver-none.md b/docs/vmdriver-none.md index 5ea0bfa6e275..0aeec11374d4 100644 --- a/docs/vmdriver-none.md +++ b/docs/vmdriver-none.md @@ -14,7 +14,7 @@ The `none` driver supports releases of Debian, Ubuntu, and Fedora that are less Most continuous integration environments are already running inside a VM, and may not supported nested virtualization. The `none` driver was designed for this use case. Here is an example, that runs minikube from a non-root user, and ensures that the latest stable kubectl is installed: -``` +```shell curl -Lo minikube \ https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ && sudo install minikube /usr/local/bin/ From 203014d3d2dfc2f5a0307312bc840281b20d8a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 16 Feb 2019 14:45:30 +0100 Subject: [PATCH 13/26] Add target to build the kvm driver in docker --- Makefile | 20 ++++++++++++++++++-- installers/linux/kvm/Dockerfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 installers/linux/kvm/Dockerfile diff --git a/Makefile b/Makefile index 77bec70d4745..99c17d577381 100755 --- a/Makefile +++ b/Makefile @@ -30,6 +30,8 @@ HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.10.x # NOTE: "latest" as of 2018-12-04. kube-cross images aren't updated as often as Kubernetes BUILD_IMAGE ?= k8s.gcr.io/kube-cross:v1.11.1-1 ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image +KVM_BUILD_IMAGE ?= $(REGISTRY)/kvm-build-image + ISO_BUCKET ?= minikube/iso MINIKUBE_VERSION ?= $(ISO_VERSION) @@ -38,6 +40,8 @@ MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET} KERNEL_VERSION ?= 4.16.14 +GO_VERSION ?= $(shell go version | cut -d' ' -f3 | sed -e 's/go//') + GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) GOPATH ?= $(shell go env GOPATH) @@ -256,7 +260,7 @@ out/minikube-%-amd64.tar.gz: $$(TAR_TARGETS_$$*) $(TAR_TARGETS_ALL) tar -cvf $@ $^ .PHONY: cross-tars -cross-tars: out/minikube-windows-amd64.tar.gz out/minikube-linux-amd64.tar.gz out/minikube-darwin-amd64.tar.gz +cross-tars: kvm_in_docker out/minikube-windows-amd64.tar.gz out/minikube-linux-amd64.tar.gz out/minikube-darwin-amd64.tar.gz out/minikube-installer.exe: out/minikube-windows-amd64.exe rm -rf out/windows_tmp @@ -349,10 +353,22 @@ out/docker-machine-driver-kvm2: k8s.io/minikube/cmd/drivers/kvm chmod +X $@ +kvm-image: $(KVM_BUILD_IMAGE) # convenient alias to build the docker container +$(KVM_BUILD_IMAGE): installers/linux/kvm/Dockerfile + docker build --build-arg "GO_VERSION=$(GO_VERSION)" -t $@ -f $< $(dir $<) + @echo "" + @echo "$(@) successfully built" + +kvm_in_docker: + docker inspect $(KVM_BUILD_IMAGE) || $(MAKE) $(KVM_BUILD_IMAGE) + rm -f out/docker-machine-driver-kvm2 + docker run --rm -v $(PWD):/go/src/k8s.io/minikube $(KVM_BUILD_IMAGE) \ + /usr/bin/make -C /go/src/k8s.io/minikube out/docker-machine-driver-kvm2 + .PHONY: install-kvm install-kvm: out/docker-machine-driver-kvm2 cp out/docker-machine-driver-kvm2 $(GOBIN)/docker-machine-driver-kvm2 .PHONY: release-kvm-driver -release-kvm-driver: install-kvm +release-kvm-driver: kvm_in_docker install-kvm gsutil cp $(GOBIN)/docker-machine-driver-kvm2 gs://minikube/drivers/kvm/$(VERSION)/ diff --git a/installers/linux/kvm/Dockerfile b/installers/linux/kvm/Dockerfile new file mode 100644 index 000000000000..c138d9187672 --- /dev/null +++ b/installers/linux/kvm/Dockerfile @@ -0,0 +1,31 @@ +# Copyright 2019 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. + +FROM gcr.io/gcp-runtimes/ubuntu_16_0_4 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + curl \ + libvirt-dev \ + && rm -rf /var/lib/apt/lists/* + +ARG GO_VERSION + +RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xzf - + +ENV GOPATH /go +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/go/bin From 0422b9c567168ed161157df835d7b10eaa314e7c Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 13 Mar 2019 14:53:14 -0700 Subject: [PATCH 14/26] Add kube-proxy and dmesg logs + newlines between log sources --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 22 +++++++++++++++----- pkg/minikube/logs/logs.go | 10 ++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index f0cf0727396b..10da6f1f6c81 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -141,15 +141,27 @@ func (k *KubeadmBootstrapper) GetApiServerStatus(ip net.IP) (string, error) { // LogCommands returns a map of log type to a command which will display that log. func (k *KubeadmBootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string { - var kcmd strings.Builder - kcmd.WriteString("journalctl -u kubelet") + var kubelet strings.Builder + kubelet.WriteString("journalctl -u kubelet") if o.Lines > 0 { - kcmd.WriteString(fmt.Sprintf(" -n %d", o.Lines)) + kubelet.WriteString(fmt.Sprintf(" -n %d", o.Lines)) } if o.Follow { - kcmd.WriteString(" -f") + kubelet.WriteString(" -f") + } + + var dmesg strings.Builder + dmesg.WriteString("sudo dmesg -PH -L=never --level warn,err,crit,alert,emerg") + if o.Follow { + dmesg.WriteString(" --follow") + } + if o.Lines > 0 { + dmesg.WriteString(fmt.Sprintf(" | tail -n %d", o.Lines)) + } + return map[string]string{ + "kubelet": kubelet.String(), + "dmesg": dmesg.String(), } - return map[string]string{"kubelet": kcmd.String()} } func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error { diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index 4f833eaa439d..4ee76f0c997c 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -40,6 +40,7 @@ var importantPods = []string{ "kube-apiserver", "coredns", "kube-scheduler", + "kube-proxy", } // lookbackwardsCount is how far back to look in a log for problems. This should be large enough to @@ -105,6 +106,10 @@ func OutputProblems(problems map[string][]string, maxLines int) { // Output displays logs from multiple sources in tail(1) format func Output(r cruntime.Manager, bs bootstrapper.Bootstrapper, runner bootstrapper.CommandRunner, lines int) error { cmds := logCommands(r, bs, lines, false) + + // These are not technically logs, but are useful to have in bug reports. + cmds["kernel"] = "uptime && uname -a" + names := []string{} for k := range cmds { names = append(names, k) @@ -112,7 +117,10 @@ func Output(r cruntime.Manager, bs bootstrapper.Bootstrapper, runner bootstrappe sort.Strings(names) failed := []string{} - for _, name := range names { + for i, name := range names { + if i > 0 { + console.OutLn("") + } console.OutLn("==> %s <==", name) var b bytes.Buffer err := runner.CombinedOutputTo(cmds[name], &b) From fcd5d996b30d844d864ef56ba3ee0ef799085ad4 Mon Sep 17 00:00:00 2001 From: Dmitry Budaev Date: Thu, 14 Mar 2019 14:55:24 +0100 Subject: [PATCH 15/26] Update Ingress-NGINX to 0.23 Release Updates Ingress-Nginx to use 0.23 release. --- deploy/addons/ingress/ingress-dp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/addons/ingress/ingress-dp.yaml b/deploy/addons/ingress/ingress-dp.yaml index 7d0c885a79cf..f7b70f0b4aaf 100644 --- a/deploy/addons/ingress/ingress-dp.yaml +++ b/deploy/addons/ingress/ingress-dp.yaml @@ -87,7 +87,7 @@ spec: serviceAccountName: nginx-ingress terminationGracePeriodSeconds: 60 containers: - - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.21.0 + - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.23.0 name: nginx-ingress-controller imagePullPolicy: IfNotPresent readinessProbe: From a94e0ac2f87c30607d5acfdf30eb8a085207b9ec Mon Sep 17 00:00:00 2001 From: Steven Davidovitz Date: Thu, 14 Mar 2019 09:05:51 -0700 Subject: [PATCH 16/26] fix CHANGE_MINIKUBE_NONE_USER regression from recent changes 6c480485386d546bbb714517e2061298c5e30485 changed the order of the startup script so that now the CHANGE_MINIKUBE_NONE_USER `chown` doesn't actually kick in after the files are added. --- cmd/minikube/cmd/start.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 0cd95e48bd04..0da4533edcc4 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -208,6 +208,11 @@ func runStart(cmd *cobra.Command, args []string) { console.Failure("Unable to load cached images from config file.") } + if config.MachineConfig.VMDriver == constants.DriverNone { + console.OutStyle("starting-none", "Configuring local host environment ...") + prepareNone() + } + if kubeconfig.KeepContext { console.OutStyle("kubectl", "To connect to this cluster, use: kubectl --context=%s", kubeconfig.ClusterName) } else { @@ -342,10 +347,6 @@ func startHost(api libmachine.API, mc cfg.MachineConfig) (*host.Host, bool) { if err != nil { exit.WithError("Failed to check if machine exists", err) } - if mc.VMDriver == constants.DriverNone { - console.OutStyle("starting-none", "Configuring local host environment ...") - prepareNone() - } var host *host.Host start := func() (err error) { From b0b32b702d86bbcfb1dd7d5a8ac17d3121660088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 17 Mar 2019 12:17:19 +0100 Subject: [PATCH 17/26] Allow building minikube for any architecture Currently it is hardcoded to build for any GOOS, but same GOARCH. Change this to allow building for any combination of: minikube-*-* --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 77bec70d4745..842d88d981d0 100755 --- a/Makefile +++ b/Makefile @@ -99,7 +99,7 @@ out/minikube.d: pkg/minikube/assets/assets.go $(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $^ $(MINIKUBEFILES) > $@ -include out/minikube.d -out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go +out/minikube-%: pkg/minikube/assets/assets.go ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@) else @@ -114,7 +114,7 @@ ifneq ($(GOPATH)/src/$(REPOPATH),$(CURDIR)) $(warning https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md) $(warning ******************************************************************************) endif - GOOS=$* GOARCH=$(GOARCH) go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube + GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube endif .PHONY: e2e-%-amd64 From d91615ef464ba2a0469e77983e4fd668f5b0c8a7 Mon Sep 17 00:00:00 2001 From: Igor Akkerman Date: Sun, 17 Mar 2019 18:39:40 +0100 Subject: [PATCH 18/26] Windows installer using installation path for x64 applications --- installers/windows/minikube.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/windows/minikube.nsi b/installers/windows/minikube.nsi index 404b86492206..3c0f412e4590 100644 --- a/installers/windows/minikube.nsi +++ b/installers/windows/minikube.nsi @@ -25,7 +25,7 @@ RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) -InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}" +InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" !define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" BrandingText " " From 8f7cca3045c9acf4ee64e0705f9290eff4eca824 Mon Sep 17 00:00:00 2001 From: Guang Ya Liu Date: Mon, 18 Mar 2019 02:18:09 -0700 Subject: [PATCH 19/26] Highlight libvirtd for old distributions. --- docs/drivers.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/drivers.md b/docs/drivers.md index 2f3590de1848..d89e960c2db4 100644 --- a/docs/drivers.md +++ b/docs/drivers.md @@ -36,7 +36,7 @@ sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm sudo yum install libvirt-daemon-kvm qemu-kvm ``` -Enable,start, and verify the libvirtd service has started. +Enable,start, and verify the `libvirtd` service has started. ```shell sudo systemctl enable libvirtd.service sudo systemctl start libvirtd.service @@ -44,13 +44,17 @@ sudo systemctl status libvirtd.service ``` -Then you will need to add yourself to libvirt group (older distributions may use libvirtd instead) +Then you will need to add yourself to `libvirt` group (older distributions may use `libvirtd` instead) -`sudo usermod -a -G libvirt $(whoami)` +```shell +sudo usermod -a -G libvirt $(whoami) +``` Then to join the group with your current user session: -`newgrp libvirt` +```shell +newgrp libvirt +``` Now install the driver: From 443accf1e04d3b2ecb5a6d693f0d6983127f9394 Mon Sep 17 00:00:00 2001 From: Marco Vito Moscaritolo Date: Tue, 19 Mar 2019 08:53:11 +0100 Subject: [PATCH 20/26] Update link to drive docs in xhyve driver Signed-off-by: Marco Vito Moscaritolo --- pkg/minikube/drivers/xhyve/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/drivers/xhyve/driver.go b/pkg/minikube/drivers/xhyve/driver.go index 0e16ae8c9d35..2504843a854f 100644 --- a/pkg/minikube/drivers/xhyve/driver.go +++ b/pkg/minikube/drivers/xhyve/driver.go @@ -30,7 +30,7 @@ import ( const errMsg = ` The Xhyve driver is not included in minikube yet. Please follow the directions at -https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#xhyve-driver +https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#xhyve-driver ` func init() { From bf794665e9c7fb5be2f85f686cb559514b304987 Mon Sep 17 00:00:00 2001 From: morvencao Date: Wed, 20 Mar 2019 12:40:16 +0800 Subject: [PATCH 21/26] fix gopath issue for driver installation. --- docs/drivers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/drivers.md b/docs/drivers.md index 2f3590de1848..9963574f2bff 100644 --- a/docs/drivers.md +++ b/docs/drivers.md @@ -64,9 +64,9 @@ NOTE: Ubuntu users on a release older than 18.04, or anyone experiencing [#3206: ```shell sudo apt install libvirt-dev -test -d $HOME/go/src/k8s.io/minikube || \ - git clone https://github.com/kubernetes/minikube.git $HOME/go/src/k8s.io/minikube -cd $HOME/go/src/k8s.io/minikube +test -d $GOPATH/src/k8s.io/minikube || \ + git clone https://github.com/kubernetes/minikube.git $GOPATH/src/k8s.io/minikube +cd $GOPATH/src/k8s.io/minikube git pull make out/docker-machine-driver-kvm2 sudo install out/docker-machine-driver-kvm2 /usr/local/bin From 0c1b51ced3ebb9a8dc40716b8c20ee46c3b1d60a Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 10:07:25 -0700 Subject: [PATCH 22/26] Use --kubeconfig for v1.10.x, instead of skipping the pull --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index be970d1286e3..425cb64fe6f0 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -318,11 +318,13 @@ func (k *KubeadmBootstrapper) PullImages(k8s config.KubernetesConfig) error { if err != nil { return errors.Wrap(err, "parsing kubernetes version") } + + cFlag := "config" if version.LT(semver.MustParse("1.11.0")) { - return fmt.Errorf("pull command is not supported by kubeadm v%s", version) + cFlag := "kubeconfig" } - cmd := fmt.Sprintf("sudo kubeadm config images pull --config %s", constants.KubeadmConfigFile) + cmd := fmt.Sprintf("sudo kubeadm config images pull --%s %s", cFlag, constants.KubeadmConfigFile) if err := k.c.Run(cmd); err != nil { return errors.Wrapf(err, "running cmd: %s", cmd) } From 7eeb0a792527f3c20427285697edfe62d97c737e Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 16:40:12 -0700 Subject: [PATCH 23/26] Revert "Use --kubeconfig for v1.10.x, instead of skipping the pull" This reverts commit 0c1b51ced3ebb9a8dc40716b8c20ee46c3b1d60a. --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index e27f58757ee8..cd7afeb4ec4f 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -318,13 +318,11 @@ func (k *KubeadmBootstrapper) PullImages(k8s config.KubernetesConfig) error { if err != nil { return errors.Wrap(err, "parsing kubernetes version") } - - cFlag := "config" if version.LT(semver.MustParse("1.11.0")) { - cFlag := "kubeconfig" + return fmt.Errorf("pull command is not supported by kubeadm v%s", version) } - cmd := fmt.Sprintf("sudo kubeadm config images pull --%s %s", cFlag, constants.KubeadmConfigFile) + cmd := fmt.Sprintf("sudo kubeadm config images pull --config %s", constants.KubeadmConfigFile) if err := k.c.Run(cmd); err != nil { return errors.Wrapf(err, "running cmd: %s", cmd) } From 88091b23231e4ffa7e4a0a90fe7f429fc2b2ed1c Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 16:45:39 -0700 Subject: [PATCH 24/26] Fix DefaultLegacyAdmissionControllers comment --- pkg/util/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/constants.go b/pkg/util/constants.go index ee089e295788..3c9d8fe4b1ae 100644 --- a/pkg/util/constants.go +++ b/pkg/util/constants.go @@ -45,7 +45,7 @@ var DefaultV114AdmissionControllers = []string{ "ResourceQuota", } -// DefaultLegacyAdmissionControllers are admission controllers we default to in order Kubernetes releases +// DefaultLegacyAdmissionControllers are admission controllers we include with Kubernetes <1.14.0 var DefaultLegacyAdmissionControllers = append(DefaultV114AdmissionControllers, "Initializers") // GetServiceClusterIP returns the first IP of the ServiceCIDR From 605088ff72fa48d834764b4a001dd8de2f2ecf49 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 17:23:07 -0700 Subject: [PATCH 25/26] Keep Initializers as the first element, fix v1.14 test which still included Initializers --- pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go | 2 +- pkg/util/constants.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go index f4fd70862ed0..351a6ad4b68a 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go @@ -145,7 +145,7 @@ apiVersion: kubeadm.k8s.io/v1beta1 kind: ClusterConfiguration apiServer: extraArgs: - enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"fail-no-swap: "true" + enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"fail-no-swap: "true" controllerManager: extraArgs: kube-api-burst: "32" diff --git a/pkg/util/constants.go b/pkg/util/constants.go index 3c9d8fe4b1ae..9649b5877f0e 100644 --- a/pkg/util/constants.go +++ b/pkg/util/constants.go @@ -46,7 +46,7 @@ var DefaultV114AdmissionControllers = []string{ } // DefaultLegacyAdmissionControllers are admission controllers we include with Kubernetes <1.14.0 -var DefaultLegacyAdmissionControllers = append(DefaultV114AdmissionControllers, "Initializers") +var DefaultLegacyAdmissionControllers = append([]string{"Initializers"}, DefaultV114AdmissionControllers...) // GetServiceClusterIP returns the first IP of the ServiceCIDR func GetServiceClusterIP(serviceCIDR string) (net.IP, error) { From 2b3ad6e1793ada594cfe0af209bb34947725cee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Str=C3=B6mberg?= Date: Wed, 20 Mar 2019 19:36:06 -0700 Subject: [PATCH 26/26] Mention integration env overrides --- docs/contributors/build_guide.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/contributors/build_guide.md b/docs/contributors/build_guide.md index 67a12be71a97..171a6961ca1a 100644 --- a/docs/contributors/build_guide.md +++ b/docs/contributors/build_guide.md @@ -55,7 +55,7 @@ Start the cluster using your built minikube with: $ ./out/minikube start ``` -### Running Tests +## Running Tests #### Unit Tests @@ -65,7 +65,7 @@ Unit tests are run on Travis before code is merged. To run as part of a developm make test ``` -#### Integration Tests +### Integration Tests Integration tests are currently run manually. To run them, build the binary and run the tests: @@ -74,7 +74,13 @@ To run them, build the binary and run the tests: make integration ``` -#### Conformance Tests +You may find it useful to set various options to test only a particular test against a non-default driver. For instance: + +```shell + env TEST_ARGS="-minikube-start-args=--vm-driver=hyperkit -test.run TestStartStop" make integration + ``` + +### Conformance Tests These are Kubernetes tests that run against an arbitrary cluster and exercise a wide range of Kubernetes features. You can run these against minikube by following these steps: