diff --git a/.gitignore b/.gitignore index 811be834c3..35e907bf71 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,9 @@ deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION /.vscode test/integration/testdata/minikube-linux-amd64-latest-stable + +# hugo +/public +/site/resources +/_gen + diff --git a/.travis.yml b/.travis.yml index 0f82068494..cd5ca58f96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: go os: linux +env: + - GOPROXY=https://proxy.golang.org matrix: include: - go: 1.12.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd81b160a..8c3d1a26d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Release Notes +## Version 1.3.1 - 2019-08-13 + +* Update code references to point to new documentation site [#5052](https://github.com/kubernetes/minikube/pull/5052) +* Localization support for help text [#4814](https://github.com/kubernetes/minikube/pull/4814) +* Fix progress bar on Windows + git bash [#5025](https://github.com/kubernetes/minikube/pull/5025) +* Restore --disable-driver-mounts flag [#5026](https://github.com/kubernetes/minikube/pull/5026) +* Fixed the template for dashboard output [#5004](https://github.com/kubernetes/minikube/pull/5004) +* Use a temp dest to atomically download the iso [#5000](https://github.com/kubernetes/minikube/pull/5000) + +Thank you to our merry band of contributors for assembling this last minute bug fix release. + +- Jituri, Pranav +- Medya Ghazizadeh +- Pranav Jituri +- Ramiro Berrelleza +- Sharif Elgamal +- Thomas Strömberg +- josedonizetti + ## Version 1.3.0 - 2019-08-05 * Added a new command: profile list [#4811](https://github.com/kubernetes/minikube/pull/4811) @@ -1133,7 +1152,7 @@ Huge Thank You for this release to our contributors: * 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). +* Generated documentation for all commands. Documentation [is here](https://minikube.sigs.k8s.io/docs/). ## Version 0.2.0 - 6/3/2016 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f02d796e97..098533a91c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,21 +1 @@ -# Contributing guidelines - -## Filing issues - -File issues using the standard Github issue tracker for the repo. - -## How to become a contributor and submit your own code - -### Contributor License Agreements - -We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. - -[Please fill out either the individual or corporate Contributor License Agreement (CLA)](http://git.k8s.io/community/CLA.md) - -### Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Submit a pull request. +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/guide/ diff --git a/MAINTAINERS b/MAINTAINERS deleted file mode 100644 index 82d4387262..0000000000 --- a/MAINTAINERS +++ /dev/null @@ -1,4 +0,0 @@ -Thomas Stromberg (@tstromberg) -Anders F Björklund (@afbjorklund) -Sharif Elgamal (@sharifelgamal) -Medya Ghazizadeh (@medyagh) diff --git a/Makefile b/Makefile index 4373a61812..22b3a0b073 100755 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ # Bump these on release - and please check ISO_VERSION for correctness. VERSION_MAJOR ?= 1 VERSION_MINOR ?= 3 -VERSION_BUILD ?= 0 +VERSION_BUILD ?= 1 # Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).0 @@ -375,7 +375,7 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe mv out/windows_tmp/minikube-installer.exe out/minikube-installer.exe rm -rf out/windows_tmp -out/docker-machine-driver-hyperkit: pkg/minikube/translate/translations.go +out/docker-machine-driver-hyperkit: ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make $@) else @@ -441,18 +441,18 @@ release-minikube: out/minikube checksum gsutil cp out/minikube-$(GOOS)-$(GOARCH) $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH) gsutil cp out/minikube-$(GOOS)-$(GOARCH).sha256 $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH).sha256 -out/docker-machine-driver-kvm2: pkg/minikube/translate/translations.go +out/docker-machine-driver-kvm2: ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) docker inspect -f '{{.Id}} {{.RepoTags}}' $(KVM_BUILD_IMAGE) || $(MAKE) kvm-image $(call DOCKER,$(KVM_BUILD_IMAGE),/usr/bin/make $@ COMMIT=$(COMMIT)) # make extra sure that we are linking with the older version of libvirt (1.3.1) test "`strings $@ | grep '^LIBVIRT_[0-9]' | sort | tail -n 1`" = "LIBVIRT_1.2.9" else - go build \ - -installsuffix "static" \ - -ldflags="$(KVM2_LDFLAGS)" \ - -tags "libvirt.1.3.1 without_lxc" \ - -o $(BUILD_DIR)/docker-machine-driver-kvm2 \ + go build \ + -installsuffix "static" \ + -ldflags="$(KVM2_LDFLAGS)" \ + -tags "libvirt.1.3.1 without_lxc" \ + -o $(BUILD_DIR)/docker-machine-driver-kvm2 \ k8s.io/minikube/cmd/drivers/kvm endif chmod +X $@ @@ -493,3 +493,21 @@ install-kvm-driver: out/docker-machine-driver-kvm2 release-kvm-driver: install-kvm-driver checksum gsutil cp $(GOBIN)/docker-machine-driver-kvm2 gs://minikube/drivers/kvm/$(VERSION)/ gsutil cp $(GOBIN)/docker-machine-driver-kvm2.sha256 gs://minikube/drivers/kvm/$(VERSION)/ + +site/themes/docsy/assets/vendor/bootstrap/package.js: + git submodule update -f --init --recursive + +# hugo for generating site previews +out/hugo/hugo: + mkdir -p out + test -d out/hugo || git clone https://github.com/gohugoio/hugo.git out/hugo + (cd out/hugo && go build --tags extended) + +# Serve the documentation site to localhost +.PHONY: site +site: site/themes/docsy/assets/vendor/bootstrap/package.js out/hugo/hugo + (cd site && ../out/hugo/hugo serve \ + --disableFastRender \ + --navigateToChanged \ + --ignoreCache \ + --buildFuture) diff --git a/README.md b/README.md index 9f259f2ada..18a62fb473 100644 --- a/README.md +++ b/README.md @@ -9,53 +9,47 @@ [GoReport Status]: https://goreportcard.com/report/github.com/kubernetes/minikube [GoReport Widget]: https://goreportcard.com/badge/github.com/kubernetes/minikube - +minikube logo -## What is minikube? +minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. minikube's [primary goals](https://minikube.sigs.k8s.io/docs/concepts/principles/) are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit. -minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. - -![screenshot](/images/start.jpg) - -minikube's [primary goals](https://github.com/kubernetes/minikube/blob/master/docs/contributors/principles.md) are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit. We hope you enjoy it! - -## News - -:mega: **Please fill out our [fast 5-question survey](https://forms.gle/Gg3hG5ZySw8c1C24A)** so that we can learn how & why you use minikube, and what improvements we should make. Thank you! :dancers: - -* 2019-08-05 - v1.3.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.3.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-130---2019-08-05)] +screenshot ## Features minikube runs the latest 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://minikube.sigs.k8s.io/docs/tasks/loadbalancer/) - 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) +* [Persistent Volumes](https://minikube.sigs.k8s.io/docs/reference/persistent_volumes/) * Ingress -* RBAC -* [Dashboard](https://github.com/kubernetes/minikube/blob/master/docs/dashboard.md) - `minikube dashboard` -* [Container runtimes](https://github.com/kubernetes/minikube/blob/master/docs/alternative_runtimes.md) - `start --container-runtime` -* [Configure apiserver and kubelet options](https://github.com/kubernetes/minikube/blob/master/docs/configuring_kubernetes.md) via command-line flags +* [Dashboard](https://minikube.sigs.k8s.io/docs/tasks/dashboard/) - `minikube dashboard` +* [Container runtimes](https://minikube.sigs.k8s.io/docs/reference/runtimes/) - `start --container-runtime` +* [Configure apiserver and kubelet options](https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/) via command-line flags As well as developer-friendly features: -* [Addons](https://github.com/kubernetes/minikube/blob/master/docs/addons.md) - a marketplace for developers to share configurations for running services on minikube -* [GPU support](https://github.com/kubernetes/minikube/blob/master/docs/gpu.md) - for machine learning -* [Filesystem mounts](https://github.com/kubernetes/minikube/blob/master/docs/host_folder_mount.md) -* Automatic failure analysis +* [Addons](https://minikube.sigs.k8s.io/docs/tasks/addons/) - a marketplace for developers to share configurations for running services on minikube +* [NVIDIA GPU support](https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/) - for machine learning +* [Filesystem mounts](https://minikube.sigs.k8s.io/docs/tasks/mount/) + +**For more information, see the official [minikube website](https://minikube.sigs.k8s.io)** + +## Installation + +Installation methods can be found in the [Getting Started Guide](https://minikube.sigs.k8s.io/docs/start/) ## Documentation -* [**Installation**](https://kubernetes.io/docs/tasks/tools/install-minikube/) -* [Advanced Topics and Tutorials](https://github.com/kubernetes/minikube/blob/master/docs/README.md) -* [Contributors Guide](https://github.com/kubernetes/minikube/blob/master/docs/contributors/README.md) +See https://minikube.sigs.k8s.io/docs/ + +## More Examples + +See our [examples page](https://minikube.sigs.k8s.io/docs/examples/) ## Community -![Help Wanted!](/images/help_wanted.jpg) - 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! @@ -63,74 +57,6 @@ minikube is a Kubernetes [#sig-cluster-lifecycle](https://github.com/kubernetes/ * [minikube-dev mailing list](https://groups.google.com/forum/#!forum/minikube-dev) * [Bi-weekly office hours, Mondays @ 10am PST](https://tinyurl.com/minikube-oh) -* [Contributing](https://github.com/kubernetes/minikube/blob/master/CONTRIBUTING.md) -* [Development Roadmap](https://github.com/kubernetes/minikube/blob/master/docs/contributors/roadmap.md) +* [Contributing](https://minikube.sigs.k8s.io/docs/contributing/) +* [Development Roadmap](https://minikube.sigs.k8s.io/docs/contributing/roadmap/) -## Installation - -See the [installation guide](https://kubernetes.io/docs/tasks/tools/install-minikube/). For the impatient, here is the TL;DR: - -* *macOS 10.12 (Sierra)* - * Requires installing a hypervisor, such as [hyperkit](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver) (recommended) or VirtualBox - * using [brew](https://brew.sh/): `brew cask install minikube` - * manually: `curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 && sudo install minikube-darwin-amd64 /usr/local/bin/minikube` - -* *Windows 10* - * Requires a hypervisor, such as VirtualBox (recommended) or HyperV - * VT-x/AMD-v virtualization must be enabled in BIOS - * 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* - * 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` - -### Supported Hypervisors - -`minikube start` defaults to virtualbox, but supports other drivers using the `--vm-driver` argument: - -* [KVM2](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver) - Recommended Linux driver -* [hyperkit](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver) - Recommended macOS driver -* virtualbox - Recommended Windows driver -* [none](https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md) - bare-metal execution on Linux, at the expense of system security and reliability - -Other drivers which are not yet part of our continuous integration system are: - -* [hyperv](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperV-driver) -* [vmware](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver) -* [parallels](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#parallels-driver) - -## Quick Start - -Start a cluster by running: - -`minikube start` - -Access Kubernetes Dashboard within Minikube: - -`minikube dashboard` - -Once started, you can interact with your cluster using `kubectl`, just like any other Kubernetes cluster. For instance, starting a server: - -`kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080` - -Exposing a service as a NodePort - -`kubectl expose deployment hello-minikube --type=NodePort` - -minikube makes it easy to open this exposed endpoint in your browser: - -`minikube service hello-minikube` - -Start a second local cluster: - -`minikube start -p cluster2` - -Stop your local cluster: - -`minikube stop` - -Delete your local cluster: - -`minikube delete` diff --git a/cmd/minikube/cmd/config/profile.go b/cmd/minikube/cmd/config/profile.go index c15be55847..6edd4cbe23 100644 --- a/cmd/minikube/cmd/config/profile.go +++ b/cmd/minikube/cmd/config/profile.go @@ -24,8 +24,8 @@ import ( pkgConfig "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/out" - pkgutil "k8s.io/minikube/pkg/util" ) // ProfileCmd represents the profile command @@ -48,6 +48,15 @@ var ProfileCmd = &cobra.Command{ if profile == "default" { profile = "minikube" } + + if !pkgConfig.ProfileExists(profile) { + err := pkgConfig.CreateEmptyProfile(profile) + if err != nil { + exit.WithError("Creating a new profile failed", err) + } + out.SuccessT("Created a new profile : {{.profile_name}}", out.V{"profile_name": profile}) + } + err := Set(pkgConfig.MachineProfile, profile) if err != nil { exit.WithError("Setting profile failed", err) @@ -62,7 +71,7 @@ var ProfileCmd = &cobra.Command{ out.SuccessT("Skipped switching kubectl context for {{.profile_name}} , because --keep-context", out.V{"profile_name": profile}) out.SuccessT("To connect to this cluster, use: kubectl --context={{.profile_name}}", out.V{"profile_name": profile}) } else { - err := pkgutil.SetCurrentContext(constants.KubeconfigPath, profile) + err := kubeconfig.SetCurrentContext(constants.KubeconfigPath, profile) if err != nil { out.ErrT(out.Sad, `Error while setting kubectl current context : {{.error}}`, out.V{"error": err}) } diff --git a/cmd/minikube/cmd/config/profile_list.go b/cmd/minikube/cmd/config/profile_list.go index 4498e6d33c..b6aa8b91e7 100644 --- a/cmd/minikube/cmd/config/profile_list.go +++ b/cmd/minikube/cmd/config/profile_list.go @@ -45,7 +45,7 @@ var profileListCmd = &cobra.Command{ validProfiles, invalidProfiles, err := config.ListProfiles() if len(validProfiles) == 0 || err != nil { - exit.UsageT("No minikube profile was found. you could create one using: `minikube start`") + exit.UsageT("No minikube profile was found. You can create one using `minikube start`.") } for _, p := range validProfiles { validData = append(validData, []string{p.Name, p.Config.MachineConfig.VMDriver, p.Config.KubernetesConfig.NodeIP, strconv.Itoa(p.Config.KubernetesConfig.NodePort), p.Config.KubernetesConfig.KubernetesVersion}) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index 1090b560fa..4db1b7d73f 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -129,7 +129,7 @@ var dashboardCmd = &cobra.Command{ if dashboardURLMode { out.Ln(url) } else { - out.ErrT(out.Celebrate, "Opening {{.url}} in your default browser...", out.V{"url": url}) + out.T(out.Celebrate, "Opening {{.url}} in your default browser...", out.V{"url": url}) if err = browser.OpenURL(url); err != nil { exit.WithCodeT(exit.Software, "failed to open browser: {{.error}}", out.V{"error": err}) } diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index d94a6c3a3b..3921c5dfb8 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -17,22 +17,27 @@ limitations under the License. package cmd import ( + "fmt" + "io/ioutil" "os" + "path/filepath" + "strconv" "github.com/docker/machine/libmachine" "github.com/docker/machine/libmachine/mcnerror" + "github.com/golang/glog" + ps "github.com/mitchellh/go-ps" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config" - cmdUtil "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/cluster" pkg_config "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" - pkgutil "k8s.io/minikube/pkg/util" ) // deleteCmd represents the delete command @@ -75,11 +80,11 @@ func runDelete(cmd *cobra.Command, args []string) { } } - if err := cmdUtil.KillMountProcess(); err != nil { + if err := killMountProcess(); err != nil { out.FatalT("Failed to kill mount process: {{.error}}", out.V{"error": err}) } - if err := os.RemoveAll(constants.GetProfilePath(viper.GetString(pkg_config.MachineProfile))); err != nil { + if err := pkg_config.DeleteProfile(viper.GetString(pkg_config.MachineProfile)); err != nil { if os.IsNotExist(err) { out.T(out.Meh, `"{{.profile_name}}" profile does not exist`, out.V{"profile_name": profile}) os.Exit(0) @@ -89,7 +94,7 @@ func runDelete(cmd *cobra.Command, args []string) { out.T(out.Crushed, `The "{{.cluster_name}}" cluster has been deleted.`, out.V{"cluster_name": profile}) machineName := pkg_config.GetMachineName() - if err := pkgutil.DeleteKubeConfigContext(constants.KubeconfigPath, machineName); err != nil { + if err := kubeconfig.DeleteContext(constants.KubeconfigPath, machineName); err != nil { exit.WithError("update config", err) } @@ -107,3 +112,51 @@ func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsN out.ErrT(out.Empty, "Failed to delete cluster: {{.error}}", out.V{"error": err}) } } + +// killMountProcess kills the mount process, if it is running +func killMountProcess() error { + pidPath := filepath.Join(constants.GetMinipath(), constants.MountProcessFileName) + if _, err := os.Stat(pidPath); os.IsNotExist(err) { + return nil + } + + glog.Infof("Found %s ...", pidPath) + out, err := ioutil.ReadFile(pidPath) + if err != nil { + return errors.Wrap(err, "ReadFile") + } + glog.Infof("pidfile contents: %s", out) + pid, err := strconv.Atoi(string(out)) + if err != nil { + return errors.Wrap(err, "error parsing pid") + } + // os.FindProcess does not check if pid is running :( + entry, err := ps.FindProcess(pid) + if err != nil { + return errors.Wrap(err, "ps.FindProcess") + } + if entry == nil { + glog.Infof("Stale pid: %d", pid) + if err := os.Remove(pidPath); err != nil { + return errors.Wrap(err, "Removing stale pid") + } + return nil + } + + // We found a process, but it still may not be ours. + glog.Infof("Found process %d: %s", pid, entry.Executable()) + proc, err := os.FindProcess(pid) + if err != nil { + return errors.Wrap(err, "os.FindProcess") + } + + glog.Infof("Killing pid %d ...", pid) + if err := proc.Kill(); err != nil { + glog.Infof("Kill failed with %v - removing probably stale pid...", err) + if err := os.Remove(pidPath); err != nil { + return errors.Wrap(err, "Removing likely stale unkillable pid") + } + return errors.Wrap(err, fmt.Sprintf("Kill(%d/%s)", pid, entry.Executable())) + } + return nil +} diff --git a/cmd/minikube/cmd/logs.go b/cmd/minikube/cmd/logs.go index 7924ba7c24..0b9bb55b4a 100644 --- a/cmd/minikube/cmd/logs.go +++ b/cmd/minikube/cmd/logs.go @@ -44,7 +44,7 @@ var ( // logsCmd represents the logs command var logsCmd = &cobra.Command{ Use: "logs", - Short: "Gets the logs of the running instance, used for debugging minikube, not user code", + Short: "Gets the logs of the running instance, used for debugging minikube, not user code.", Long: `Gets the logs of the running instance, used for debugging minikube, not user code.`, Run: func(cmd *cobra.Command, args []string) { cfg, err := config.Load() diff --git a/cmd/minikube/cmd/mount.go b/cmd/minikube/cmd/mount.go index 942cd98460..d2942699de 100644 --- a/cmd/minikube/cmd/mount.go +++ b/cmd/minikube/cmd/mount.go @@ -27,8 +27,8 @@ import ( "syscall" "github.com/golang/glog" + "github.com/pkg/errors" "github.com/spf13/cobra" - cmdUtil "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/cluster" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" @@ -62,7 +62,7 @@ var mountCmd = &cobra.Command{ Long: `Mounts the specified directory into minikube.`, Run: func(cmd *cobra.Command, args []string) { if isKill { - if err := cmdUtil.KillMountProcess(); err != nil { + if err := killMountProcess(); err != nil { exit.WithError("Error killing mount process", err) } os.Exit(0) @@ -118,7 +118,7 @@ var mountCmd = &cobra.Command{ exit.WithCodeT(exit.Data, "error parsing the input ip address for mount") } } - port, err := cmdUtil.GetPort() + port, err := getPort() if err != nil { exit.WithError("Error finding port for mount", err) } @@ -210,3 +210,18 @@ func init() { mountCmd.Flags().StringSliceVar(&options, "options", []string{}, "Additional mount options, such as cache=fscache") mountCmd.Flags().IntVar(&mSize, "msize", constants.DefaultMsize, "The number of bytes to use for 9p packet payload") } + +// getPort asks the kernel for a free open port that is ready to use +func getPort() (int, error) { + addr, err := net.ResolveTCPAddr("tcp", "localhost:0") + if err != nil { + panic(err) + } + + l, err := net.ListenTCP("tcp", addr) + if err != nil { + return -1, errors.Errorf("Error accessing port %d", addr.Port) + } + defer l.Close() + return l.Addr().(*net.TCPAddr).Port, nil +} diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index 07c42b58fd..f7f2e38aa6 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -38,6 +38,7 @@ import ( "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/notify" + "k8s.io/minikube/pkg/minikube/translate" ) var dirs = [...]string{ @@ -101,12 +102,57 @@ var RootCmd = &cobra.Command{ // Execute adds all child commands to the root command sets flags appropriately. // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { + for _, c := range RootCmd.Commands() { + c.Short = translate.T(c.Short) + c.Long = translate.T(c.Long) + c.Flags().VisitAll(func(flag *pflag.Flag) { + flag.Usage = translate.T(flag.Usage) + }) + + c.SetUsageTemplate(usageTemplate()) + } + RootCmd.Short = translate.T(RootCmd.Short) + RootCmd.Long = translate.T(RootCmd.Long) + RootCmd.Flags().VisitAll(func(flag *pflag.Flag) { + flag.Usage = translate.T(flag.Usage) + }) + if err := RootCmd.Execute(); err != nil { // Cobra already outputs the error, typically because the user provided an unknown command. os.Exit(exit.BadUsage) } } +// usageTemplate just calls translate.T on the default usage template +// explicitly using the raw string instead of calling c.UsageTemplate() +// so the extractor can find this monstrosity of a string +func usageTemplate() string { + return fmt.Sprintf(`%s:{{if .Runnable}} + {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} + {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} + +%s: + {{.NameAndAliases}}{{end}}{{if .HasExample}} + +%s: +{{.Example}}{{end}}{{if .HasAvailableSubCommands}} + +%s:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} + +%s: +{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} + +%s: +{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} + +%s:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} + {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} + +%s{{end}} +`, translate.T("Usage"), translate.T("Aliases"), translate.T("Examples"), translate.T("Available Commands"), translate.T("Flags"), translate.T("Global Flags"), translate.T("Additional help topics"), translate.T(`Use "{{.CommandPath}} [command] --help" for more information about a command.`)) +} + // Handle config values for flags used in external packages (e.g. glog) // by setting them directly, using values from viper when not passed in as args func setFlagsUsingViper() { @@ -127,12 +173,13 @@ func setFlagsUsingViper() { } func init() { + translate.DetermineLocale() RootCmd.PersistentFlags().StringP(config.MachineProfile, "p", constants.DefaultMachineName, `The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently.`) RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", constants.DefaultClusterBootstrapper, "The name of the cluster bootstrapper that will set up the kubernetes cluster.") groups := templates.CommandGroups{ { - Message: "Basic Commands:", + Message: translate.T("Basic Commands:"), Commands: []*cobra.Command{ startCmd, statusCmd, @@ -142,14 +189,14 @@ func init() { }, }, { - Message: "Images Commands:", + Message: translate.T("Images Commands:"), Commands: []*cobra.Command{ dockerEnvCmd, cacheCmd, }, }, { - Message: "Configuration and Management Commands:", + Message: translate.T("Configuration and Management Commands:"), Commands: []*cobra.Command{ configCmd.AddonsCmd, configCmd.ConfigCmd, @@ -158,14 +205,14 @@ func init() { }, }, { - Message: "Networking and Connectivity Commands:", + Message: translate.T("Networking and Connectivity Commands:"), Commands: []*cobra.Command{ serviceCmd, tunnelCmd, }, }, { - Message: "Advanced Commands:", + Message: translate.T("Advanced Commands:"), Commands: []*cobra.Command{ mountCmd, sshCmd, @@ -173,7 +220,7 @@ func init() { }, }, { - Message: "Troubleshooting Commands:", + Message: translate.T("Troubleshooting Commands:"), Commands: []*cobra.Command{ sshKeyCmd, ipCmd, @@ -185,7 +232,7 @@ func init() { } groups.Add(RootCmd) - // any not grouped command will show in Other Commands group. + // Ungrouped commands will show up in the "Other Commands" section RootCmd.AddCommand(completionCmd) templates.ActsAsRootCommand(RootCmd, []string{"options"}, groups...) @@ -193,7 +240,6 @@ func init() { if err := viper.BindPFlags(RootCmd.PersistentFlags()); err != nil { exit.WithError("Unable to bind flags", err) } - cobra.OnInitialize(initConfig) } diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 6adab87604..eec95c864c 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -17,7 +17,6 @@ limitations under the License. package cmd import ( - "encoding/json" "fmt" "io/ioutil" "net" @@ -32,8 +31,6 @@ import ( "strings" "time" - "k8s.io/minikube/pkg/minikube/drivers/none" - "github.com/blang/semver" "github.com/docker/machine/libmachine" "github.com/docker/machine/libmachine/host" @@ -46,7 +43,6 @@ import ( "github.com/spf13/viper" "golang.org/x/sync/errgroup" cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config" - cmdutil "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/bootstrapper" "k8s.io/minikube/pkg/minikube/bootstrapper/kubeadm" "k8s.io/minikube/pkg/minikube/cluster" @@ -54,7 +50,9 @@ import ( cfg "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/cruntime" + "k8s.io/minikube/pkg/minikube/drivers/none" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/logs" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" @@ -134,20 +132,21 @@ func initMinikubeFlags() { viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() - startCmd.Flags().Int(cpus, constants.DefaultCPUS, "Number of CPUs allocated to the minikube VM") - startCmd.Flags().String(memory, constants.DefaultMemorySize, "Amount of RAM allocated to the minikube VM (format: [], where unit = b, k, m or g)") - startCmd.Flags().String(humanReadableDiskSize, constants.DefaultDiskSize, "Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g)") + startCmd.Flags().Int(cpus, constants.DefaultCPUS, "Number of CPUs allocated to the minikube VM.") + startCmd.Flags().String(memory, constants.DefaultMemorySize, "Amount of RAM allocated to the minikube VM (format: [], where unit = b, k, m or g).") + startCmd.Flags().String(humanReadableDiskSize, constants.DefaultDiskSize, "Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g).") startCmd.Flags().Bool(downloadOnly, false, "If true, only download and cache files for later use - don't install or start anything.") startCmd.Flags().Bool(cacheImages, true, "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none.") - startCmd.Flags().String(isoURL, constants.DefaultISOURL, "Location of the minikube iso") + startCmd.Flags().String(isoURL, constants.DefaultISOURL, "Location of the minikube iso.") startCmd.Flags().Bool(keepContext, constants.DefaultKeepContext, "This will keep the existing kubectl context and will create a minikube context.") - startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd)") - startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube") - startCmd.Flags().String(mountString, constants.DefaultMountDir+":"+constants.DefaultMountEndpoint, "The argument to pass the minikube mount command on start") - startCmd.Flags().String(criSocket, "", "The cri socket path to be used") - startCmd.Flags().String(networkPlugin, "", "The name of the network plugin") - startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\"") - startCmd.Flags().Bool(waitUntilHealthy, true, "Wait until Kubernetes core services are healthy before exiting") + startCmd.Flags().Bool(embedCerts, constants.DefaultEmbedCerts, "if true, will embed the certs in kubeconfig.") + startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd).") + startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.") + startCmd.Flags().String(mountString, constants.DefaultMountDir+":"+constants.DefaultMountEndpoint, "The argument to pass the minikube mount command on start.") + startCmd.Flags().String(criSocket, "", "The cri socket path to be used.") + startCmd.Flags().String(networkPlugin, "", "The name of the network plugin.") + startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\".") + startCmd.Flags().Bool(waitUntilHealthy, true, "Wait until Kubernetes core services are healthy before exiting.") } // initKubernetesFlags inits the commandline flags for kubernetes related options @@ -160,7 +159,7 @@ func initKubernetesFlags() { Valid kubeadm parameters: `+fmt.Sprintf("%s, %s", strings.Join(kubeadm.KubeadmExtraArgsWhitelist[kubeadm.KubeadmCmdParam], ", "), strings.Join(kubeadm.KubeadmExtraArgsWhitelist[kubeadm.KubeadmConfigParam], ","))) startCmd.Flags().String(featureGates, "", "A set of key=value pairs that describe feature gates for alpha/experimental features.") startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the kubernetes cluster") - startCmd.Flags().Int(apiServerPort, pkgutil.APIServerPort, "The apiserver listening port") + startCmd.Flags().Int(apiServerPort, constants.APIServerPort, "The apiserver listening port") startCmd.Flags().String(apiServerName, constants.APIServerName, "The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine") startCmd.Flags().StringArrayVar(&apiServerNames, "apiserver-names", nil, "A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine") startCmd.Flags().IPSliceVar(&apiServerIPs, "apiserver-ips", nil, "A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine") @@ -169,6 +168,7 @@ func initKubernetesFlags() { // initDriverFlags inits the commandline flags for vm drivers func initDriverFlags() { startCmd.Flags().String(vmDriver, constants.DefaultVMDriver, fmt.Sprintf("VM driver is one of: %v", constants.SupportedVMDrivers)) + startCmd.Flags().Bool(disableDriverMounts, false, "Disables the filesystem mounts provided by the hypervisors") // kvm2 startCmd.Flags().String(kvmNetwork, "default", "The KVM network name. (only supported with KVM driver)") @@ -259,12 +259,11 @@ func runStart(cmd *cobra.Command, args []string) { registryMirror = viper.GetStringSlice("registry_mirror") } - vmDriver := viper.GetString(vmDriver) - if err := cmdcfg.IsValidDriver(runtime.GOOS, vmDriver); err != nil { + if err := cmdcfg.IsValidDriver(runtime.GOOS, viper.GetString(vmDriver)); err != nil { exit.WithCodeT( exit.Failure, "The driver '{{.driver}}' is not supported on {{.os}}", - out.V{"driver": vmDriver, "os": runtime.GOOS}, + out.V{"driver": viper.GetString(vmDriver), "os": runtime.GOOS}, ) } @@ -273,7 +272,7 @@ func runStart(cmd *cobra.Command, args []string) { validateDriverVersion(viper.GetString(vmDriver)) k8sVersion, isUpgrade := getKubernetesVersion() - config, err := generateConfig(cmd, k8sVersion) + config, err := generateCfgFromFlags(cmd, k8sVersion) if err != nil { exit.WithError("Failed to generate config", err) } @@ -305,8 +304,13 @@ func runStart(cmd *cobra.Command, args []string) { // setup kube adm and certs and return bootstrapperx bs := setupKubeAdm(machineAPI, config.KubernetesConfig) + // The kube config must be update must come before bootstrapping, otherwise health checks may use a stale IP - kubeconfig := updateKubeConfig(host, &config) + kubeconfig, err := setupKubeconfig(host, &config) + if err != nil { + exit.WithError("Failed to setup kubeconfig", err) + } + // pull images or restart cluster bootstrapCluster(bs, cr, mRunner, config.KubernetesConfig, preExists, isUpgrade) configureMounts() @@ -324,6 +328,33 @@ func runStart(cmd *cobra.Command, args []string) { } +func setupKubeconfig(h *host.Host, c *cfg.Config) (*kubeconfig.Settings, error) { + addr, err := h.Driver.GetURL() + if err != nil { + exit.WithError("Failed to get driver URL", err) + } + addr = strings.Replace(addr, "tcp://", "https://", -1) + addr = strings.Replace(addr, ":2376", ":"+strconv.Itoa(c.KubernetesConfig.NodePort), -1) + if c.KubernetesConfig.APIServerName != constants.APIServerName { + addr = strings.Replace(addr, c.KubernetesConfig.NodeIP, c.KubernetesConfig.APIServerName, -1) + } + + kcs := &kubeconfig.Settings{ + ClusterName: cfg.GetMachineName(), + ClusterServerAddress: addr, + ClientCertificate: constants.MakeMiniPath("client.crt"), + ClientKey: constants.MakeMiniPath("client.key"), + CertificateAuthority: constants.MakeMiniPath("ca.crt"), + KeepContext: viper.GetBool(keepContext), + EmbedCerts: viper.GetBool(embedCerts), + } + kcs.SetPath(kubeconfig.PathFromEnv()) + if err := kubeconfig.Update(kcs); err != nil { + return kcs, err + } + return kcs, nil +} + func handleDownloadOnly(cacheGroup *errgroup.Group, k8sVersion string) { // If --download-only, complete the remaining downloads and exit. if !viper.GetBool(downloadOnly) { @@ -401,9 +432,9 @@ func showVersionInfo(k8sVersion string, cr cruntime.Manager) { } } -func showKubectlConnectInfo(kubeconfig *pkgutil.KubeConfigSetup) { - if kubeconfig.KeepContext { - out.T(out.Kubectl, "To connect to this cluster, use: kubectl --context={{.name}}", out.V{"name": kubeconfig.ClusterName}) +func showKubectlConnectInfo(kcs *kubeconfig.Settings) { + if kcs.KeepContext { + out.T(out.Kubectl, "To connect to this cluster, use: kubectl --context={{.name}}", out.V{"name": kcs.ClusterName}) } else { out.T(out.Ready, `Done! kubectl is now configured to use "{{.name}}"`, out.V{"name": cfg.GetMachineName()}) } @@ -487,7 +518,7 @@ func validateUser() { func validateConfig() { diskSizeMB := pkgutil.CalculateSizeInMB(viper.GetString(humanReadableDiskSize)) if diskSizeMB < pkgutil.CalculateSizeInMB(constants.MinimumDiskSize) { - exit.WithCodeT(exit.Config, "Requested disk size {{.size_in_mb}} is less than minimum of {{.size_in_mb2}}", out.V{"size_in_mb": diskSizeMB, "size_in_mb2": pkgutil.CalculateSizeInMB(constants.MinimumDiskSize)}) + exit.WithCodeT(exit.Config, "Requested disk size {{.requested_size}} is less than minimum of {{.minimum_size}}", out.V{"requested_size": diskSizeMB, "minimum_size": pkgutil.CalculateSizeInMB(constants.MinimumDiskSize)}) } err := autoSetOptions(viper.GetString(vmDriver)) @@ -497,7 +528,7 @@ func validateConfig() { memorySizeMB := pkgutil.CalculateSizeInMB(viper.GetString(memory)) if memorySizeMB < pkgutil.CalculateSizeInMB(constants.MinimumMemorySize) { - exit.UsageT("Requested memory allocation {{.size_in_mb}} is less than the minimum allowed of {{.size_in_mb2}}", out.V{"size_in_mb": memorySizeMB, "size_in_mb2": pkgutil.CalculateSizeInMB(constants.MinimumMemorySize)}) + exit.UsageT("Requested memory allocation {{.requested_size}} is less than the minimum allowed of {{.minimum_size}}", out.V{"requested_size": memorySizeMB, "minimum_size": pkgutil.CalculateSizeInMB(constants.MinimumMemorySize)}) } if memorySizeMB < pkgutil.CalculateSizeInMB(constants.DefaultMemorySize) { out.T(out.Notice, "Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default_memorysize}}MB. Beware that minikube might not work correctly or crash unexpectedly.", @@ -559,8 +590,8 @@ func waitCacheImages(g *errgroup.Group) { } } -// generateConfig generates cfg.Config based on flags and supplied arguments -func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) { +// generateCfgFromFlags generates cfg.Config based on flags and supplied arguments +func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) { r, err := cruntime.New(cruntime.Config{Type: viper.GetString(containerRuntime)}) if err != nil { return cfg.Config{}, err @@ -616,6 +647,7 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) { cfg := cfg.Config{ MachineConfig: cfg.MachineConfig{ KeepContext: viper.GetBool(keepContext), + EmbedCerts: viper.GetBool(embedCerts), MinikubeISO: viper.GetString(isoURL), Memory: pkgutil.CalculateSizeInMB(viper.GetString(memory)), CPUs: viper.GetInt(cpus), @@ -686,7 +718,7 @@ func prepareNone(vmDriver string) { out.T(out.Empty, "") out.WarningT("The 'none' driver provides limited isolation and may reduce system security and reliability.") out.WarningT("For more information, see:") - out.T(out.URL, "https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md") + out.T(out.URL, "https://minikube.sigs.k8s.io/docs/reference/drivers/none/") out.T(out.Empty, "") } @@ -749,7 +781,7 @@ func validateNetwork(h *host.Host) string { ipExcluded := proxy.IsIPExcluded(ip) // Skip warning if minikube ip is already in NO_PROXY k = strings.ToUpper(k) // for http_proxy & https_proxy if (k == "HTTP_PROXY" || k == "HTTPS_PROXY") && !ipExcluded && !warnedOnce { - out.WarningT("You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details", out.V{"ip_address": ip}) + out.WarningT("You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://minikube.sigs.k8s.io/docs/reference/networking/proxy/ for more details", out.V{"ip_address": ip}) warnedOnce = true } } @@ -769,7 +801,7 @@ func validateKubernetesVersions(old *cfg.Config) (string, bool) { nvs, err := semver.Make(strings.TrimPrefix(rawVersion, version.VersionPrefix)) if err != nil { - exit.WithCodeT(exit.Data, `Unable to parse "{{.kubenretes_version}}": {{.error}}`, out.V{"kubenretes_version": rawVersion, "error": err}) + exit.WithCodeT(exit.Data, `Unable to parse "{{.kubernetes_version}}": {{.error}}`, out.V{"kubernetes_version": rawVersion, "error": err}) } nv := version.VersionPrefix + nvs.String() @@ -813,34 +845,6 @@ func setupKubeAdm(mAPI libmachine.API, kc cfg.KubernetesConfig) bootstrapper.Boo return bs } -// updateKubeConfig sets up kubectl -func updateKubeConfig(h *host.Host, c *cfg.Config) *pkgutil.KubeConfigSetup { - addr, err := h.Driver.GetURL() - if err != nil { - exit.WithError("Failed to get driver URL", err) - } - addr = strings.Replace(addr, "tcp://", "https://", -1) - addr = strings.Replace(addr, ":2376", ":"+strconv.Itoa(c.KubernetesConfig.NodePort), -1) - if c.KubernetesConfig.APIServerName != constants.APIServerName { - addr = strings.Replace(addr, c.KubernetesConfig.NodeIP, c.KubernetesConfig.APIServerName, -1) - } - - kcs := &pkgutil.KubeConfigSetup{ - ClusterName: cfg.GetMachineName(), - ClusterServerAddress: addr, - ClientCertificate: constants.MakeMiniPath("client.crt"), - ClientKey: constants.MakeMiniPath("client.key"), - CertificateAuthority: constants.MakeMiniPath("ca.crt"), - KeepContext: viper.GetBool(keepContext), - EmbedCerts: viper.GetBool(embedCerts), - } - kcs.SetKubeConfigFile(cmdutil.GetKubeConfigPath()) - if err := pkgutil.SetupKubeConfig(kcs); err != nil { - exit.WithError("Failed to setup kubeconfig", err) - } - return kcs -} - // configureRuntimes does what needs to happen to get a runtime going. func configureRuntimes(runner cruntime.CommandRunner) cruntime.Manager { config := cruntime.Config{Type: viper.GetString(containerRuntime), Runner: runner} @@ -914,47 +918,8 @@ func configureMounts() { } // saveConfig saves profile cluster configuration in $MINIKUBE_HOME/profiles//config.json -func saveConfig(clusterConfig *cfg.Config) error { - data, err := json.MarshalIndent(clusterConfig, "", " ") - if err != nil { - return err - } - glog.Infof("Saving config:\n%s", data) - path := constants.GetProfileFile(viper.GetString(cfg.MachineProfile)) - if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { - return err - } - - // If no config file exists, don't worry about swapping paths - if _, err := os.Stat(path); os.IsNotExist(err) { - if err := ioutil.WriteFile(path, data, 0600); err != nil { - return err - } - return nil - } - - tf, err := ioutil.TempFile(filepath.Dir(path), "config.json.tmp") - if err != nil { - return err - } - defer os.Remove(tf.Name()) - - if err = ioutil.WriteFile(tf.Name(), data, 0600); err != nil { - return err - } - - if err = tf.Close(); err != nil { - return err - } - - if err = os.Remove(path); err != nil { - return err - } - - if err = os.Rename(tf.Name(), path); err != nil { - return err - } - return nil +func saveConfig(clusterCfg *cfg.Config) error { + return cfg.CreateProfile(viper.GetString(cfg.MachineProfile), clusterCfg) } func validateDriverVersion(vmDriver string) { @@ -1003,7 +968,7 @@ func validateDriverVersion(vmDriver string) { minikubeVersion, err := version.GetSemverVersion() if err != nil { - out.WarningT("Error parsing minukube version: {{.error}}", out.V{"error": err}) + out.WarningT("Error parsing minikube version: {{.error}}", out.V{"error": err}) return } diff --git a/cmd/minikube/cmd/status.go b/cmd/minikube/cmd/status.go index 3cc00ce6c1..c34abb9869 100644 --- a/cmd/minikube/cmd/status.go +++ b/cmd/minikube/cmd/status.go @@ -25,14 +25,13 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config" - "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/cluster" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" - pkgutil "k8s.io/minikube/pkg/util" ) var statusFormat string @@ -93,10 +92,10 @@ var statusCmd = &cobra.Command{ glog.Errorln("Error host driver ip status:", err) } - apiserverPort, err := pkgutil.GetPortFromKubeConfig(util.GetKubeConfigPath(), config.GetMachineName()) + apiserverPort, err := kubeconfig.Port(config.GetMachineName()) if err != nil { // Fallback to presuming default apiserver port - apiserverPort = pkgutil.APIServerPort + apiserverPort = constants.APIServerPort } apiserverSt, err = clusterBootstrapper.GetAPIServerStatus(ip, apiserverPort) @@ -106,7 +105,7 @@ var statusCmd = &cobra.Command{ returnCode |= clusterNotRunningStatusFlag } - ks, err := pkgutil.GetKubeConfigStatus(ip, util.GetKubeConfigPath(), config.GetMachineName()) + ks, err := kubeconfig.IsClusterInConfig(ip, config.GetMachineName()) if err != nil { glog.Errorln("Error kubeconfig status:", err) } diff --git a/cmd/minikube/cmd/stop.go b/cmd/minikube/cmd/stop.go index 139d155d58..1014c7af14 100644 --- a/cmd/minikube/cmd/stop.go +++ b/cmd/minikube/cmd/stop.go @@ -23,11 +23,11 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" - cmdUtil "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/cluster" pkg_config "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" pkgutil "k8s.io/minikube/pkg/util" @@ -71,12 +71,12 @@ func runStop(cmd *cobra.Command, args []string) { out.T(out.Stopped, `"{{.profile_name}}" stopped.`, out.V{"profile_name": profile}) } - if err := cmdUtil.KillMountProcess(); err != nil { + if err := killMountProcess(); err != nil { out.T(out.WarningType, "Unable to kill mount process: {{.error}}", out.V{"error": err}) } machineName := pkg_config.GetMachineName() - err = pkgutil.UnsetCurrentContext(constants.KubeconfigPath, machineName) + err = kubeconfig.UnsetCurrentContext(constants.KubeconfigPath, machineName) if err != nil { exit.WithError("update config", err) } diff --git a/cmd/minikube/cmd/update-context.go b/cmd/minikube/cmd/update-context.go index 94743d5c74..3a6eeda815 100644 --- a/cmd/minikube/cmd/update-context.go +++ b/cmd/minikube/cmd/update-context.go @@ -22,9 +22,9 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" - "k8s.io/minikube/pkg/util" ) // updateContextCmd represents the update-context command @@ -44,7 +44,7 @@ var updateContextCmd = &cobra.Command{ if err != nil { exit.WithError("Error host driver ip status", err) } - updated, err := util.UpdateKubeconfigIP(ip, constants.KubeconfigPath, machineName) + updated, err := kubeconfig.UpdateIP(ip, constants.KubeconfigPath, machineName) if err != nil { exit.WithError("update config", err) } diff --git a/cmd/minikube/main.go b/cmd/minikube/main.go index fef04d79b5..ba4dc77f53 100644 --- a/cmd/minikube/main.go +++ b/cmd/minikube/main.go @@ -33,7 +33,6 @@ import ( "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" - "k8s.io/minikube/pkg/minikube/translate" _ "k8s.io/minikube/pkg/provision" ) @@ -51,7 +50,6 @@ func main() { } out.SetOutFile(os.Stdout) out.SetErrFile(os.Stderr) - translate.DetermineLocale() cmd.Execute() } diff --git a/cmd/util/util.go b/cmd/util/util.go deleted file mode 100644 index ca103bfca1..0000000000 --- a/cmd/util/util.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package util is a hodge-podge of utility functions that should be moved elsewhere. -package util - -import ( - "fmt" - "io/ioutil" - "net" - "os" - "path/filepath" - "strconv" - - "github.com/golang/glog" - ps "github.com/mitchellh/go-ps" - "github.com/pkg/errors" - "k8s.io/minikube/pkg/minikube/constants" -) - -// GetPort asks the kernel for a free open port that is ready to use -func GetPort() (int, error) { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - if err != nil { - panic(err) - } - - l, err := net.ListenTCP("tcp", addr) - if err != nil { - return -1, errors.Errorf("Error accessing port %d", addr.Port) - } - defer l.Close() - return l.Addr().(*net.TCPAddr).Port, nil -} - -// KillMountProcess kills the mount process, if it is running -func KillMountProcess() error { - pidPath := filepath.Join(constants.GetMinipath(), constants.MountProcessFileName) - if _, err := os.Stat(pidPath); os.IsNotExist(err) { - return nil - } - - glog.Infof("Found %s ...", pidPath) - out, err := ioutil.ReadFile(pidPath) - if err != nil { - return errors.Wrap(err, "ReadFile") - } - glog.Infof("pidfile contents: %s", out) - pid, err := strconv.Atoi(string(out)) - if err != nil { - return errors.Wrap(err, "error parsing pid") - } - // os.FindProcess does not check if pid is running :( - entry, err := ps.FindProcess(pid) - if err != nil { - return errors.Wrap(err, "ps.FindProcess") - } - if entry == nil { - glog.Infof("Stale pid: %d", pid) - if err := os.Remove(pidPath); err != nil { - return errors.Wrap(err, "Removing stale pid") - } - return nil - } - - // We found a process, but it still may not be ours. - glog.Infof("Found process %d: %s", pid, entry.Executable()) - proc, err := os.FindProcess(pid) - if err != nil { - return errors.Wrap(err, "os.FindProcess") - } - - glog.Infof("Killing pid %d ...", pid) - if err := proc.Kill(); err != nil { - glog.Infof("Kill failed with %v - removing probably stale pid...", err) - if err := os.Remove(pidPath); err != nil { - return errors.Wrap(err, "Removing likely stale unkillable pid") - } - return errors.Wrap(err, fmt.Sprintf("Kill(%d/%s)", pid, entry.Executable())) - } - return nil -} - -// GetKubeConfigPath gets the path to the first kubeconfig -func GetKubeConfigPath() string { - kubeConfigEnv := os.Getenv(constants.KubeconfigEnvVar) - if kubeConfigEnv == "" { - return constants.KubeconfigPath - } - return filepath.SplitList(kubeConfigEnv)[0] -} diff --git a/cmd/util/util_test.go b/cmd/util/util_test.go deleted file mode 100644 index 315762078b..0000000000 --- a/cmd/util/util_test.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "os" - "testing" - - "k8s.io/client-go/tools/clientcmd" -) - -func TestGetKubeConfigPath(t *testing.T) { - var tests = []struct { - input string - want string - }{ - { - input: "/home/fake/.kube/.kubeconfig", - want: "/home/fake/.kube/.kubeconfig", - }, - { - input: "/home/fake/.kube/.kubeconfig:/home/fake2/.kubeconfig", - want: "/home/fake/.kube/.kubeconfig", - }, - } - - for _, test := range tests { - os.Setenv(clientcmd.RecommendedConfigPathEnvVar, test.input) - if result := GetKubeConfigPath(); result != test.want { - t.Errorf("Expected first splitted chunk, got: %s", result) - } - } -} diff --git a/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/systemd/system/systemd-timesyncd.service.d/disable-virtualbox.conf b/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/systemd/system/systemd-timesyncd.service.d/disable-virtualbox.conf new file mode 100644 index 0000000000..c732fdedb2 --- /dev/null +++ b/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/systemd/system/systemd-timesyncd.service.d/disable-virtualbox.conf @@ -0,0 +1,2 @@ +[Unit] +ConditionVirtualization=!oracle diff --git a/deploy/iso/minikube-iso/configs/minikube_defconfig b/deploy/iso/minikube-iso/configs/minikube_defconfig index ab24b3652a..bcdf54963a 100644 --- a/deploy/iso/minikube-iso/configs/minikube_defconfig +++ b/deploy/iso/minikube-iso/configs/minikube_defconfig @@ -59,4 +59,4 @@ BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg" BR2_TARGET_SYSLINUX=y BR2_PACKAGE_HOST_E2TOOLS=y -BR2_PACKAGE_SYSTEMD_TIMESYNCD=n \ No newline at end of file +BR2_PACKAGE_SYSTEMD_TIMESYNCD=y diff --git a/deploy/minikube/releases.json b/deploy/minikube/releases.json index 341097fae0..0c8c40075d 100644 --- a/deploy/minikube/releases.json +++ b/deploy/minikube/releases.json @@ -1,4 +1,12 @@ [ + { + "name": "v1.3.1", + "checksums": { + "darwin": "5947abe57fa390fcfd96849ac87fc9319f026d4b13f944b6beecc3615e3668be", + "linux": "057a4f4ca36ff51ecad59509d94d3694543b874949e805e2b79792ceef21f983", + "windows": "be1999452b166de72f946aac17ca7c40d53b8a5c8f59dad912c2413f7cc42563" + } + }, { "name": "v1.3.0", "checksums": { diff --git a/docs/accessing_etcd.md b/docs/accessing_etcd.md index 80bd17f584..b1593333d5 100644 --- a/docs/accessing_etcd.md +++ b/docs/accessing_etcd.md @@ -1,11 +1 @@ -# 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 -``` - -The IP address under `vboxnet1` is the IP that you need to access the host from within a pod. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/accessing-host-resources/ \ No newline at end of file diff --git a/docs/addons.md b/docs/addons.md index e8430beaea..ca879ccab8 100644 --- a/docs/addons.md +++ b/docs/addons.md @@ -1,50 +1 @@ -# 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 -- registry-creds: disabled -- freshpod: disabled -- addon-manager: enabled -- dashboard: enabled -- heapster: disabled -- efk: disabled -- ingress: disabled -- default-storageclass: enabled -- storage-provisioner: enabled -- storage-provisioner-gluster: disabled -- nvidia-driver-installer: disabled -- nvidia-gpu-device-plugin: disabled - -# minikube must be running for these commands to take effect -$ minikube addons enable heapster -heapster was successfully enabled - -$ minikube addons open heapster # This will open grafana (interacting w/ heapster) in the browser -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) -* [Heapster](https://github.com/kubernetes/heapster): [Troubleshooting Guide](https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md) Note:You will need to login to Grafana as admin/admin in order to access the console -* [EFK](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch) -* [Registry](https://github.com/kubernetes/minikube/tree/master/deploy/addons/registry) -* [Registry Credentials](https://github.com/upmc-enterprises/registry-creds) -* [Ingress](https://github.com/kubernetes/ingress-nginx) -* [Freshpod](https://github.com/GoogleCloudPlatform/freshpod) -* [nvidia-driver-installer](https://github.com/GoogleCloudPlatform/container-engine-accelerators/tree/master/nvidia-driver-installer/minikube) -* [nvidia-gpu-device-plugin](https://github.com/GoogleCloudPlatform/container-engine-accelerators/tree/master/cmd/nvidia_gpu) -* [logviewer](https://github.com/ivans3/minikube-log-viewer) -* [gvisor](../deploy/addons/gvisor/README.md) -* [storage-provisioner-gluster](../deploy/addons/storage-provisioner-gluster/README.md) - -If you would like to have minikube properly start/restart custom addons, place the addon(s) you wish to be launched with minikube in the `.minikube/addons` directory. Addons in this folder will be moved to the minikube VM and launched each time minikube is started/restarted. - -If you have a request for an addon in minikube, please open an issue with the name and preferably a link to the addon with a description of its purpose and why it should be added. You can also attempt to add the addon to minikube by following the guide at [Adding an Addon](contributors/adding_an_addon.md) - -**Note:** If you want to have a look at the default configuration for the addons, see [deploy/addons](https://github.com/kubernetes/minikube/tree/master/deploy/addons). +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/addons/ diff --git a/docs/alternative_runtimes.md b/docs/alternative_runtimes.md index 6050d5edd0..d0d648734e 100644 --- a/docs/alternative_runtimes.md +++ b/docs/alternative_runtimes.md @@ -1,41 +1 @@ -# Alternative runtimes - -## Using CRI-O - -To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run: - -```shell -$ minikube start --container-runtime=cri-o -``` - -Or you can use the extended version: - -```shell -$ minikube start --container-runtime=cri-o \ - --network-plugin=cni \ - --enable-default-cni \ - --cri-socket=/var/run/crio/crio.sock \ - --extra-config=kubelet.container-runtime=remote \ - --extra-config=kubelet.container-runtime-endpoint=unix:///var/run/crio/crio.sock \ - --extra-config=kubelet.image-service-endpoint=unix:///var/run/crio/crio.sock -``` - -## Using containerd - -To use [containerd](https://github.com/containerd/containerd) as the container runtime, run: - -```shell -$ minikube start --container-runtime=containerd -``` - -Or you can use the extended version: - -```shell -$ minikube start --container-runtime=containerd \ - --network-plugin=cni \ - --enable-default-cni \ - --cri-socket=/run/containerd/containerd.sock \ - --extra-config=kubelet.container-runtime=remote \ - --extra-config=kubelet.container-runtime-endpoint=unix:///run/containerd/containerd.sock \ - --extra-config=kubelet.image-service-endpoint=unix:///run/containerd/containerd.sock -``` +This document has moved to https://minikube.sigs.k8s.io/docs/reference/runtimes/ diff --git a/docs/building_images_within_the_vm.md b/docs/building_images_within_the_vm.md index e3602d6ac6..5b22a32031 100644 --- a/docs/building_images_within_the_vm.md +++ b/docs/building_images_within_the_vm.md @@ -1,31 +1 @@ -# Building images within the VM - -When using a single VM of Kubernetes it's really handy to build 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 machine as minikube which speeds up local experiments. - -## Docker (containerd) - -For Docker, you can either set up your host docker client to communicate by [reusing the docker daemon](reusing_the_docker_daemon.md). - -Or you can use `minikube ssh` to connect to the virtual machine, and run the `docker build` there: - -```shell -docker build -``` - -For more information on the `docker build` command, read the [Docker documentation](https://docs.docker.com/engine/reference/commandline/build/) (docker.com). - -## Podman (cri-o) - -For Podman, there is no daemon running. The processes are started by the user, monitored by `conmon`. - -So you need to use `minikube ssh`, and you will also make sure to run the command as the root user: - -```shell -sudo -E podman build -``` - -For more information on the `podman build` command, read the [Podman documentation](https://github.com/containers/libpod/blob/master/docs/podman-build.1.md) (podman.io). - -## Build context - -For the build context you can use any directory on the virtual machine, or any address on the network. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/building_within/ diff --git a/docs/cache.md b/docs/cache.md index f0efcc2950..475bb7332c 100644 --- a/docs/cache.md +++ b/docs/cache.md @@ -1,20 +1 @@ -# 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 `. - -Images in the cache will be loaded on `minikube start`. If you want to list all available cached images, you can use `minikube cache list` command to list. Below is an example of this functionality: - -```shell -# cache a image into $HOME/.minikube/cache/images -$ minikube cache add ubuntu:16.04 -$ minikube cache add redis:3 - -# list cached images -$ minikube cache list -redis:3 -ubuntu:16.04 - -# delete cached images -$ minikube cache delete ubuntu:16.04 -$ minikube cache delete $(minikube cache list) -``` +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/caching diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 34078095dd..b547b26a5d 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -1,340 +1 @@ -# minikube CLI Commands -This document serves as a reference to all the commands, flags and their accepted arguments - -## Global Flags -These flags can be used globally with any command on the CLI. Following are the global flags - -``` - --alsologtostderr log to standard error as well as files - -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") - -h, --help help for minikube - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --logtostderr log to standard error instead of files - -p, --profile string The name of the minikube VM being used. - This can be modified to allow for multiple minikube instances to be run independently (default "minikube") - --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs - --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging -``` - -## Commands -In this section, all commands which are accepted by the `minikube` CLI are described. To get help about any command, you can also type in `minikube help ` - ---- - ### addons -**Description -** Modifies minikube addons files using subcommands like `minikube addons enable heapster` -**Usage -** -``` -minikube addons SUBCOMMAND [flags] -minikube addons [command] -``` -**Available Subcommands -** -``` -configure Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list -disable Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list -enable Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list -list Lists all available minikube addons as well as their current statuses (enabled/disabled) -open Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list -``` - ---- -### cache -**Description -** Add or delete an image from the local cache. -**Usage -** `minikube cache [command]` -**Available Subcommands-** -``` -add Add an image to local cache. -delete Delete an image from the local cache. -list List all available images from the local cache. -``` - ---- -### completion -**Description -** - -> Outputs minikube shell completion for the given shell (bash or zsh) -> -> This depends on the bash-completion binary. Example installation instructions: -> OS X: -> $ brew install bash-completion -> $ source $(brew --prefix)/etc/bash_completion -> $ minikube completion bash > ~/.minikube-completion # for bash users -> $ minikube completion zsh > ~/.minikube-completion # for zsh users -> $ source ~/.minikube-completion -> Ubuntu: -> $ apt-get install bash-completion -> $ source /etc/bash-completion -> $ source <(minikube completion bash) # for bash users -> $ source <(minikube completion zsh) # for zsh users -> -> Additionally, you may want to output the completion to a file and source in your .bashrc -> -> Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2 -**Usage -** `minikube completion SHELL` - ---- -### config -**Description -** config modifies minikube config files using subcommands like `minikube config set vm-driver kvm` -Configurable fields: - * vm-driver - * feature-gates - * v - * cpus - * disk-size - * host-only-cidr - * memory - * log_dir - * kubernetes-version - * iso-url - * WantUpdateNotification - * ReminderWaitPeriodInHours - * WantReportError - * WantReportErrorPrompt - * WantKubectlDownloadMsg - * WantNoneDriverWarning - * profile - * bootstrapper - * ShowDriverDeprecationNotification - * ShowBootstrapperDeprecationNotification - * dashboard - * addon-manager - * default-storageclass - * heapster - * efk - * ingress - * registry - * registry-creds - * freshpod - * default-storageclass - * storage-provisioner - * storage-provisioner-gluster - * metrics-server - * nvidia-driver-installer - * nvidia-gpu-device-plugin - * logviewer - * gvisor - * hyperv-virtual-switch - * disable-driver-mounts - * cache - * embed-certs - -**Usage -** -``` -minikube config SUBCOMMAND [flags] -minikube config [command] -``` -**Available Subcommands-** -``` -get Gets the value of PROPERTY_NAME from the minikube config file -set Sets an individual value in a minikube config file -unset unsets an individual value in a minikube config file -view Display values currently set in the minikube config file -``` - ---- -### dashboard -**Description -** Access the kubernetes dashboard running within the minikube cluster -**Usage -** `minikube dashboard [flags]` -**Available Flags -** -``` --h, --help help for dashboard - --url Display dashboard URL instead of opening a browser -``` - ---- -### delete -**Description -** Deletes a local kubernetes cluster. This command deletes the VM, and removes all -associated files. -**Usage -** `minikube delete` - ---- -### docker-env -**Description -** Sets up docker env variables; similar to '$(docker-machine env)'. -**Usage -** `minikube docker-env [flags]` -**Available Flags -** -``` - -h, --help help for docker-env - --no-proxy Add machine IP to NO_PROXY environment variable - --shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect - -u, --unset Unset variables instead of setting them -``` - ---- -### help -**Description -** Help provides help for any command in the application. Simply type minikube help [path to command] for full details. -**Usage -** `minikube help [command] [flags]` - ---- -### ip -**Description -** Retrieves the IP address of the running cluster, and writes it to STDOUT. -**Usage -** `minikube ip` - ---- -### kubectl -**Description -** Run the kubernetes client, download it if necessary. -**Usage -** `minikube kubectl` - ---- -### logs -**Description -** Gets the logs of the running instance, used for debugging minikube, not user code. -**Usage -** `minikube logs [flags]` -**Available Flags -** -``` - -f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal. - -h, --help help for logs - -n, --length int Number of lines back to go within the log (default 50) - --problems Show only log entries which point to known problems -``` - ---- -### mount -**Description -** Mounts the specified directory into minikube. -**Usage -** `minikube mount [flags] :` -**Available Flags -** -``` ---9p-version string Specify the 9p version that the mount should use (default "9p2000.L") - --gid string Default group id used for the mount (default "docker") - -h, --help help for mount - --ip string Specify the ip that the mount should be setup on - --kill Kill the mount process spawned by minikube start - --mode uint File permissions used for the mount (default 493) - --msize int The number of bytes to use for 9p packet payload (default 262144) - --options strings Additional mount options, such as cache=fscache - --type string Specify the mount filesystem type (supported types: 9p) (default "9p") - --uid string Default user id used for the mount (default "docker") -``` - ---- -### profile -**Description -** Sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default` -**Usage -** -``` -minikube profile [MINIKUBE_PROFILE_NAME]. You can return to the default minikube profile by running `minikube profile default` [flags] -``` - ---- -### service -**Description -** Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time. -**Usage -** -``` -minikube service [flags] SERVICE -minikube service [command] -``` -**Available Commands -** -``` - list Lists the URLs for the services in your local cluster -``` -**Available Flags -** -``` - --format string Format to output service URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}") - -h, --help help for service - --https Open the service URL with https instead of http - --interval int The time interval for each check that wait performs in seconds (default 20) - -n, --namespace string The service namespace (default "default") - --url Display the kubernetes service URL in the CLI instead of opening it in the default browser - --wait int Amount of time to wait for a service in seconds (default 20) -``` - ---- -### ssh -**Description -** Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'. -**Usage -** `minikube ssh` - ---- -### ssh-key -**Description -** Retrieve the ssh identity key path of the specified cluster. -**Usage -** `minikube ssh-key` - ---- -### start -**Description -** Starts a local kubernetes cluster. -**Usage -** `minikube start [flags]` -**Available Flags -** -``` - --apiserver-ips ipSlice A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default []) - --apiserver-name string The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA") - --apiserver-names stringArray A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine - --apiserver-port int The apiserver listening port (default 8443) - --cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none. (default true) - --container-runtime string The container runtime to be used (docker, crio, containerd) (default "docker") - --cpus int Number of CPUs allocated to the minikube VM (default 2) - --cri-socket string The cri socket path to be used - --disable-driver-mounts Disables the filesystem mounts provided by the hypervisors (vboxfs) - --disk-size string Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "20000mb") - --dns-domain string The cluster dns domain name used in the kubernetes cluster (default "cluster.local") - --docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value) - --docker-opt stringArray Specify arbitrary flags to pass to the Docker daemon. (format: key=value) - --download-only If true, only download and cache files for later use - don't install or start anything. - --enable-default-cni Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni" - --extra-config ExtraOption A set of key=value pairs that describe configuration that may be passed to different components. - The key should be '.' separated, and the first part before the dot is the component to apply the configuration to. - Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler - Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr - --feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental features. - --gpu Enable experimental NVIDIA GPU support in minikube (works only with kvm2 driver on Linux) - -h, --help help for start - --hidden Hide the hypervisor signature from the guest in minikube (works only with kvm2 driver on Linux) - --host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24") - --hyperkit-vpnkit-sock string Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock. - --hyperkit-vsock-ports strings List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now). - --hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver) - --image-mirror-country string Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn - --image-repository string Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers - --insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added. - --iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso") - --keep-context This will keep the existing kubectl context and will create a minikube context. - --kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3) (default "v1.15.0") - --kvm-network string The KVM network name. (only supported with KVM driver) (default "default") - --memory string Amount of RAM allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "2000mb") - --mount This will start the mount daemon and automatically mount files into minikube - --mount-string string The argument to pass the minikube mount command on start (default "C:\\Users\\Pranav.Jituri:/minikube-host") - --network-plugin string The name of the network plugin - --nfs-share strings Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now) - --nfs-shares-root string Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now) (default "/nfsshares") - --no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started (virtualbox) - --registry-mirror strings Registry mirrors to pass to the Docker daemon - --service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12") - --uuid string Provide VM UUID to restore MAC address (only supported with Hyperkit driver). - --vm-driver string VM driver is one of: [virtualbox parallels vmwarefusion kvm hyperv hyperkit kvm2 vmware none] (default "virtualbox") -``` - ---- -### status -**Description -** Gets the status of a local kubernetes cluster. Exit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left. - Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK) -**Usage -** `minikube status [flags]` -**Available Flags -** -``` - --format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/ - For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "host: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubectl: {{.Kubeconfig}}\n") -``` - ---- -### stop -**Description -** Stops a local kubernetes cluster running in Virtualbox. This command stops the VM -itself, leaving all files intact. The cluster can be started again with the `start` command. -**Usage -** `minikube stop` - ---- -### tunnel -**Description -** Creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP -**Usage -** `minikube tunnel [flags]` -**Available Flags -** -``` - -c, --cleanup call with cleanup=true to remove old tunnels -``` - ---- -### update-check -**Description -** Print current and latest version number. -**Usage -** `minikube update-check` - ---- -### update-context -**Description -** Retrieves the IP address of the running cluster, checks it with IP in kubeconfig, and corrects kubeconfig if incorrect. -**Usage -** `minikube update-context` - ---- -### version -**Description -** Print the version of minikube. -**Usage -** `minikube version` +This document has moved to https://minikube.sigs.k8s.io/docs/reference/commands/ diff --git a/docs/configuring_kubernetes.md b/docs/configuring_kubernetes.md index fcf59f527c..cb7db70ae8 100644 --- a/docs/configuring_kubernetes.md +++ b/docs/configuring_kubernetes.md @@ -1,43 +1 @@ -# 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. - -## Selecting a Kubernetes version - -minikube defaults to the latest stable version of Kubernetes. You may select a different Kubernetes release by using the `--kubernetes-version` flag, for example: - - `minikube start --kubernetes-version=v1.10.13` - -minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube extends this policy three additional minor releases so that users can emulate legacy environments. - -As of August 2019, this means that minikube supports and actively tests against the latest builds of: - -* v1.15.x (default) -* v1.14.x -* v1.13.x -* v1.12.x -* v1.11.x (best effort) -* v1.10.x (best effort) - -For more up to date information, see `OldestKubernetesVersion` and `NewestKubernetesVersion` in [constants.go](https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go) - -## kubeadm - -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 - -* kubeadm -* kubelet -* apiserver -* controller-manager -* scheduler - -and `key=value` is a flag=value pair for the component being configured. For example, - -```shell -minikube start --extra-config=apiserver.v=10 --extra-config=kubelet.max-pods=100 - -minikube start --extra-config=kubeadm.ignore-preflight-errors=SystemVerification # allows any version of docker -``` +This document has moved to https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/ diff --git a/docs/contributors/README.md b/docs/contributors/README.md index a5c83b1fdb..a8952b3c5f 100644 --- a/docs/contributors/README.md +++ b/docs/contributors/README.md @@ -1,21 +1 @@ -# 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 new addon** ([adding_an_addon.md](adding_an_addon.md)): How to add a new addon to minikube for `minikube addons` - -* **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 - -* **CI Builds** ([ci_builds.md](./ci_builds.md)): Accessing CI build artifacts from Jenkins - -* **Releasing minikube** ([releasing_minikube.md](releasing_minikube.md)): Steps to release a new version of minikube +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/ diff --git a/docs/contributors/adding_an_addon.md b/docs/contributors/adding_an_addon.md index 3b2b612eb7..9fae54108c 100644 --- a/docs/contributors/adding_an_addon.md +++ b/docs/contributors/adding_an_addon.md @@ -1,56 +1 @@ -# Adding a New Addon - -To add a new addon to minikube the following steps are required: - -* For the new addon's .yaml file(s): - * Put the required .yaml files for the addon in the `minikube/deploy/addons` directory. - * Add the `kubernetes.io/minikube-addons: ` label to each piece of the addon (ReplicationController, Service, etc.) - * Also, `addonmanager.kubernetes.io/mode` annotation is needed so that your resources are picked up by the `addon-manager` minikube addon. - * In order to have `minikube addons open ` work properly, the `kubernetes.io/minikube-addons-endpoint: ` label must be added to the appropriate endpoint service (what the user would want to open/interact with). This service must be of type NodePort. - -* To add the addon into minikube commands/VM: - * Add the addon with appropriate fields filled into the `Addon` dictionary, see this [commit](https://github.com/kubernetes/minikube/commit/41998bdad0a5543d6b15b86b0862233e3204fab6#diff-e2da306d559e3f019987acc38431a3e8R133) and example. - - ```go - // cmd/minikube/cmd/config/config.go - var settings = []Setting{ - ..., - // add other addon setting - { - name: "efk", - set: SetBool, - validations: []setFn{IsValidAddon}, - callbacks: []setFn{EnableOrDisableAddon}, - }, - } - ``` - - * Add the addon to settings list, see this [commit](https://github.com/kubernetes/minikube/commit/41998bdad0a5543d6b15b86b0862233e3204fab6#diff-07ad0c54f98b231e68537d908a214659R89) and example. - - ```go - // pkg/minikube/assets/addons.go - var Addons = map[string]*Addon{ - ..., - // add other addon asset - "efk": NewAddon([]*BinAsset{ - MustBinAsset( - "deploy/addons/efk/efk-configmap.yaml", - constants.AddonsPath, - "efk-configmap.yaml", - "0640"), - MustBinAsset( - "deploy/addons/efk/efk-rc.yaml", - constants.AddonsPath, - "efk-rc.yaml", - "0640"), - MustBinAsset( - "deploy/addons/efk/efk-svc.yaml", - constants.AddonsPath, - "efk-svc.yaml", - "0640"), - }, false, "efk"), - } - ``` - -* Rebuild minikube using make out/minikube. This will put the addon's .yaml binary files into the minikube binary using go-bindata. -* Test addon using `minikube addons enable ` command to start service. +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/addons/ \ No newline at end of file diff --git a/docs/contributors/adding_driver.md b/docs/contributors/adding_driver.md index 3d9b0d5f66..fb3ad4579d 100644 --- a/docs/contributors/adding_driver.md +++ b/docs/contributors/adding_driver.md @@ -1,100 +1 @@ -# Adding new driver (Deprecated) - -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 -by `minikube create --vm-driver=`. This document is not going to talk about how to -create a new docker machine driver. - -## Understand your driver - -First of all, before started, you need to understand your driver in terms of: - -- Which operating system is your driver running on? -- Is your driver builtin the minikube binary or triggered through RPC? -- How to translate minikube config to driver config? -- If builtin, how to instantiate the driver instance? - -Builtin basically means whether or not you need separate driver binary in your `$PATH` for minikube to -work. For instance, `hyperkit` is not builtin, because you need `docker-machine-driver-hyperkit` in your -`$PATH`. `vmwarefusion` is builtin, because you don't need anything. - -## Understand registry - -Registry is what minikube uses to register all the supported drivers. The driver author registers -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: - -[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 -pretty simple once you understand your driver well: - -- Name: unique name of the driver, it will be used as the unique ID in registry and as -`--vm-driver` option in minikube command - -- Builtin: `true` if the driver is builtin minikube binary. `false` otherwise. - -- ConfigCreator: how to translate a minikube config to driver config. The driver config will be persistent -on your `$USER/.minikube` directory. Most likely the driver config is the driver itself. - -- DriverCreator: Only needed when driver is builtin, to instantiate the driver instance. - -## An example - -All drivers are located in `k8s.io/minikube/pkg/minikube/drivers`. Take `vmwarefusion` as an example: - -```golang -// +build darwin - -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" -) - -func init() { - 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 -} -``` - -- In init function, register a `DriverDef` in registry. Specify the metadata in the `DriverDef`. As mentioned -earlier, it's builtin, so you also need to specify `DriverCreator` to tell minikube how to create a `drivers.Driver`. -- Another important thing is `vmwarefusion` only runs on MacOS. You need to add a build tag on top so it only -runs on MacOS, so that the releases on Windows and Linux won't have this driver in registry. -- Last but not least, import the driver in `pkg/minikube/cluster/default_drivers.go` to include it in build. - -## Summary - -In summary, the process includes the following steps: - -1. Add the driver under `k8s.io/minikube/pkg/minikube/drivers` - - Add build tag for supported operating system - - Define driver metadata in `DriverDef` -2. Add import in `pkg/minikube/cluster/default_drivers.go` - -Any Questions: please ping your friend [@anfernee](https://github.com/anfernee) +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/drivers/ diff --git a/docs/contributors/build_guide.md b/docs/contributors/build_guide.md index dbcd572e4e..dddbe5d7b3 100644 --- a/docs/contributors/build_guide.md +++ b/docs/contributors/build_guide.md @@ -1,114 +1 @@ -# 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 - -#### Fedora - -On Fedora you need to install _glibc-static_ -```shell -$ sudo dnf install -y glibc-static -``` - -### Building from Source - -Clone and build minikube: -```shell -$ git clone https://github.com/kubernetes/minikube.git -$ cd minikube -$ make -``` - -Note: Make sure that you uninstall any previous versions of minikube before building -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 -$ MINIKUBE_BUILD_IN_DOCKER=y make cross -``` - -Check "out" directory: -```shell -$ ls out/ -minikube-darwin-amd64 minikube-linux-amd64 minikube-windows-amd64.exe -``` - -You can also build platform specific executables like below: - 1. `make windows` will build the binary for Windows platform - 2. `make linux` will build the binary for Linux platform - 3. `make darwin` will build the binary for Darwin/Mac platform - -### Run Instructions - -Start the cluster using your built minikube with: - -```shell -$ ./out/minikube start -``` - -## Running Tests - -### Unit Tests - -Unit tests are run on Travis before code is merged. To run as part of a development cycle: - -```shell -make test -``` - -### Integration Tests - -Integration tests are currently run manually. -To run them, build the binary and run the tests: - -```shell -make integration -``` - -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: - -* Clone the Kubernetes repo somewhere on your system. -* 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 -``` - -To run a specific conformance test, you can use the `ginkgo.focus` flag to filter the set using a regular expression. -The `hack/e2e.go` wrapper and the `e2e.sh` wrappers have a little trouble with quoting spaces though, so use the `\s` regular expression character instead. -For example, to run the test `should update annotations on modification [Conformance]`, use following command: - -```shell -go run hack/e2e.go -v --test --test_args="--ginkgo.focus=should\supdate\sannotations\son\smodification" --check-version-skew=false -``` +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/building/ \ No newline at end of file diff --git a/docs/contributors/ci_builds.md b/docs/contributors/ci_builds.md index 07304aea75..33f7b21f42 100644 --- a/docs/contributors/ci_builds.md +++ b/docs/contributors/ci_builds.md @@ -1,11 +1 @@ -# CI Builds - -We publish CI builds of minikube, built at every Pull Request. Builds are available at (substitute in the relevant PR number): - -- -- -- - -We also publish CI builds of minikube-iso, built at every Pull Request that touches deploy/iso/minikube-iso. Builds are available at: - -- +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/building/ diff --git a/docs/contributors/minikube_iso.md b/docs/contributors/minikube_iso.md index d8fc153e76..b9bc175ffa 100644 --- a/docs/contributors/minikube_iso.md +++ b/docs/contributors/minikube_iso.md @@ -1,78 +1 @@ -# 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 -- docker -- CRI-O - -## Hacking - -### Requirements - -* Linux - -```shell -sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \ - unzip bc gcc-multilib automake libtool locales -``` - -Either import your private key or generate a sign-only key using `gpg2 --gen-key`. -Also be sure to have an UTF-8 locale set up in order to build the ISO. - -### Build instructions - -```shell -$ git clone https://github.com/kubernetes/minikube.git -$ cd minikube -$ make buildroot-image -$ make out/minikube.iso -``` - -The build will occur inside a docker container. If you want to do this on -baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`. -The bootable ISO image will be available in `out/minikube.iso`. - -### Testing local minikube-iso changes - -```shell -$ ./out/minikube start --iso-url=file://$(pwd)/out/minikube.iso -``` - -### Buildroot configuration - -To change the buildroot configuration, execute: - -```shell -$ cd out/buildroot -$ make menuconfig -$ make -``` - -To save any buildroot configuration changes made with `make menuconfig`, execute: - -```shell -$ cd out/buildroot -$ make savedefconfig -``` - -The changes will be reflected in the `minikube-iso/configs/minikube_defconfig` file. - -```shell -$ git status -## master - M deploy/iso/minikube-iso/configs/minikube_defconfig -``` - -### Saving buildroot/kernel configuration changes - -To make any kernel configuration changes and save them, execute: - -```shell -$ make linux-menuconfig -``` - -This will open the kernel configuration menu, and then save your changes to our -iso directory after they've been selected. +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/iso/ diff --git a/docs/contributors/principles.md b/docs/contributors/principles.md index a2fa60022a..2caffd4f37 100644 --- a/docs/contributors/principles.md +++ b/docs/contributors/principles.md @@ -1,25 +1 @@ -# Principles of Minikube - -The primary goal of minikube is to make it simple to run Kubernetes locally, for day-to-day development workflows and learning purposes. Here are the guiding principles for minikube, in rough priority order: - -1. User-friendly and accessible -2. Inclusive and community-driven -3. Cross-platform -4. Support all Kubernetes features -5. High-fidelity -6. Compatible with all supported Kubernetes releases -7. Support for all Kubernetes-friendly container runtimes -8. Stable and easy to debug - -Here are some specific minikube features that align with our goal: - -* Single command setup and teardown UX -* Support for local storage, networking, auto-scaling, load balancing, etc. -* Unified UX across operating systems -* Minimal dependencies on third party software -* Minimal resource overhead - -## Non-Goals - -* Simplifying Kubernetes production deployment experience -* Supporting all possible deployment configurations of Kubernetes, such as storage, networking, etc. +This document has moved to https://minikube.sigs.k8s.io/docs/concepts/principles/ diff --git a/docs/contributors/releasing_minikube.md b/docs/contributors/releasing_minikube.md index d781280797..4da4199c09 100644 --- a/docs/contributors/releasing_minikube.md +++ b/docs/contributors/releasing_minikube.md @@ -1,109 +1 @@ -# Steps to Release Minikube - -## Preparation - -* Announce release intent on #minikube -* Pause merge requests so that they are not accidentally left out of the ISO or release notes - -## 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. -To check, run `git log -- deploy/iso` from the root directory and see if there has been a commit since the most recent release. - -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* - -The build will take roughly 50 minutes. - -## Update Makefile - -Edit the minikube `Makefile`, updating the version number values at the top: - -* `VERSION_MAJOR`, `VERSION_MINOR`, `VERSION_BUILD` as necessary -* `ISO_VERSION` - defaults to MAJOR.MINOR.0 - update if point release requires a new ISO to be built. - -Make sure the integration tests run against this PR, once the new ISO is built. - -## Ad-Hoc testing of other platforms - -If there are supported platforms which do not have functioning Jenkins workers (Windows), you may use the following to build a sanity check: - -```shell -env BUILD_IN_DOCKER=y make cross checksum -``` - -## Send out Makefile PR - -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 - -Run the following script to update the release notes: - -```shell -hack/release_notes.sh -``` - -Merge the output into CHANGELOG.md. See [PR#3175](https://github.com/kubernetes/minikube/pull/3175) as an example. Then get the PR submitted. - -## Tag the Release - -```shell -sh hack/tag_release.sh 1.. -``` - -## Build the Release - -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* - -## Check the release logs - -After job completion, click "Console Output" to verify that the release completed without errors. This is typically where one will see brew automation fail, for instance. - -## Check releases.json - -This file is used for auto-update notifications, but is not active until releases.json is copied to GCS. - -minikube-bot will send out a PR to update the release checksums at the top of `deploy/minikube/releases.json`. You should merge this PR. - -## Package managers which include minikube - -These are downstream packages that are being maintained by others and how to upgrade them to make sure they have the latest versions - -| Package Manager | URL | TODO | -| --- | --- | --- | -| 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. - -WARNING: The Brew cask automation is error-prone. please ensure that a PR was created. - -## Verification - -Verify release checksums by running`make check-release` - -## Update minikube frontpage - -We document the last 3 releases on our frontpage. Please add it to the list: - -## Update official Kubernetes docs - -If there are major changes, please send a PR to update - -## Announce! - -- #minikube on Slack -- minikube-dev, minikube-users mailing list -- Twitter (optional!) +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/releasing/ diff --git a/docs/contributors/roadmap.md b/docs/contributors/roadmap.md index 81485cc9dd..45e47a31e2 100644 --- a/docs/contributors/roadmap.md +++ b/docs/contributors/roadmap.md @@ -1,50 +1 @@ -# minikube roadmap (2019) - -This roadmap is a living document outlining the major technical improvements which we would like to see in minikube during 2019, divided by how they apply to our [guiding principles](principles.md) - -Please send a PR to suggest any improvements to it. - -## (#1) User-friendly and accessible - -- [ ] Creation of a user-centric minikube website for installation & documentation [#4388](https://github.com/kubernetes/minikube/issues/4388) -- [ ] Localized output to 5+ written languages [#4186](https://github.com/kubernetes/minikube/issues/4186) [#4185](https://github.com/kubernetes/minikube/issues/4185) -- [x] Make minikube usable in environments with challenging connectivity requirements -- [ ] Support lightweight deployment methods for environments where VM's are impractical [#4389](https://github.com/kubernetes/minikube/issues/4389) [#4390](https://github.com/kubernetes/minikube/issues/4390) -- [x] Add offline support - -## (#2) Inclusive and community-driven - -- [x] Increase community involvement in planning and decision making -- [ ] Make the continuous integration and release infrastructure publicly available [#3256](https://github.com/kubernetes/minikube/issues/4390) -- [x] Double the number of active maintainers - -## (#3) Cross-platform - -- [ ] Users should never need to separately install supporting binaries [#3975](https://github.com/kubernetes/minikube/issues/3975) [#4391](https://github.com/kubernetes/minikube/issues/4391) -- [ ] Simplified installation process across all supported platforms - -## (#4) Support all Kubernetes features - -- [ ] Add multi-node support [#94](https://github.com/kubernetes/minikube/issues/94) - -## (#5) High-fidelity - -- [ ] Reduce guest VM overhead by 50% [#3207](https://github.com/kubernetes/minikube/issues/3207) -- [x] Disable swap in the guest VM - -## (#6) Compatible with all supported Kubernetes releases - -- [x] Continuous Integration testing across all supported Kubernetes releases -- [ ] Automatic PR generation for updating the default Kubernetes release minikube uses [#4392](https://github.com/kubernetes/minikube/issues/4392) - -## (#7) Support for all Kubernetes-friendly container runtimes - -- [x] Run all integration tests across all supported container runtimes -- [ ] Support for Kata Containers [#4347](https://github.com/kubernetes/minikube/issues/4347) - -## (#8) Stable and easy to debug - -- [x] Pre-flight error checks for common connectivity and configuration errors -- [ ] Improve the `minikube status` command so that it can diagnose common issues -- [ ] Mark all features not covered by continuous integration as `experimental` -- [x] Stabilize and improve profiles support (AKA multi-cluster) +This document has moved to https://minikube.sigs.k8s.io/docs/contributing/roadmap/ diff --git a/docs/dashboard.md b/docs/dashboard.md index 418647beda..cb7ff8f2d8 100644 --- a/docs/dashboard.md +++ b/docs/dashboard.md @@ -1,37 +1 @@ -# Dashboard - -Minikube supports the [Kubernetes Dashboard](https://github.com/kubernetes/dashboard) out of the box. - -## Accessing the UI - -To access the dashboard: - -```shell -minikube dashboard -``` - -This will enable the dashboard add-on, and open the proxy in the default web browser. - -To stop the proxy (leaves the dashboard running), abort the started process (`Ctrl+C`). - -## Individual steps - -If the automatic command doesn't work for you for some reason, here are the steps: - -```console -$ minikube addons enable dashboard -✅ dashboard was successfully enabled -``` - -If you have your kubernetes client configured for minikube, you can start the proxy: - -```console -$ kubectl --context minikube proxy -Starting to serve on 127.0.0.1:8001 -``` - -Access the dashboard at: - - - -For additional information, see [this page](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/). +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/dashboard/ diff --git a/docs/debugging.md b/docs/debugging.md index cb02133ffa..b087d9c57f 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -1,17 +1 @@ -# 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 -* `--v=3` will output *libmachine* logging -* `--v=7` will output *libmachine --debug* level logging - -Example: -`minikube start --v=1` Will start minikube and output all warnings to stdout. - -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` +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/debug/ diff --git a/docs/drivers.md b/docs/drivers.md index f3f4814fa2..7b69ddd912 100644 --- a/docs/drivers.md +++ b/docs/drivers.md @@ -1,263 +1 @@ -# VM Driver plugin installation - -Minikube uses Docker Machine to manage the Kubernetes VM so it benefits from the -driver plugin architecture that Docker Machine uses to provide a consistent way to -manage various VM providers. Minikube embeds VirtualBox and VMware Fusion drivers -so there are no additional steps to use them. However, other drivers require an -extra binary to be present in the host PATH. - -The following drivers currently require driver plugin binaries to be present in -the host PATH: - -* [KVM2](#kvm2-driver) -* [Hyperkit](#hyperkit-driver) -* [Hyper-V](#hyper-v-driver) -* [VMware](#vmware-unified-driver) -* [Parallels](#parallels-driver) - -## KVM2 driver - -### KVM2 install - -To install the KVM2 driver, first install and configure the prerequisites, namely libvirt 1.3.1 or higher, and qemu-kvm: - -* Debian or Ubuntu 18.x: `sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm` -* Ubuntu 16.x or older: `sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm` -* Fedora/CentOS/RHEL: `sudo yum install libvirt libvirt-daemon-kvm qemu-kvm` -* openSUSE/SLES: `sudo zypper install libvirt qemu-kvm` - -Check your installed virsh version: - -`virsh --version` - -If your version of virsh is newer than 1.3.1 (January 2016), you may download our pre-built driver: - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \ - && sudo install docker-machine-driver-kvm2 /usr/local/bin/ -``` - -If your version of virsh is older than 1.3.1 (Januarry 2016), you may build your own driver binary if you have go 1.12+ installed. - -```console -$ sudo apt install libvirt-dev -$ git clone https://github.com/kubernetes/minikube.git -$ cd minikube -$ make out/docker-machine-driver-kvm2 -$ sudo install out/docker-machine-driver-kvm2 /usr/local/bin -$ -``` - -To finish the kvm installation, start and verify the `libvirtd` service - -```shell -sudo systemctl enable libvirtd.service -sudo systemctl start libvirtd.service -sudo systemctl status libvirtd.service -``` - -Add your user to `libvirt` group (older distributions may use `libvirtd` instead) - -```shell -sudo usermod -a -G libvirt $(whoami) -``` - -Join the `libvirt` group with your current shell session: - -```shell -newgrp libvirt -``` - -To use the kvm2 driver: - -```shell -minikube start --vm-driver kvm2 -``` - -or, to use kvm2 as a default driver for `minikube start`: - -```shell -minikube config set vm-driver kvm2 -``` - -### KVM2 upgrade - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \ - && sudo install docker-machine-driver-kvm2 /usr/local/bin/ -``` - -### KVM2 troubleshoot - -If minikube can't start, check if the kvm default network exists. - -```shell -virsh net-list - Name State Autostart Persistent ----------------------------------------------------------- - default active yes yes -``` - -In case the default network doesn't exist you can define it. - -```shell -curl https://raw.githubusercontent.com/libvirt/libvirt/master/src/network/default.xml > kvm-default.xml -virsh net-define kvm-default.xml -virsh net-start default -``` - -Make sure you are running the lastest version of your driver. - - ```shell -docker-machine-driver-kvm2 version -``` - -## Hyperkit driver - -Install the [hyperkit](http://github.com/moby/hyperkit) VM manager using [brew](https://brew.sh): - -```shell -brew install hyperkit -``` - -Then install the most recent version of minikube's fork of the hyperkit driver: - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \ -&& sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/ -``` - -If you are using [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) in your setup and cluster creation fails (stuck at kube-dns initialization) you might need to add `listen-address=192.168.64.1` to `dnsmasq.conf`. - -*Note: If `dnsmasq.conf` contains `listen-address=127.0.0.1` kubernetes discovers dns at 127.0.0.1:53 and tries to use it using bridge ip address, but dnsmasq replies only to requests from 127.0.0.1* - -To use the driver: - -```shell -minikube start --vm-driver hyperkit -``` - -or, to use hyperkit as a default driver for minikube: - -```shell -minikube config set vm-driver hyperkit -``` - -### Hyperkit upgrade - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \ -&& sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/ -``` - -### Hyperkit troubleshoot - -Make sure you are running the lastest version of your driver. - -```shell -docker-machine-driver-hyperkit version -``` - -## Hyper-V driver - -Hyper-V users will 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. - -Older Hyper-V VM's may have **dynamic memory management** enabled, which can cause problems of unexpected and random restarts which manifests itself in simply losing the connection to the cluster, after which `minikube status` would simply state `stopped`. **Solution**: run `minikube delete` to delete the old VM. - -To use the driver: - -```shell -minikube start --vm-driver hyperv --hyperv-virtual-switch=switch-name -``` - -or, to use hyperv as a default driver: - -```shell -minikube config set vm-driver hyperv && minikube config set hyperv-virtual-switch switch-name -``` - -and run minikube as usual: - -```shell -minikube start -``` - -## 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 and download the release for your operating system. - -The driver must be: - -1. Stored in `$PATH` -2. Named `docker-machine-driver-vmware` -3. Executable (`chmod +x` on UNIX based platforms) - -If you're running on macOS with Fusion, this is an easy way install the driver: - -```shell -export LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/machine-drivers/docker-machine-driver-vmware/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') \ -&& curl -L -o docker-machine-driver-vmware https://github.com/machine-drivers/docker-machine-driver-vmware/releases/download/$LATEST_VERSION/docker-machine-driver-vmware_darwin_amd64 \ -&& chmod +x docker-machine-driver-vmware \ -&& mv docker-machine-driver-vmware /usr/local/bin/ -``` - -To use the driver: - -```shell -minikube start --vm-driver vmware -``` - -or, to use vmware unified driver as a default driver: - -```shell -minikube config set vm-driver vmware -``` - -and run minikube as usual: - -```shell -minikube start -``` - -## Parallels driver - -This driver is useful for users who own Parallels Desktop for Mac that do not have VT-x hardware support required by the hyperkit driver. - -Pre-requisites: Parallels Desktop for Mac - -Install the [Parallels docker-machine driver](https://github.com/Parallels/docker-machine-parallels) using [brew](https://brew.sh): - -```shell -brew install docker-machine-parallels -``` - -To use the driver: - -```shell -minikube start --vm-driver parallels -``` - -or, to use parallels as a default driver for minikube: - -```shell -minikube config set vm-driver parallels -``` - -## Troubleshooting - -minikube is currently unable to display the error message received back from the VM driver. Users can however reveal the error by passing `--alsologtostderr -v=8` to `minikube start`. For instance: - -```shell -minikube start --vm-driver=kvm2 --alsologtostderr -v=8 -``` - -Output: - -```text -Found binary path at /usr/local/bin/docker-machine-driver-kvm2 -Launching plugin server for driver kvm2 -Error starting plugin binary: fork/exec /usr/local/bin/docker-machine-driver-kvm2: exec format error -``` +This document has moved to https://minikube.sigs.k8s.io/docs/reference/drivers/ diff --git a/docs/env_vars.md b/docs/env_vars.md index 00dded01be..b90a70617b 100644 --- a/docs/env_vars.md +++ b/docs/env_vars.md @@ -1,59 +1 @@ - -# minikube Environment Variables - -## 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_`. - -For example the `minikube start --iso-url="$ISO_URL"` flag can also be set by setting the `MINIKUBE_ISO_URL="$ISO_URL"` environment variable. - -## Other variables - -Some features can only be accessed by environment variables, here is a list of these features: - -* **MINIKUBE_HOME** - (string) sets the path for the .minikube directory that minikube uses for state/configuration - -* **MINIKUBE_IN_STYLE** - (bool) manually sets whether or not emoji and colors should appear in minikube. Set to false or 0 to disable this feature, true or 1 to force it to be turned on. - -* **MINIKUBE_WANTUPDATENOTIFICATION** - (bool) sets whether the user wants an update notification for new minikube versions - -* **MINIKUBE_REMINDERWAITPERIODINHOURS** - (int) sets the number of hours to check for an update notification - -* **CHANGE_MINIKUBE_NONE_USER** - (bool) automatically change ownership of ~/.minikube to the value of $SUDO_USER - -* **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube - -## Making these values permanent - -To make the exported variables permanent: - -* Linux and macOS: Add these declarations to `~/.bashrc` or wherever your shells environment variables are stored. -* Windows: Add these declarations via [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe) - -### Example: Disabling emoji - -```shell -export MINIKUBE_IN_STYLE=false -minikube start -``` - -### Example: Profiling - -```shell -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. -2017/01/09 13:19:06 profile: cpu profiling disabled, /tmp/profile933201292/cpu.pprof -``` - -Examine the cpu profiling results: - -```shell -go tool pprof /tmp/profile933201292/cpu.pprof -``` +This document has moved to https://minikube.sigs.k8s.io/docs/reference/environment_variables diff --git a/docs/gpu.md b/docs/gpu.md index 1d2faa2dd1..56725b80fb 100644 --- a/docs/gpu.md +++ b/docs/gpu.md @@ -1,121 +1 @@ -# (Experimental) NVIDIA GPU support in minikube - -minikube has experimental support for using NVIDIA GPUs on Linux. - -## Using NVIDIA GPUs on minikube on Linux with `--vm-driver=kvm2` - -When using NVIDIA GPUs with the kvm2 vm-driver. We passthrough spare GPUs on the -host to the minikube VM. Doing so has a few prerequisites: - -- You must install the [kvm2 driver](drivers.md#kvm2-driver). If you already had - this installed make sure that you fetch the latest - `docker-machine-driver-kvm2` binary that has GPU support. - -- Your CPU must support IOMMU. Different vendors have different names for this - technology. Intel calls it Intel VT-d. AMD calls it AMD-Vi. Your motherboard - must also support IOMMU. - -- You must enable IOMMU in the kernel: add `intel_iommu=on` or `amd_iommu=on` - (depending to your CPU vendor) to the kernel command line. Also add `iommu=pt` - to the kernel command line. - -- You must have spare GPUs that are not used on the host and can be passthrough - to the VM. These GPUs must not be controlled by the nvidia/nouveau driver. You - can ensure this by either not loading the nvidia/nouveau driver on the host at - all or assigning the spare GPU devices to stub kernel modules like `vfio-pci` - or `pci-stub` at boot time. You can do that by adding the - [vendorId:deviceId](https://pci-ids.ucw.cz/read/PC/10de) of your spare GPU to - the kernel command line. For ex. for Quadro M4000 add `pci-stub.ids=10de:13f1` - to the kernel command line. Note that you will have to do this for all GPUs - you want to passthrough to the VM and all other devices that are in the IOMMU - group of these GPUs. - -- 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 - - -### 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 -to expose GPUs with `--vm-driver=kvm2`. Please don't mix these instructions. - -- Install minikube. - -- Install the nvidia driver, nvidia-docker and configure docker with nvidia as - the default runtime. See instructions at - - -- 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 - supported GPUs listed are AMD’s. - -- 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 - host](http://www.virtualbox.org/manual/ch09.html#pcipassthrough). - -- Hyper-V supports DDA (discrete device assignment) but [only for Windows Server - 2016](https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/plan/plan-for-deploying-devices-using-discrete-device-assignment) - -Since the only possibility of supporting GPUs on minikube on Windows is on a -server OS where users don't usually run minikube, we haven't invested time in -trying to support NVIDIA GPUs on minikube on Windows. - -Also, nvidia-docker [doesn't support -Windows](https://github.com/NVIDIA/nvidia-docker/issues/197) either. +This document has moved to https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/ diff --git a/docs/host_folder_mount.md b/docs/host_folder_mount.md index 92f454cbc1..689f23f986 100644 --- a/docs/host_folder_mount.md +++ b/docs/host_folder_mount.md @@ -1,76 +1 @@ -# 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 -# terminal 1 -$ mkdir ~/mount-dir -$ minikube mount ~/mount-dir:/mount-9p -Mounting /home/user/mount-dir/ into /mount-9p on the minikubeVM -This daemon process needs to stay alive for the mount to still be accessible... -ufs starting -# This process has to stay open, so in another terminal... -``` - -```shell -# terminal 2 -$ echo "hello from host" > ~/mount-dir/hello-from-host -$ kubectl run -i --rm --tty ubuntu --overrides=' -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "ubuntu" - }, - "spec": { - "containers": [ - { - "name": "ubuntu", - "image": "ubuntu:14.04", - "args": [ - "bash" - ], - "stdin": true, - "stdinOnce": true, - "tty": true, - "workingDir": "/mount-9p", - "volumeMounts": [{ - "mountPath": "/mount-9p", - "name": "host-mount" - }] - } - ], - "volumes": [ - { - "name": "host-mount", - "hostPath": { - "path": "/mount-9p" - } - } - ] - } -} -' --image=ubuntu:14.04 --restart=Never -- bash - -Waiting for pod default/ubuntu to be running, status is Pending, pod ready: false -Waiting for pod default/ubuntu to be running, status is Running, pod ready: false -# ====================================================================================== -# We are now in the pod -#======================================================================================= -root@ubuntu:/mount-9p# cat hello-from-host -hello from host -root@ubuntu:/mount-9p# echo "hello from pod" > /mount-9p/hello-from-pod -root@ubuntu:/mount-9p# ls -hello-from-host hello-from-pod -root@ubuntu:/mount-9p# exit -exit -Waiting for pod default/ubuntu to terminate, status is Running -pod "ubuntu" deleted -# ====================================================================================== -# We are back on the host -#======================================================================================= -$ cat ~/mount-dir/hello-from-pod -hello from pod -``` - -Some drivers themselves provide host-folder sharing options, but we plan to deprecate these in the future as they are all implemented differently and they are not configurable through minikube. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/mount/ diff --git a/docs/http_proxy.md b/docs/http_proxy.md index fd185542c9..789508a20f 100644 --- a/docs/http_proxy.md +++ b/docs/http_proxy.md @@ -1,102 +1 @@ -# minikube: Using HTTP/HTTPS proxies - -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: - -* `HTTP_PROXY` - The URL to your HTTP proxy -* `HTTPS_PROXY` - The URL to your HTTPS proxy -* `NO_PROXY` - A comma-separated list of hosts which should not go through the proxy. - -The NO_PROXY variable here is important: Without setting it, minikube may not be able to access resources within the VM. minikube uses two IP ranges, which should not go through the proxy: - -* **192.168.99.0/24**: Used by the minikube VM. Configurable for some hypervisors via `--host-only-cidr` -* **192.168.39.0/24**: Used by the minikube kvm2 driver. -* **10.96.0.0/12**: Used by service cluster IP's. Configurable via `--service-cluster-ip-range` - -One important note: If NO_PROXY is required by non-Kubernetes applications, such as Firefox or Chrome, you may want to specifically add the minikube IP to the comma-separated list, as they may not understand IP ranges ([#3827](https://github.com/kubernetes/minikube/issues/3827)). - -## Example Usage - -### 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.0/24,192.168.39.0/24 - -minikube start -``` - -To make the exported variables permanent, consider adding the declarations to ~/.bashrc or wherever your user-set environment variables are stored. - -### 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,192.168.39.0/24 - -minikube start -``` - -To set these environment variables permanently, consider adding these to your [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe) - -## Configuring Docker to use a proxy - -As of v1.0, minikube automatically configures the Docker instance inside of the VM to use the proxy environment variables, unless you have specified a `--docker-env` override. If you need to manually configure Docker for a set of proxies, use: - -```shell -minikube start \ - --docker-env=HTTP_PROXY=$HTTP_PROXY \ - --docker-env HTTPS_PROXY=$HTTPS_PROXY \ - --docker-env NO_PROXY=$NO_PROXY -``` - -## Troubleshooting - -### 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: - -* Temporary download error: Get https://storage.googleapis.com/minikube/iso/minikube.iso: -proxyconnect tcp: dial tcp :: connect: connection refused -``` - -This error indicates that the host:port combination defined by HTTPS_PROXY or HTTP_PROXY is incorrect, or that the proxy is unavailable. - -## Unable to pull images..Client.Timeout exceeded while awaiting headers - -```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 -(Client.Timeout exceeded while awaiting headers) -``` - -This error indicates that the container runtime running within the VM does not have access to the internet. Verify that you are passing the appropriate value to `--docker-env HTTPS_PROXY`. - -## 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 -``` - -This is because minikube VM is stuck behind a proxy that rewrites HTTPS responses to contain its own TLS certificate. The [solution](https://github.com/kubernetes/minikube/issues/3613#issuecomment-461034222) is to install the proxy certificate into a location that is copied to the VM at startup, so that it can be validated. - -Ask your IT department for the appropriate PEM file, and add it to: - -`~/.minikube/files/etc/ssl/certs` - -Then run `minikube delete` and `minikube start`. - -## downloading binaries: proxyconnect tcp: tls: oversized record received with length 20527 - -Your need to set a correct `HTTPS_PROXY` value. - -## Additional Information - -* [Configure Docker to use a proxy server](https://docs.docker.com/network/proxy/) +This document has moved to https://minikube.sigs.k8s.io/docs/reference/networking/proxy/ diff --git a/docs/insecure_registry.md b/docs/insecure_registry.md index fa02d603d3..c02296e26c 100644 --- a/docs/insecure_registry.md +++ b/docs/insecure_registry.md @@ -1,28 +1 @@ -# 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. - -One nifty hack is to allow the kubelet running in minikube to talk to registries deployed inside a pod in the cluster without backing them -with TLS certificates. Because the default service cluster IP is known to be available at 10.0.0.1, users can pull images from registries -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 - -Do you want to enable Google Container Registry? [y/n]: y --- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):/home/user/.config/gcloud/application_default_credentials.json - -Do you want to enable Docker Registry? [y/n]: n -registry-creds was successfully configured -$ minikube addons enable registry-creds -``` - -For additional information on private container registries, see [this page](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). - -We recommend you use _ImagePullSecrets_, but if you would like to configure access on the minikube VM you can place the `.dockercfg` in the `/home/docker` directory or the `config.json` in the `/var/lib/kubelet` directory. Make sure to restart your kubelet (for kubeadm) process with `sudo systemctl restart kubelet`. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/registry/ diff --git a/docs/networking.md b/docs/networking.md index 246b4f0753..cc3ba1e46e 100644 --- a/docs/networking.md +++ b/docs/networking.md @@ -1,78 +1,2 @@ -# Networking - -## Firewalls, VPN's, and proxies - -minikube may require access from the host to the following IP ranges: 192.168.99.0/24, 192.168.39.0/24, and 10.96.0.0/12. These networks can be changed in minikube using `--host-only-cidr` and `--service-cluster-ip-range`. - -* To use minikube with a proxy, see [Using HTTP/HTTPS proxies](http_proxy.md). - -* If you are using minikube with a VPN, you may need to configure the VPN to allow local routing for traffic to the afforementioned IP ranges. - -* If you are using minikube with a local firewall, you will need to allow access from the host to the afforementioned IP ranges on TCP ports 22 and 8443. You will also need to add access from these IP's to TCP ports 443 and 53 externally to pull images. - -## Access to NodePort services - -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. - -To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output): - -`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'` - -We also have a shortcut for fetching the minikube IP and a service's `NodePort`: - -`minikube service --url $SERVICE` - -### Increasing the NodePort range - -By default, minikube only exposes ports 30000-32767. If this is not enough, you can configure the apiserver to allow all ports using: - -`minikube start --extra-config=apiserver.service-node-port-range=1-65535` - -This flag also accepts a comma separated list of ports and port ranges. - -## Access to LoadBalancer services using `minikube tunnel` - -Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command. - -````shell -minikube tunnel -```` - -Will output: - -```text -out/minikube tunnel -Password: ***** -Status: - machine: minikube - pid: 59088 - route: 10.96.0.0/12 -> 192.168.99.101 - minikube: Running - services: [] - 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 - -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: - -````shell -minikube tunnel --cleanup -```` - -## Tunnel: 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. - -If you want to avoid entering the root password, consider setting NOPASSWD for "ip" and "route" commands: - - +This document has moved to https://minikube.sigs.k8s.io/docs/reference/networking/ + \ No newline at end of file diff --git a/docs/offline.md b/docs/offline.md index 3da03bfaaa..3bfc3bf2ff 100644 --- a/docs/offline.md +++ b/docs/offline.md @@ -1,40 +1 @@ -# Offline support in minikube - -As of v1.0, `minikube start` is offline compatible out of the box. Here are some implementation details to help systems integrators: - -## Requirements - -* On the initial run for a given Kubernetes release, `minikube start` must have access to the internet, or a configured `--image-repository` to pull from. - -## Cache location - -* `~/.minikube/cache` - Top-level folder -* `~/.minikube/cache/iso` - VM ISO image. Typically updated once per major minikube release. -* `~/.minikube/cache/images` - Docker images used by Kubernetes. -* `~/.minikube/cache/` - Kubernetes binaries, such as `kubeadm` and `kubelet` - -## Sharing the minikube cache - -For offline use on other hosts, one can copy the contents of `~/.minikube/cache`. As of the v1.0 release, this directory -contains 685MB of data: - -```text -cache/iso/minikube-v1.0.0.iso -cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1 -cache/images/k8s.gcr.io/k8s-dns-sidecar-amd64_1.14.13 -cache/images/k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64_1.14.13 -cache/images/k8s.gcr.io/kubernetes-dashboard-amd64_v1.10.1 -cache/images/k8s.gcr.io/kube-scheduler_v1.14.0 -cache/images/k8s.gcr.io/coredns_1.3.1 -cache/images/k8s.gcr.io/kube-controller-manager_v1.14.0 -cache/images/k8s.gcr.io/kube-apiserver_v1.14.0 -cache/images/k8s.gcr.io/pause_3.1 -cache/images/k8s.gcr.io/etcd_3.3.10 -cache/images/k8s.gcr.io/kube-addon-manager_v9.0 -cache/images/k8s.gcr.io/k8s-dns-kube-dns-amd64_1.14.13 -cache/images/k8s.gcr.io/kube-proxy_v1.14.0 -cache/v1.14.0/kubeadm -cache/v1.14.0/kubelet -``` - -If any of these files exist, minikube will use copy them into the VM directly rather than pulling them from the internet. +This document has moved to https://minikube.sigs.k8s.io/docs/reference/cache/ diff --git a/docs/openid_connect_auth.md b/docs/openid_connect_auth.md index aeb016c6a5..cbb2515911 100644 --- a/docs/openid_connect_auth.md +++ b/docs/openid_connect_auth.md @@ -1,33 +1 @@ -# OpenID Connect Authentication - -Minikube `kube-apiserver` can be configured to support OpenID Connect Authentication. - -Read more about OpenID Connect Authentication for Kubernetes here: - -## Configuring the API Server - -Configuration values can be passed to the API server using the `--extra-config` flag on the `minikube start` command. See [configuring_kubernetes.md](https://github.com/kubernetes/minikube/blob/master/docs/configuring_kubernetes.md) for more details. - -The following example configures your Minikube cluster to support RBAC and OIDC: - -```shell -minikube start \ - --extra-config=apiserver.authorization-mode=RBAC \ - --extra-config=apiserver.oidc-issuer-url=https://example.com \ - --extra-config=apiserver.oidc-username-claim=email \ - --extra-config=apiserver.oidc-client-id=kubernetes-local -``` - -## Configuring kubectl - -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: - -```shell -kubectl config set-context kubernetes-local-oidc --cluster=minikube --user username@example.com -Context "kubernetes-local-oidc" created. -kubectl config use-context kubernetes-local-oidc -``` - -For the new context to work you will need to create, at the very minimum, a `Role` and a `RoleBinding` in your cluster to grant permissions to the `subjects` included in your `oidc-username-claim`. +This document has moved to https://minikube.sigs.k8s.io/docs/tutorials/openid_connect_auth/ diff --git a/docs/persistent_volumes.md b/docs/persistent_volumes.md index 0f734ee616..df28b852af 100644 --- a/docs/persistent_volumes.md +++ b/docs/persistent_volumes.md @@ -1,39 +1 @@ -# 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 - -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. - -* `/data` -* `/var/lib/minikube` -* `/var/lib/docker` -* `/tmp/hostpath_pv` -* `/tmp/hostpath-provisioner` - -Here is an example PersistentVolume config to persist data in the '/data' directory: - -```yaml -apiVersion: v1 -kind: PersistentVolume -metadata: - name: pv0001 -spec: - accessModes: - - ReadWriteOnce - capacity: - storage: 5Gi - hostPath: - path: /data/pv0001/ -``` - -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 dynamic storage controller that runs alongside its deployment. This manages provisioning of *hostPath* volumes (rather then via the previous, in-tree hostPath provider). - -The default [Storage Provisioner Controller](https://github.com/kubernetes/minikube/blob/master/pkg/storage/storage_provisioner.go) is managed internally, in the minikube codebase, demonstrating how easy it is to plug a custom storage controller into kubernetes as a storage component of the system, and provides pods with dynamically, to test your pod's behaviour when persistent storage is mapped to it. - -Note that this is not a CSI based storage provider, rather, it simply declares a PersistentVolume object of type hostpath dynamically when the controller see's that there is an outstanding storage request. +This document has moved to https://minikube.sigs.k8s.io/docs/reference/persistent_volumes/ diff --git a/docs/reusing_the_docker_daemon.md b/docs/reusing_the_docker_daemon.md index 7060bb3f8a..2b76f9534b 100644 --- a/docs/reusing_the_docker_daemon.md +++ b/docs/reusing_the_docker_daemon.md @@ -1,81 +1 @@ -# Reusing the Docker daemon - -## Method 1: Without minikube registry addon - -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. - -To be able to work with the docker daemon on your mac/linux host use the docker-env command in your shell: - -```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 -``` - -Docker may report following forbidden error if you are using http proxy and the `$(minikube ip)` is not added to `no_proxy`/`NO_PROXY`: - -```shell -error during connect: Get https://192.168.39.98:2376/v1.39/containers/json: Forbidden -``` - -On Centos 7, docker may report the following error: - -```shell -Could not read CA certificate "/etc/docker/ca.pem": open /etc/docker/ca.pem: no such file or directory -``` - -The fix is to update /etc/sysconfig/docker to ensure that minikube's environment changes are respected: - -```diff -< DOCKER_CERT_PATH=/etc/docker ---- -> if [ -z "${DOCKER_CERT_PATH}" ]; then -> DOCKER_CERT_PATH=/etc/docker -> fi -``` - -Remember to turn off the _imagePullPolicy:Always_, as otherwise Kubernetes won't use images you built locally. - -## Method 2: With minikube registry addon - -Enable minikube registry addon and then push images directly into registry. Steps are as follows: - -For illustration purpose, we will assume that minikube VM has one of the ip from `192.168.39.0/24` subnet. If you have not overridden these subnets as per [networking guide](https://github.com/kubernetes/minikube/blob/master/docs/networking.md), you can find out default subnet being used by minikube for a specific OS and driver combination [here](https://github.com/kubernetes/minikube/blob/dfd9b6b83d0ca2eeab55588a16032688bc26c348/pkg/minikube/cluster/cluster.go#L408) which is subject to change. Replace `192.168.39.0/24` with appropriate values for your environment wherever applicable. - -Ensure that docker is configured to use `192.168.39.0/24` as insecure registry. Refer [here](https://docs.docker.com/registry/insecure/) for instructions. - -Ensure that `192.168.39.0/24` is enabled as insecure registry in minikube. Refer [here](https://github.com/kubernetes/minikube/blob/master/docs/insecure_registry.md) for instructions.. - -Enable minikube registry addon: - -```shell -minikube addons enable registry -``` - -Build docker image and tag it appropriately: - -```shell -docker build --tag $(minikube ip):5000/test-img . -``` - -Push docker image to minikube registry: - -```shell -docker push $(minikube ip):5000/test-img -``` - -Now run it in minikube: - -```shell -kubectl run test-img --image=$(minikube ip):5000/test-img -``` - -Or if `192.168.39.0/24` is not enabled as insecure registry in minikube, then: - -```shell -kubectl run test-img --image=localhost:5000/test-img -``` +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/docker_daemon/ diff --git a/docs/syncing-files.md b/docs/syncing-files.md index 2cff4e72a7..ea217b2d38 100644 --- a/docs/syncing-files.md +++ b/docs/syncing-files.md @@ -1,15 +1 @@ -# minikube: Syncing files into the VM - -## Syncing files during start up - -As soon as a VM is created, minikube will populate the root filesystem with any files stored in $MINIKUBE_HOME (~/.minikube/files). - -For example, running the following commands will result in `/etc/OMG` being added with the contents of `hello` into the minikube VM: - -```shell -mkdir -p ~/.minikube/files/etc -echo hello > ~/.minikube/files/etc/OMG -minikube start -``` - -This method of file synchronization can be useful for adding configuration files for apiserver, or adding HTTPS certificates. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/sync/ diff --git a/docs/tunnel.md b/docs/tunnel.md index 8e41bf9dbe..b92c4c1b16 100644 --- a/docs/tunnel.md +++ b/docs/tunnel.md @@ -1,144 +1 @@ -# Minikube Tunnel Design Doc - -## Background - -Minikube today only exposes a single IP address for all cluster and VM communication. -This effectively requires users to connect to any running Pods, Services or LoadBalancers over ClusterIPs, which can require modifications to workflows when compared to developing against a production cluster. - -A main goal of Minikube is to minimize the differences required in code and configuration between development and production, so this is not ideal. -If all cluster IP addresses and Load Balancers were made available on the minikube host machine, these modifications would not be necessary and users would get the "magic" experience of developing from inside a cluster. - -Tools like telepresence.io, sshuttle, and the OpenVPN chart provide similar capabilities already. - -Also, Steve Sloka has provided a very detailed guide on how to setup a similar configuration [manually](https://stevesloka.com/access-minikube-service-from-linux-host/). - -Elson Rodriguez has provided a similar guide, including a Minikube [external LB controller](https://github.com/elsonrodriguez/minikube-lb-patch). - -## Example usage - -```shell -$ minikube tunnel -Starting minikube tunnel process. Press Ctrl+C to exit. -All cluster IPs and load balancers are now available from your host machine. -``` - -## Overview - -We will introduce a new command, `minikube tunnel`, that must be run with root permissions. -This command will: - -* Establish networking routes from the host into the VM for all IP ranges used by Kubernetes. -* Enable a cluster controller that allocates IPs to services external `LoadBalancer` IPs. -* Clean up routes and IPs when stopped, or when `minikube` stops. - -Additionally, we will introduce a Minikube LoadBalancer controller that manages a CIDR of IPs and assigns them to services of type `LoadBalancer`. -These IPs will also be made available on the host machine. - -## Network Routes - -Minikube drivers usually establish "host-only" IP addresses (192.168.1.1, for example) that route into the running VM -from the host. - -The new `minikube tunnel` command will create a static routing table entry that maps the CIDRs used by Pods, Services and LoadBalancers to the host-only IP, obtainable via the `minikube ip` command. - -The commands below detail adding routes for the entire `/8` block, we should probably add individual entries for each CIDR we manage instead. - -### Linux - -Route entries for the entire 10.* block can be added via: - -```shell -sudo ip route add 10.0.0.0/8 via $(minikube ip) -``` - -and deleted via: - -```shell -sudo ip route delete 10.0.0.0/8 -``` - -The routing table can be queried with `netstat -nr -f inet` - -### OSX - -Route entries can be added via: - -```shell -sudo route -n add 10.0.0.0/8 $(minikube ip) -``` - -and deleted via: - -```shell -sudo route -n delete 10.0.0.0/8 - -``` - -The routing table can be queried with `netstat -nr -f inet` - -### Windows - -Route entries can be added via: - -```shell -route ADD 10.0.0.0 MASK 255.0.0.0 -``` - -and deleted via: - -```shell -route DELETE 10.0.0.0 -``` - -The routing table can be queried with `route print -4` - -### 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 - -- 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: - -```shell -minikube tunnel --cleanup -``` - -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 - -*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 - -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. - -## Load Balancer Controller - -In addition to making IPs routable, minikube tunnel will assign an external IP (the ClusterIP) to all services of type `LoadBalancer`. - -The logic of this controller will be, roughly: - -```python -for service in services: - if service.type == "LoadBalancer" and len(service.ingress) == 0: - add_ip_to_service(ClusterIP, service) -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 - -Multiple clusters are currently not supported due to our inability to specify ServiceCIDR. -This causes conflicting routes having the same destination CIDR. +This document has moved to https://minikube.sigs.k8s.io/docs/tasks/loadbalancer/ diff --git a/docs/vmdriver-none.md b/docs/vmdriver-none.md index 77450e61df..143ec71b2b 100644 --- a/docs/vmdriver-none.md +++ b/docs/vmdriver-none.md @@ -1,119 +1 @@ -# vm-driver=none - -## Overview - -This document is written for system integrators who are familiar with minikube, and wish to run it within a customized VM environment. - -The `none` driver allows advanced minikube users to skip VM creation, allowing minikube to be run on a user-supplied VM. - -## What operating systems are supported? - -The `none` driver supports releases of Debian, Ubuntu, and Fedora that are less than 2 years old. In practice, any systemd-based modern distribution is likely to work, and we will accept pull requests which improve compatibility with other systems. - -## Example: basic usage - -`sudo minikube start --vm-driver=none` - -NOTE: The none driver requires minikube to be run as root, until [#3760](https://github.com/kubernetes/minikube/issues/3760) can be addressed. - -## Example: Using minikube for continuous integration testing - -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/ - -kv=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) -curl -Lo kubectl \ - https://storage.googleapis.com/kubernetes-release/release/$kv/bin/linux/amd64/kubectl \ - && sudo install kubectl /usr/local/bin/ - -export MINIKUBE_WANTUPDATENOTIFICATION=false -export MINIKUBE_WANTREPORTERRORPROMPT=false -export MINIKUBE_HOME=$HOME -export CHANGE_MINIKUBE_NONE_USER=true -export KUBECONFIG=$HOME/.kube/config - -mkdir -p $HOME/.kube $HOME/.minikube -touch $KUBECONFIG - -sudo -E minikube start --vm-driver=none -``` - -At this point, kubectl should be able to interact with the minikube cluster. - -## Can the none driver be used outside of a VM? - -Yes, *but please avoid doing so if at all possible.* - -minikube was designed to run Kubernetes within a dedicated VM, and assumes that it has complete control over the machine it is executing on. With the `none` driver, minikube and Kubernetes run in an environment with very limited isolation, which could result in: - -* Decreased security -* Decreased reliability -* Data loss - -We'll cover these in detail below: - -### Decreased security - -* minikube starts services that may be available on the Internet. Please ensure that you have a firewall to protect your host from unexpected access. For instance: - * apiserver listens on TCP *:8443 - * kubelet listens on TCP *:10250 and *:10255 - * kube-scheduler listens on TCP *:10259 - * kube-controller listens on TCP *:10257 -* Containers may have full access to your filesystem. -* Containers may be able to execute arbitrary code on your host, by using container escape vulnerabilities such as [CVE-2019-5736](https://access.redhat.com/security/vulnerabilities/runcescape). Please keep your release of minikube up to date. - -### Decreased reliability - -* minikube with the none driver may be tricky to configure correctly at first, because there are many more chances for interference with other locally run services, such as dnsmasq. - -* When run in `none` mode, minikube has no built-in resource limit mechanism, which means you could deploy pods which would consume all of the hosts resources. - -* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, containerd, cri-o. - -### Data loss - -With the `none` driver, minikube will overwrite the following system paths: - -* /usr/bin/kubeadm - Updated to match the exact version of Kubernetes selected -* /usr/bin/kubelet - Updated to match the exact version of Kubernetes selected -* /etc/kubernetes - configuration files - -These paths will be erased when running `minikube delete`: - -* /data/minikube -* /etc/kubernetes/manifests -* /var/lib/minikube - -As Kubernetes has full access to both your filesystem as well as your docker images, it is possible that other unexpected data loss issues may arise. - -## Environment variables - -Some environment variables may be useful for using the `none` driver: - -* **CHANGE_MINIKUBE_NONE_USER**: Sets file ownership to the user running sudo ($SUDO_USER) -* **MINIKUBE_HOME**: Saves all files to this directory instead of $HOME -* **MINIKUBE_WANTUPDATENOTIFICATION**: Toggles the notification that your version of minikube is obsolete -* **MINIKUBE_WANTREPORTERRORPROMPT**: Toggles the error reporting prompt -* **MINIKUBE_IN_STYLE**: Toggles color output and emoji usage - -## Known Issues - -* `systemctl` is required. [#2704](https://github.com/kubernetes/minikube/issues/2704) -* `-p` (profiles) are unsupported: It is not possible to run more than one `--vm-driver=none` instance -* Many `minikube` commands are not supported, such as: `dashboard`, `mount`, `ssh` -* minikube with the `none` driver has a confusing permissions model, as some commands need to be run as root ("start"), and others by a regular user ("dashboard") -* CoreDNS detects resolver loop, goes into CrashloopBackoff - [#3511](https://github.com/kubernetes/minikube/issues/3511) -* Some versions of Linux have a version of docker that is newer then what Kubernetes expects. To overwrite this, run minikube with the following parameters: `sudo -E minikube start --vm-driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification` -* On Ubuntu 18.04 (and probably others), because of how `systemd-resolve` is configured by default, one needs to bypass the default `resolv.conf` file and use a different one instead. - - In this case, you should use this file: `/run/systemd/resolve/resolv.conf` - - `sudo -E minikube --vm-driver=none start --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf` - - Apperently, though, if `resolve.conf` is too big (about 10 lines!!!), one gets the following error: `Waiting for pods: apiserver proxy! Error restarting cluster: wait: waiting for k8s-app=kube-proxy: timed out waiting for the condition` - - This error happens in Kubernetes 0.11.x, 0.12.x and 0.13.x, but *not* in 0.14.x - - If that's your case, try this: - - `grep -E "^nameserver" /run/systemd/resolve/resolv.conf |head -n 3 > /tmp/resolv.conf && sudo -E minikube --vm-driver=none start --extra-config=kubelet.resolv-conf=/tmp/resolv.conf` - -* [Full list of open 'none' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fnone-driver) +This document has moved to https://minikube.sigs.k8s.io/docs/reference/drivers/none/ diff --git a/go.mod b/go.mod index 39ca21b95d..7934361b6a 100644 --- a/go.mod +++ b/go.mod @@ -9,12 +9,12 @@ require ( github.com/blang/semver v3.5.0+incompatible github.com/c4milo/gotoolkit v0.0.0-20170318115440-bcc06269efa9 // indirect github.com/cenkalti/backoff v2.2.1+incompatible - github.com/cheggaaa/pb v1.0.27 + github.com/cheggaaa/pb/v3 v3.0.1 github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/docker/docker v1.13.1 // indirect github.com/docker/go-units v0.3.3 - github.com/docker/machine v0.16.1-0.20190718054102-a555e4f7a8f5 + github.com/docker/machine v0.7.1-0.20190718054102-a555e4f7a8f5 // version is 0.7.1 to pin to a555e4f7a8f5 github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect github.com/go-ole/go-ole v1.2.4 // indirect @@ -35,7 +35,6 @@ require ( github.com/johanneswuerbach/nfsexports v0.0.0-20181204082207-1aa528dcb345 github.com/libvirt/libvirt-go v3.4.0+incompatible github.com/machine-drivers/docker-machine-driver-vmware v0.1.1 - github.com/mattn/go-colorable v0.1.2 // indirect github.com/mattn/go-isatty v0.0.8 github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 github.com/moby/hyperkit v0.0.0-20171020124204-a12cd7250bcd diff --git a/go.sum b/go.sum index d984677ef8..3d2c511828 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ github.com/Sirupsen/logrus v0.0.0-20170822132746-89742aefa4b2 h1:k1A7eIeUk6rnX2y github.com/Sirupsen/logrus v0.0.0-20170822132746-89742aefa4b2/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM= +github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -59,6 +61,8 @@ github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6Z github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/cheggaaa/pb/v3 v3.0.1 h1:m0BngUk2LuSRYdx4fujDKNRXNDpbNCfptPfVT2m6OJY= +github.com/cheggaaa/pb/v3 v3.0.1/go.mod h1:SqqeMF/pMOIu3xgGoxtPYhMNQP258xE4x/XRTYua+KU= github.com/client9/misspell v0.0.0-20170928000206-9ce5d979ffda/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cfssl v0.0.0-20180726162950-56268a613adf/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= @@ -106,8 +110,8 @@ github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libnetwork v0.0.0-20180830151422-a9cd636e3789/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= -github.com/docker/machine v0.16.1-0.20190718054102-a555e4f7a8f5 h1:5OiV/JwT55JRKNJsM9HZrTlJH/TRp97Ee89ahtB78+w= -github.com/docker/machine v0.16.1-0.20190718054102-a555e4f7a8f5/go.mod h1:I8mPNDeK1uH+JTcUU7X0ZW8KiYz0jyAgNaeSJ1rCfDI= +github.com/docker/machine v0.7.1-0.20190718054102-a555e4f7a8f5 h1:/2G2PrqxKga8hAVGPri/5NEv24rvDwXoH5pjPXUBCpA= +github.com/docker/machine v0.7.1-0.20190718054102-a555e4f7a8f5/go.mod h1:I8mPNDeK1uH+JTcUU7X0ZW8KiYz0jyAgNaeSJ1rCfDI= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= diff --git a/hack/conformance_tests.sh b/hack/conformance_tests.sh index eb1564e58e..cff11af0a3 100755 --- a/hack/conformance_tests.sh +++ b/hack/conformance_tests.sh @@ -56,7 +56,7 @@ name: minikube version: ${version} website_url: https://github.com/kubernetes/minikube repo_url: https://github.com/kubernetes/minikube -documentation_url: https://github.com/kubernetes/minikube/blob/master/docs/README.md +documentation_url: https://minikube.sigs.k8s.io/docs/ product_logo_url: https://raw.githubusercontent.com/kubernetes/minikube/master/images/logo/logo.svg type: installer description: minikube runs a local Kubernetes cluster on macOS, Linux, and Windows. diff --git a/hack/jenkins/minikube_cross_build_and_upload.sh b/hack/jenkins/minikube_cross_build_and_upload.sh index 25167ae42e..adbb0189da 100755 --- a/hack/jenkins/minikube_cross_build_and_upload.sh +++ b/hack/jenkins/minikube_cross_build_and_upload.sh @@ -49,8 +49,8 @@ git diff ${ghprbActualCommit} --name-only \ | grep -q deploy/iso/minikube && rebuild=1 || rebuild=0 if [[ "${rebuild}" -eq 1 ]]; then - echo "ISO changes detected ... rebuilding ISO" - make release-iso + echo "ISO changes detected ... rebuilding ISO" + make release-iso fi cp -r test/integration/testdata out/ diff --git a/hack/jenkins/minikube_set_pending.sh b/hack/jenkins/minikube_set_pending.sh index 23d3511b9e..a595773ff8 100755 --- a/hack/jenkins/minikube_set_pending.sh +++ b/hack/jenkins/minikube_set_pending.sh @@ -36,7 +36,7 @@ jobs=( 'Hyper-V_Windows' 'VirtualBox_Linux' 'VirtualBox_macOS' - 'VirtualBox_Windows' + 'VirtualBox_Windows' # 'KVM-GPU_Linux' - Disabled 'KVM_Linux' 'none_Linux' diff --git a/images/help_wanted.jpg b/images/help_wanted.jpg deleted file mode 100644 index 4805bb0c38..0000000000 Binary files a/images/help_wanted.jpg and /dev/null differ diff --git a/images/start.jpg b/images/start.jpg deleted file mode 100644 index 9b4d163596..0000000000 Binary files a/images/start.jpg and /dev/null differ diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index fac07583b1..e783da55da 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -40,9 +40,6 @@ import ( hyperkit "github.com/moby/hyperkit/go" "github.com/pkg/errors" pkgdrivers "k8s.io/minikube/pkg/drivers" - - "k8s.io/minikube/pkg/minikube/constants" - commonutil "k8s.io/minikube/pkg/util" ) const ( @@ -77,7 +74,6 @@ func NewDriver(hostName, storePath string) *Driver { SSHUser: "docker", }, CommonDriver: &pkgdrivers.CommonDriver{}, - DiskSize: commonutil.CalculateSizeInMB(constants.DefaultDiskSize), } } @@ -121,7 +117,7 @@ func (d *Driver) Create() error { // DriverName returns the name of the driver func (d *Driver) DriverName() string { - return constants.DriverHyperkit + return "hyperkit" } // GetSSHHostname returns hostname for use with ssh @@ -227,7 +223,7 @@ func (d *Driver) Start() error { h.Memory = d.Memory h.UUID = d.UUID // This should stream logs from hyperkit, but doesn't seem to work. - logger := golog.New(os.Stderr, constants.DriverHyperkit, golog.LstdFlags) + logger := golog.New(os.Stderr, "hyperkit", golog.LstdFlags) h.SetLogger(logger) if vsockPorts, err := d.extractVSockPorts(); err != nil { @@ -269,12 +265,25 @@ func (d *Driver) Start() error { d.IPAddress, err = GetIPAddressByMACAddress(mac) if err != nil { - return &commonutil.RetriableError{Err: err} + return &tempError{err} } return nil } - if err := commonutil.RetryAfter(30, getIP, 2*time.Second); err != nil { + // Implement a retry loop without calling any minikube code + for i := 0; i < 30; i++ { + log.Debugf("Attempt %d", i) + err = getIP() + if err == nil { + break + } + if _, ok := err.(*tempError); !ok { + return err + } + time.Sleep(2 * time.Second) + } + + if err != nil { return fmt.Errorf("IP address never found in dhcp leases file %v", err) } log.Debugf("IP: %s", d.IPAddress) @@ -294,6 +303,14 @@ func (d *Driver) Start() error { return nil } +type tempError struct { + Err error +} + +func (t tempError) Error() string { + return "Temporary error: " + t.Err.Error() +} + //recoverFromUncleanShutdown searches for an existing hyperkit.pid file in //the machine directory. If it can't find it, a clean shutdown is assumed. //If it finds the pid file, it checks for a running hyperkit process with that pid diff --git a/pkg/drivers/kvm/gpu.go b/pkg/drivers/kvm/gpu.go index 6c9043de5b..550846622e 100644 --- a/pkg/drivers/kvm/gpu.go +++ b/pkg/drivers/kvm/gpu.go @@ -110,7 +110,7 @@ func getPassthroughableNVIDIADevices() ([]string, error) { return []string{}, fmt.Errorf("error reading %q: %v", sysKernelIOMMUGroupsPath, err) } if len(iommuGroups) == 0 { - return []string{}, fmt.Errorf("no IOMMU groups found at %q. Make sure your host supports IOMMU. See instructions at https://github.com/kubernetes/minikube/blob/master/docs/gpu.md", sysKernelIOMMUGroupsPath) + return []string{}, fmt.Errorf("no IOMMU groups found at %q. Make sure your host supports IOMMU. See instructions at https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/", sysKernelIOMMUGroupsPath) } // Get list of PCI devices @@ -146,7 +146,7 @@ func getPassthroughableNVIDIADevices() ([]string, error) { return []string{}, fmt.Errorf("no NVIDIA devices found") } if len(unboundNVIDIADevices) == 0 { - return []string{}, fmt.Errorf("some NVIDIA devices were found but none of them were unbound. See instructions at https://github.com/kubernetes/minikube/blob/master/docs/gpu.md") + return []string{}, fmt.Errorf("some NVIDIA devices were found but none of them were unbound. See instructions at https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/") } // Make sure all the unbound devices are in IOMMU groups that only contain unbound devices. @@ -161,7 +161,7 @@ func getPassthroughableNVIDIADevices() ([]string, error) { } } if len(isolatedNVIDIADevices) == 0 { - return []string{}, fmt.Errorf("some unbound NVIDIA devices were found but they had other devices in their IOMMU group that were bound. See instructoins at https://github.com/kubernetes/minikube/blob/master/docs/gpu.md") + return []string{}, fmt.Errorf("some unbound NVIDIA devices were found but they had other devices in their IOMMU group that were bound. See instructoins at https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/") } return isolatedNVIDIADevices, nil diff --git a/pkg/drivers/kvm/kvm.go b/pkg/drivers/kvm/kvm.go index 76dac5b9fb..236fbd2167 100644 --- a/pkg/drivers/kvm/kvm.go +++ b/pkg/drivers/kvm/kvm.go @@ -25,10 +25,6 @@ import ( "syscall" "time" - "k8s.io/minikube/pkg/minikube/config" - "k8s.io/minikube/pkg/minikube/constants" - "k8s.io/minikube/pkg/util" - "github.com/docker/machine/libmachine/drivers" "github.com/docker/machine/libmachine/log" "github.com/docker/machine/libmachine/state" @@ -102,14 +98,8 @@ func NewDriver(hostName, storePath string) *Driver { SSHUser: "docker", }, CommonDriver: &pkgdrivers.CommonDriver{}, - Boot2DockerURL: constants.DefaultISOURL, - CPU: constants.DefaultCPUS, - DiskSize: util.CalculateSizeInMB(constants.DefaultDiskSize), - Memory: util.CalculateSizeInMB(constants.DefaultMemorySize), PrivateNetwork: defaultPrivateNetworkName, Network: defaultNetworkName, - DiskPath: filepath.Join(constants.GetMinipath(), "machines", config.GetMachineName(), fmt.Sprintf("%s.rawdisk", config.GetMachineName())), - ISO: filepath.Join(constants.GetMinipath(), "machines", config.GetMachineName(), "boot2docker.iso"), ConnectionURI: qemusystem, } } @@ -224,7 +214,7 @@ func (d *Driver) GetSSHHostname() (string, error) { // DriverName returns the name of the driver func (d *Driver) DriverName() string { - return constants.DriverKvm2 + return "kvm2" } // Kill stops a host forcefully, including any containers that we are managing. diff --git a/pkg/drivers/none/none.go b/pkg/drivers/none/none.go index 6c3a5cfef4..3af469b345 100644 --- a/pkg/drivers/none/none.go +++ b/pkg/drivers/none/none.go @@ -44,7 +44,7 @@ var cleanupPaths = []string{ } // Driver is a driver designed to run kubeadm w/o VM management, and assumes systemctl. -// https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md +// https://minikube.sigs.k8s.io/docs/reference/drivers/none/ type Driver struct { *drivers.BaseDriver *pkgdrivers.CommonDriver diff --git a/pkg/minikube/bootstrapper/certs.go b/pkg/minikube/bootstrapper/certs.go index d235c1eadf..9a690f5b44 100644 --- a/pkg/minikube/bootstrapper/certs.go +++ b/pkg/minikube/bootstrapper/certs.go @@ -32,6 +32,7 @@ import ( "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/util" ) @@ -64,7 +65,7 @@ func SetupCerts(cmd command.Runner, k8s config.KubernetesConfig) error { copyableFiles = append(copyableFiles, certFile) } - kubeCfgSetup := &util.KubeConfigSetup{ + kcs := &kubeconfig.Settings{ ClusterName: k8s.NodeName, ClusterServerAddress: fmt.Sprintf("https://localhost:%d", k8s.NodePort), ClientCertificate: path.Join(constants.GuestCertsDir, "apiserver.crt"), @@ -74,7 +75,7 @@ func SetupCerts(cmd command.Runner, k8s config.KubernetesConfig) error { } kubeCfg := api.NewConfig() - err := util.PopulateKubeConfig(kubeCfgSetup, kubeCfg) + err := kubeconfig.PopulateFromSettings(kcs, kubeCfg) if err != nil { return errors.Wrap(err, "populating kubeconfig") } diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index d96fe6ea99..f2d3a8b21c 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -587,7 +587,7 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, er // In case of no port assigned, use util.APIServerPort nodePort := k8s.NodePort if nodePort <= 0 { - nodePort = util.APIServerPort + nodePort = constants.APIServerPort } opts := struct { diff --git a/pkg/minikube/cluster/cluster.go b/pkg/minikube/cluster/cluster.go index cbf82a9947..0e198e0b6e 100644 --- a/pkg/minikube/cluster/cluster.go +++ b/pkg/minikube/cluster/cluster.go @@ -414,7 +414,7 @@ func createHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error if config.VMDriver == constants.DriverVmwareFusion && viper.GetBool(cfg.ShowDriverDeprecationNotification) { out.WarningT(`The vmwarefusion driver is deprecated and support for it will be removed in a future release. Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver. - See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information. + See https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information. To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`) } if !localDriver(config.VMDriver) { diff --git a/pkg/minikube/config/config.go b/pkg/minikube/config/config.go index 11268ec138..d8a7636e7c 100644 --- a/pkg/minikube/config/config.go +++ b/pkg/minikube/config/config.go @@ -21,9 +21,8 @@ import ( "errors" "fmt" "io" - "os" - "io/ioutil" + "os" "github.com/spf13/viper" "k8s.io/minikube/pkg/minikube/constants" @@ -152,10 +151,10 @@ type simpleConfigLoader struct{} // DefaultLoader is the default config loader var DefaultLoader Loader = &simpleConfigLoader{} -func (c *simpleConfigLoader) LoadConfigFromFile(profile string, miniHome ...string) (*Config, error) { +func (c *simpleConfigLoader) LoadConfigFromFile(profileName string, miniHome ...string) (*Config, error) { var cc Config - - path := constants.GetProfileFile(profile, miniHome...) + // Move to profile package + path := profileFilePath(profileName, miniHome...) if _, err := os.Stat(path); os.IsNotExist(err) { return nil, err diff --git a/pkg/minikube/config/profile.go b/pkg/minikube/config/profile.go index bd56d070bd..59834e6e73 100644 --- a/pkg/minikube/config/profile.go +++ b/pkg/minikube/config/profile.go @@ -17,9 +17,12 @@ limitations under the License. package config import ( + "encoding/json" "io/ioutil" + "os" "path/filepath" + "github.com/golang/glog" "k8s.io/minikube/pkg/minikube/constants" ) @@ -34,6 +37,76 @@ func (p *Profile) isValid() bool { return true } +// ProfileExists returns true if there is a profile config (regardless of being valid) +func ProfileExists(name string, miniHome ...string) bool { + miniPath := constants.GetMinipath() + if len(miniHome) > 0 { + miniPath = miniHome[0] + } + + p := profileFilePath(name, miniPath) + _, err := os.Stat(p) + return err == nil +} + +// CreateProfile creates an empty profile stores in $MINIKUBE_HOME/profiles//config.json +func CreateEmptyProfile(name string, miniHome ...string) error { + cfg := &Config{} + return CreateProfile(name, cfg, miniHome...) +} + +// CreateProfile creates an profile out of the cfg and stores in $MINIKUBE_HOME/profiles//config.json +func CreateProfile(name string, cfg *Config, miniHome ...string) error { + data, err := json.MarshalIndent(cfg, "", " ") + if err != nil { + return err + } + glog.Infof("Saving config:\n%s", data) + path := profileFilePath(name, miniHome...) + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { + return err + } + + // If no config file exists, don't worry about swapping paths + if _, err := os.Stat(path); os.IsNotExist(err) { + if err := ioutil.WriteFile(path, data, 0600); err != nil { + return err + } + return nil + } + + tf, err := ioutil.TempFile(filepath.Dir(path), "config.json.tmp") + if err != nil { + return err + } + defer os.Remove(tf.Name()) + + if err = ioutil.WriteFile(tf.Name(), data, 0600); err != nil { + return err + } + + if err = tf.Close(); err != nil { + return err + } + + if err = os.Remove(path); err != nil { + return err + } + + if err = os.Rename(tf.Name(), path); err != nil { + return err + } + return nil +} + +func DeleteProfile(profile string, miniHome ...string) error { + miniPath := constants.GetMinipath() + if len(miniHome) > 0 { + miniPath = miniHome[0] + } + return os.RemoveAll(profileFolderPath(profile, miniPath)) +} + // ListProfiles returns all valid and invalid (if any) minikube profiles // invalidPs are the profiles that have a directory or config file but not usable // invalidPs would be suggeted to be deleted @@ -82,3 +155,22 @@ func profileDirs(miniHome ...string) (dirs []string, err error) { } return dirs, err } + +// profileFilePath returns the Minikube profile config file +func profileFilePath(profile string, miniHome ...string) string { + miniPath := constants.GetMinipath() + if len(miniHome) > 0 { + miniPath = miniHome[0] + } + + return filepath.Join(miniPath, "profiles", profile, "config.json") +} + +// profileFolderPath returns path of profile folder +func profileFolderPath(profile string, miniHome ...string) string { + miniPath := constants.GetMinipath() + if len(miniHome) > 0 { + miniPath = miniHome[0] + } + return filepath.Join(miniPath, "profiles", profile) +} diff --git a/pkg/minikube/config/profile_test.go b/pkg/minikube/config/profile_test.go index ac96602ee6..2ef38378ac 100644 --- a/pkg/minikube/config/profile_test.go +++ b/pkg/minikube/config/profile_test.go @@ -21,6 +21,7 @@ import ( "testing" ) +// TestListProfiles uses a different uses different MINIKUBE_HOME with rest of tests since it relies on file list index func TestListProfiles(t *testing.T) { miniDir, err := filepath.Abs("./testdata/.minikube") if err != nil { @@ -70,3 +71,124 @@ func TestListProfiles(t *testing.T) { t.Errorf("error listing profiles %v", err) } } + +func TestProfileExists(t *testing.T) { + miniDir, err := filepath.Abs("./testdata/.minikube2") + if err != nil { + t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) + } + + var testCases = []struct { + name string + expected bool + }{ + {"p1", true}, + {"p2", true}, + {"p3_empty", true}, + {"p4_invalid_file", true}, + {"p5_partial_config", true}, + {"p6_no_file", false}, + } + for _, tt := range testCases { + got := ProfileExists(tt.name, miniDir) + if got != tt.expected { + t.Errorf("expected ProfileExists(%q,%q)=%t but got %t ", tt.name, miniDir, tt.expected, got) + } + + } + +} + +func TestCreateEmptyProfile(t *testing.T) { + miniDir, err := filepath.Abs("./testdata/.minikube2") + if err != nil { + t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) + } + + var testCases = []struct { + name string + expectErr bool + }{ + {"p13", false}, + {"p_13", false}, + } + for _, tc := range testCases { + n := tc.name // capturing loop variable + gotErr := CreateEmptyProfile(n, miniDir) + if gotErr != nil && tc.expectErr == false { + t.Errorf("expected CreateEmptyProfile not to error but got err=%v", gotErr) + } + + defer func() { // tear down + err := DeleteProfile(n, miniDir) + if err != nil { + t.Errorf("error test tear down %v", err) + } + }() + + } + +} + +func TestCreateProfile(t *testing.T) { + miniDir, err := filepath.Abs("./testdata/.minikube2") + if err != nil { + t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) + } + + var testCases = []struct { + name string + cfg *Config + expectErr bool + }{ + {"p_empty_config", &Config{}, false}, + {"p_partial_config", &Config{KubernetesConfig: KubernetesConfig{ + ShouldLoadCachedImages: false}}, false}, + {"p_partial_config2", &Config{MachineConfig: MachineConfig{ + KeepContext: false}, KubernetesConfig: KubernetesConfig{ + ShouldLoadCachedImages: false}}, false}, + } + for _, tc := range testCases { + n := tc.name // capturing loop variable + gotErr := CreateProfile(n, tc.cfg, miniDir) + if gotErr != nil && tc.expectErr == false { + t.Errorf("expected CreateEmptyProfile not to error but got err=%v", gotErr) + } + + defer func() { // tear down + + err := DeleteProfile(n, miniDir) + if err != nil { + t.Errorf("error test tear down %v", err) + } + }() + } + +} + +func TestDeleteProfile(t *testing.T) { + miniDir, err := filepath.Abs("./testdata/.minikube2") + if err != nil { + t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) + } + + err = CreateEmptyProfile("existing_prof", miniDir) + if err != nil { + t.Errorf("error setting up TestDeleteProfile %v", err) + } + + var testCases = []struct { + name string + expectErr bool + }{ + {"existing_prof", false}, + {"non_existing_prof", false}, + } + for _, tc := range testCases { + gotErr := DeleteProfile(tc.name, miniDir) + if gotErr != nil && tc.expectErr == false { + t.Errorf("expected CreateEmptyProfile not to error but got err=%v", gotErr) + } + } + +} diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json new file mode 100644 index 0000000000..86699a29bb --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json @@ -0,0 +1,50 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "VMDriver": "hyperkit", + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "XhyveDiskDriver": "ahci-hd", + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "KubernetesVersion": "v1.15.0", + "NodeIP": "192.168.64.75", + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json new file mode 100644 index 0000000000..d77e0221d2 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json @@ -0,0 +1,49 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "VMDriver": "virtualbox", + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "KubernetesVersion": "v1.15.0", + "NodeIP": "192.168.99.136", + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p3_empty/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p3_empty/config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json new file mode 100644 index 0000000000..9e2e347718 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json @@ -0,0 +1 @@ +invalid json file :) \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json new file mode 100644 index 0000000000..29f62c0149 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json @@ -0,0 +1,47 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "XhyveDiskDriver": "ahci-hd", + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index 5716bb4c33..0f7f7708e1 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -37,6 +37,7 @@ type Config struct { // MachineConfig contains the parameters used to start a cluster. type MachineConfig struct { KeepContext bool // used by start and profile command to or not to switch kubectl's current context + EmbedCerts bool // used by kubeconfig.Setup MinikubeISO string Memory int CPUs int diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index bc2085e8e0..d861681bc3 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -31,8 +31,8 @@ import ( minikubeVersion "k8s.io/minikube/pkg/version" ) -// APIServerPort is the port that the API server should listen on. const ( + APIServerPort = 8443 APIServerName = "minikubeCA" ClusterDNSDomain = "cluster.local" ) @@ -129,6 +129,8 @@ func MakeMiniPath(fileName ...string) string { var MountProcessFileName = ".mount-process" const ( + // DefaultEmbedCerts is if the certs should be embedded in the kubeconfig file + DefaultEmbedCerts = false // DefaultKeepContext is if we should keep context by default DefaultKeepContext = false // SHASuffix is the suffix of a SHA-256 checksum file @@ -208,6 +210,12 @@ func GetProfilePath(profile string, miniHome ...string) string { return filepath.Join(miniPath, "profiles", profile) } +// AddonsPath is the default path of the addons configuration +const AddonsPath = "/etc/kubernetes/addons" + +// FilesPath is the default path of files +const FilesPath = "/files" + const ( // KubeletServiceFile is the path to the kubelet systemd service KubeletServiceFile = "/lib/systemd/system/kubelet.service" @@ -421,5 +429,5 @@ const ( const ( // DriverDocumentation the documentation of the KVM driver - DriverDocumentation = "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md" + DriverDocumentation = "https://minikube.sigs.k8s.io/docs/reference/drivers/" ) diff --git a/pkg/minikube/extract/extract.go b/pkg/minikube/extract/extract.go index b8b1b806f2..2ee8cbb281 100644 --- a/pkg/minikube/extract/extract.go +++ b/pkg/minikube/extract/extract.go @@ -35,16 +35,15 @@ import ( // blacklist is a list of strings to explicitly omit from translation files. var blacklist = []string{ - "%s: %v", - "%s.%s=%s", - "%s/%d", - "%s=%s", - "%v", - "GID: %s", - "MSize: %d", - "UID: %s", - "env %s", - "opt %s", + "{{.error}}", + "{{.url}}", + "{{.msg}}: {{.err}}", + "{{.key}}={{.value}}", + "opt {{.docker_option}}", + "kube-system", + "env {{.docker_env}}", + "\\n", + "==\u003e {{.name}} \u003c==", } // ErrMapFile is a constant to refer to the err_map file, which contains the Advice strings. @@ -194,6 +193,11 @@ func checkNode(stmt ast.Node, e *state) { if expr, ok := stmt.(*ast.CallExpr); ok { checkCallExpression(expr, e) } + + // Check all key value pairs for possible help text + if kvp, ok := stmt.(*ast.KeyValueExpr); ok { + checkKeyValueExpression(kvp, e) + } } // checkCallExpression takes a function call, and checks its arguments for strings @@ -216,6 +220,10 @@ func checkCallExpression(s *ast.CallExpr, e *state) { // Parse out the package of the call sfi, ok := sf.X.(*ast.Ident) if !ok { + if sfc, ok := sf.X.(*ast.CallExpr); ok { + extractFlagHelpText(s, sfc, e) + return + } return } packageName = sfi.Name @@ -242,12 +250,14 @@ func checkCallExpression(s *ast.CallExpr, e *state) { checkArguments(s, e) } +// checkArguments checks the arguments of a function call for strings func checkArguments(s *ast.CallExpr, e *state) { matched := false for _, arg := range s.Args { // This argument is an identifier. if i, ok := arg.(*ast.Ident); ok { - if checkIdentForStringValue(i, e) { + if s := checkIdentForStringValue(i); s != "" { + e.translations[s] = "" matched = true break } @@ -255,13 +265,15 @@ func checkArguments(s *ast.CallExpr, e *state) { // This argument is a string. if argString, ok := arg.(*ast.BasicLit); ok { - if addStringToList(argString.Value, e) { + if s := checkString(argString.Value); s != "" { + e.translations[s] = "" matched = true break } } } + // No string arguments were found, check everything the calls this function for strings if !matched { addParentFuncToList(e) } @@ -269,38 +281,47 @@ func checkArguments(s *ast.CallExpr, e *state) { } // checkIdentForStringValye takes a identifier and sees if it's a variable assigned to a string -func checkIdentForStringValue(i *ast.Ident, e *state) bool { +func checkIdentForStringValue(i *ast.Ident) string { // This identifier is nil if i.Obj == nil { - return false + return "" } - as, ok := i.Obj.Decl.(*ast.AssignStmt) + var s string + + // This identifier was directly assigned a value + if as, ok := i.Obj.Decl.(*ast.AssignStmt); ok { + if rhs, ok := as.Rhs[0].(*ast.BasicLit); ok { + s = rhs.Value + } - // This identifier wasn't assigned anything - if !ok { - return false } - rhs, ok := as.Rhs[0].(*ast.BasicLit) - - // This identifier was not assigned a string/basic value - if !ok { - return false + // This Identifier is part of the const or var declaration + if vs, ok := i.Obj.Decl.(*ast.ValueSpec); ok { + for j, n := range vs.Names { + if n.Name == i.Name { + if len(vs.Values) < j+1 { + // There's no way anything was assigned here, abort + return "" + } + if v, ok := vs.Values[j].(*ast.BasicLit); ok { + s = v.Value + break + } + } + } } - if addStringToList(rhs.Value, e) { - return true - } + return checkString(s) - return false } -// addStringToList takes a string, makes sure it's meant to be translated then adds it to the list if so -func addStringToList(s string, e *state) bool { +// checkString checks if a string is meant to be translated +func checkString(s string) string { // Empty strings don't need translating if len(s) <= 2 { - return false + return "" } // Parse out quote marks @@ -308,29 +329,108 @@ func addStringToList(s string, e *state) bool { // Don't translate integers if _, err := strconv.Atoi(stringToTranslate); err == nil { - return false + return "" } // Don't translate URLs if u, err := url.Parse(stringToTranslate); err == nil && u.Scheme != "" && u.Host != "" { - return false + return "" } // Don't translate commands if strings.HasPrefix(stringToTranslate, "sudo ") { - return false + return "" } // Don't translate blacklisted strings for _, b := range blacklist { if b == stringToTranslate { - return false + return "" } } // Hooray, we can translate the string! - e.translations[stringToTranslate] = "" - return true + return stringToTranslate +} + +// checkKeyValueExpression checks all kvps for help text +func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) { + // The key must be an identifier + i, ok := kvp.Key.(*ast.Ident) + if !ok { + return + } + + // Specifically, it needs to be "Short" or "Long" + if i.Name == "Short" || i.Name == "Long" { + // The help text is directly a string, the most common case + if help, ok := kvp.Value.(*ast.BasicLit); ok { + s := checkString(help.Value) + if s != "" { + e.translations[s] = "" + } + } + + // The help text is assigned to a variable, only happens if it's very long + if help, ok := kvp.Value.(*ast.Ident); ok { + s := checkIdentForStringValue(help) + if s != "" { + e.translations[s] = "" + } + } + + // Ok now this is just a mess + if help, ok := kvp.Value.(*ast.BinaryExpr); ok { + s := checkBinaryExpression(help, e) + if s != "" { + e.translations[s] = "" + } + } + } +} + +// checkBinaryExpression checks binary expressions, stuff of the form x + y, for strings and concats them +func checkBinaryExpression(b *ast.BinaryExpr, e *state) string { + // Check the left side + var s string + if l, ok := b.X.(*ast.BasicLit); ok { + if x := checkString(l.Value); x != "" { + s += x + } + } + + if i, ok := b.X.(*ast.Ident); ok { + if x := checkIdentForStringValue(i); x != "" { + s += x + } + } + + if b1, ok := b.X.(*ast.BinaryExpr); ok { + if x := checkBinaryExpression(b1, e); x != "" { + s += x + } + } + + //Check the right side + if l, ok := b.Y.(*ast.BasicLit); ok { + if x := checkString(l.Value); x != "" { + s += x + } + } + + if i, ok := b.Y.(*ast.Ident); ok { + if x := checkIdentForStringValue(i); x != "" { + s += x + } + } + + if b1, ok := b.Y.(*ast.BinaryExpr); ok { + if x := checkBinaryExpression(b1, e); x != "" { + s += x + } + } + + return s } // writeStringsToFiles writes translations to all translation files in output @@ -411,10 +511,37 @@ func extractAdvice(f ast.Node, e *state) error { if i.Name == "Advice" { // At this point we know the value in the kvp is guaranteed to be a string advice, _ := kvp.Value.(*ast.BasicLit) - addStringToList(advice.Value, e) + s := checkString(advice.Value) + if s != "" { + e.translations[s] = "" + } } return true }) return nil } + +// extractFlagHelpText finds usage text for all command flags and adds them to the list to translate +func extractFlagHelpText(c *ast.CallExpr, sfc *ast.CallExpr, e *state) { + // We're looking for calls of the form cmd.Flags().VarP() + flags, ok := sfc.Fun.(*ast.SelectorExpr) + if !ok { + return + } + + if flags.Sel.Name != "Flags" || len(c.Args) == 1 { + return + } + + // The usage text for flags is always the final argument in the Flags() call + usage, ok := c.Args[len(c.Args)-1].(*ast.BasicLit) + if !ok { + // Something has gone wrong, abort + return + } + s := checkString(usage.Value) + if s != "" { + e.translations[s] = "" + } +} diff --git a/pkg/minikube/kubeconfig/context.go b/pkg/minikube/kubeconfig/context.go new file mode 100644 index 0000000000..f082acdc4a --- /dev/null +++ b/pkg/minikube/kubeconfig/context.go @@ -0,0 +1,93 @@ +/* +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. +*/ + +package kubeconfig + +import ( + "github.com/golang/glog" + "github.com/pkg/errors" + "k8s.io/client-go/tools/clientcmd/api" +) + +// UnsetCurrentContext unsets the current-context from minikube to "" on minikube stop +func UnsetCurrentContext(machineName string, configPath ...string) error { + fPath := PathFromEnv() + if configPath != nil { + fPath = configPath[0] + } + kCfg, err := readOrNew(fPath) + if err != nil { + return errors.Wrap(err, "Error getting kubeconfig status") + } + + // Unset current-context only if profile is the current-context + if kCfg.CurrentContext == machineName { + kCfg.CurrentContext = "" + if err := writeToFile(kCfg, fPath); err != nil { + return errors.Wrap(err, "writing kubeconfig") + } + return nil + } + + return nil +} + +// SetCurrentContext sets the kubectl's current-context +func SetCurrentContext(name string, configPath ...string) error { + fPath := PathFromEnv() + if configPath != nil { + fPath = configPath[0] + } + kcfg, err := readOrNew(fPath) + if err != nil { + return errors.Wrap(err, "Error getting kubeconfig status") + } + kcfg.CurrentContext = name + if err := writeToFile(kcfg, fPath); err != nil { + return errors.Wrap(err, "writing kubeconfig") + } + return nil +} + +// DeleteContext deletes the specified machine's kubeconfig context +func DeleteContext(machineName string, configPath ...string) error { + fPath := PathFromEnv() + if configPath != nil { + fPath = configPath[0] + } + kcfg, err := readOrNew(fPath) + if err != nil { + return errors.Wrap(err, "Error getting kubeconfig status") + } + + if kcfg == nil || api.IsConfigEmpty(kcfg) { + glog.V(2).Info("kubeconfig is empty") + return nil + } + + delete(kcfg.Clusters, machineName) + delete(kcfg.AuthInfos, machineName) + delete(kcfg.Contexts, machineName) + + if kcfg.CurrentContext == machineName { + kcfg.CurrentContext = "" + } + + if err := writeToFile(kcfg, fPath); err != nil { + return errors.Wrap(err, "writing kubeconfig") + } + return nil +} diff --git a/pkg/minikube/kubeconfig/context_test.go b/pkg/minikube/kubeconfig/context_test.go new file mode 100644 index 0000000000..29a3b604ca --- /dev/null +++ b/pkg/minikube/kubeconfig/context_test.go @@ -0,0 +1,147 @@ +/* +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. +*/ + +package kubeconfig + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" +) + +func TestDeleteContext(t *testing.T) { + fn := tempFile(t, fakeKubeCfg) + if err := DeleteContext("la-croix", fn); err != nil { + t.Fatal(err) + } + + cfg, err := readOrNew(fn) + if err != nil { + t.Fatal(err) + } + + if len(cfg.AuthInfos) != 0 { + t.Fail() + } + + if len(cfg.Clusters) != 0 { + t.Fail() + } + + if len(cfg.Contexts) != 0 { + t.Fail() + } +} + +func TestSetCurrentContext(t *testing.T) { + f, err := ioutil.TempFile("/tmp", "kubeconfig") + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + defer os.Remove(f.Name()) + + kcfg, err := readOrNew(f.Name()) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + if kcfg.CurrentContext != "" { + t.Errorf("Expected empty context but got %v", kcfg.CurrentContext) + } + + contextName := "minikube" + err = SetCurrentContext(contextName, f.Name()) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + defer func() { + err := UnsetCurrentContext(contextName, f.Name()) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + }() + + kcfg, err = readOrNew(f.Name()) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + if kcfg.CurrentContext != contextName { + t.Errorf("Expected context name %s but got %v : ", contextName, kcfg.CurrentContext) + } +} + +func TestUnsetCurrentContext(t *testing.T) { + fn := filepath.Join("testdata", "kubeconfig", "config1") + contextName := "minikube" + + cfg, err := readOrNew(fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + if cfg.CurrentContext != contextName { + t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) + } + + err = UnsetCurrentContext(contextName, fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + defer func() { + err := SetCurrentContext(contextName, fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + }() + + cfg, err = readOrNew(fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + if cfg.CurrentContext != "" { + t.Errorf("Expected empty context but got %v", cfg.CurrentContext) + } +} + +func TestUnsetCurrentContextOnlyChangesIfProfileIsTheCurrentContext(t *testing.T) { + contextName := "minikube" + + fn := filepath.Join("testdata", "kubeconfig", "config2") + cfg, err := readOrNew(fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + if cfg.CurrentContext != contextName { + t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) + } + + err = UnsetCurrentContext("differentContextName", fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + cfg, err = readOrNew(fn) + if err != nil { + t.Fatalf("Error not expected but got %v", err) + } + + if cfg.CurrentContext != contextName { + t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) + } +} diff --git a/pkg/minikube/kubeconfig/kubeconfig.go b/pkg/minikube/kubeconfig/kubeconfig.go new file mode 100644 index 0000000000..bfe6ce8ed0 --- /dev/null +++ b/pkg/minikube/kubeconfig/kubeconfig.go @@ -0,0 +1,241 @@ +/* +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. +*/ + +package kubeconfig + +import ( + "fmt" + "io/ioutil" + "net" + "net/url" + "os" + "path/filepath" + "strconv" + + "github.com/golang/glog" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/tools/clientcmd/api/latest" + "k8s.io/minikube/pkg/minikube/constants" + pkgutil "k8s.io/minikube/pkg/util" +) + +// IsClusterInConfig verifies the ip stored in kubeconfig. +func IsClusterInConfig(ip net.IP, clusterName string, configPath ...string) (bool, error) { + path := PathFromEnv() + if configPath != nil { + path = configPath[0] + } + if ip == nil { + return false, fmt.Errorf("error, empty ip passed") + } + kip, err := extractIP(clusterName, path) + if err != nil { + return false, err + } + if kip.Equal(ip) { + return true, nil + } + // Kubeconfig IP misconfigured + return false, nil + +} + +// Port returns the Port number stored for minikube in the kubeconfig specified +func Port(clusterName string, configPath ...string) (int, error) { + path := PathFromEnv() + if configPath != nil { + path = configPath[0] + } + cfg, err := readOrNew(path) + if err != nil { + return 0, errors.Wrap(err, "Error getting kubeconfig status") + } + cluster, ok := cfg.Clusters[clusterName] + if !ok { + return 0, errors.Errorf("Kubeconfig does not have a record of the machine cluster") + } + kurl, err := url.Parse(cluster.Server) + if err != nil { + return constants.APIServerPort, nil + } + _, kport, err := net.SplitHostPort(kurl.Host) + if err != nil { + return constants.APIServerPort, nil + } + port, err := strconv.Atoi(kport) + return port, err +} + +// PathFromEnv() gets the path to the first kubeconfig +func PathFromEnv() string { + kubeConfigEnv := os.Getenv(constants.KubeconfigEnvVar) + if kubeConfigEnv == "" { + return constants.KubeconfigPath + } + return filepath.SplitList(kubeConfigEnv)[0] +} + +// extractIP returns the IP address stored for minikube in the kubeconfig specified +func extractIP(machineName string, configPath ...string) (net.IP, error) { + path := PathFromEnv() + if configPath != nil { + path = configPath[0] + } + apiCfg, err := readOrNew(path) + if err != nil { + return nil, errors.Wrap(err, "Error getting kubeconfig status") + } + cluster, ok := apiCfg.Clusters[machineName] + if !ok { + return nil, errors.Errorf("Kubeconfig does not have a record of the machine cluster") + } + kurl, err := url.Parse(cluster.Server) + if err != nil { + return net.ParseIP(cluster.Server), nil + } + kip, _, err := net.SplitHostPort(kurl.Host) + if err != nil { + return net.ParseIP(kurl.Host), nil + } + ip := net.ParseIP(kip) + return ip, nil +} + +// UpdateIP overwrites the IP stored in kubeconfig with the provided IP. +func UpdateIP(ip net.IP, machineName string, configPath ...string) (bool, error) { + path := PathFromEnv() + if configPath != nil { + path = configPath[0] + } + + if ip == nil { + return false, fmt.Errorf("error, empty ip passed") + } + + kip, err := extractIP(machineName, path) + if err != nil { + return false, err + } + if kip.Equal(ip) { + return false, nil + } + kport, err := Port(machineName, path) + if err != nil { + return false, err + } + cfg, err := readOrNew(path) + if err != nil { + return false, errors.Wrap(err, "Error getting kubeconfig status") + } + // Safe to lookup server because if field non-existent getIPFromKubeconfig would have given an error + cfg.Clusters[machineName].Server = "https://" + ip.String() + ":" + strconv.Itoa(kport) + err = writeToFile(cfg, path) + if err != nil { + return false, err + } + // Kubeconfig IP reconfigured + return true, nil +} + +// writeToFile encodes the configuration and writes it to the given file. +// If the file exists, it's contents will be overwritten. +func writeToFile(config runtime.Object, configPath ...string) error { + fPath := PathFromEnv() + if configPath != nil { + fPath = configPath[0] + } + + if config == nil { + glog.Errorf("could not write to '%s': config can't be nil", fPath) + } + + // encode config to YAML + data, err := runtime.Encode(latest.Codec, config) + if err != nil { + return errors.Errorf("could not write to '%s': failed to encode config: %v", fPath, err) + } + + // create parent dir if doesn't exist + dir := filepath.Dir(fPath) + if _, err := os.Stat(dir); os.IsNotExist(err) { + if err = os.MkdirAll(dir, 0755); err != nil { + return errors.Wrapf(err, "Error creating directory: %s", dir) + } + } + + // write with restricted permissions + if err := ioutil.WriteFile(fPath, data, 0600); err != nil { + return errors.Wrapf(err, "Error writing file %s", fPath) + } + if err := pkgutil.MaybeChownDirRecursiveToMinikubeUser(dir); err != nil { + return errors.Wrapf(err, "Error recursively changing ownership for dir: %s", dir) + } + + return nil +} + +// readOrNew retrieves Kubernetes client configuration from a file. +// If no files exists, an empty configuration is returned. +func readOrNew(configPath ...string) (*api.Config, error) { + fPath := PathFromEnv() + if configPath != nil { + fPath = configPath[0] + } + + data, err := ioutil.ReadFile(fPath) + if os.IsNotExist(err) { + return api.NewConfig(), nil + } else if err != nil { + return nil, errors.Wrapf(err, "Error reading file %q", fPath) + } + + // decode config, empty if no bytes + kcfg, err := decode(data) + if err != nil { + return nil, errors.Errorf("could not read config: %v", err) + } + + // initialize nil maps + if kcfg.AuthInfos == nil { + kcfg.AuthInfos = map[string]*api.AuthInfo{} + } + if kcfg.Clusters == nil { + kcfg.Clusters = map[string]*api.Cluster{} + } + if kcfg.Contexts == nil { + kcfg.Contexts = map[string]*api.Context{} + } + + return kcfg, nil +} + +// decode reads a Config object from bytes. +// Returns empty config if no bytes. +func decode(data []byte) (*api.Config, error) { + // if no data, return empty config + if len(data) == 0 { + return api.NewConfig(), nil + } + + kcfg, _, err := latest.Codec.Decode(data, nil, nil) + if err != nil { + return nil, errors.Wrapf(err, "Error decoding config from data: %s", string(data)) + } + + return kcfg.(*api.Config), nil +} diff --git a/pkg/util/kubeconfig_test.go b/pkg/minikube/kubeconfig/kubeconfig_test.go similarity index 73% rename from pkg/util/kubeconfig_test.go rename to pkg/minikube/kubeconfig/kubeconfig_test.go index 3f427f5121..18be965b76 100644 --- a/pkg/util/kubeconfig_test.go +++ b/pkg/minikube/kubeconfig/kubeconfig_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +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. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package kubeconfig import ( "io/ioutil" @@ -25,6 +25,9 @@ import ( "testing" "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/minikube/pkg/minikube/constants" + + "k8s.io/client-go/tools/clientcmd" ) var fakeKubeCfg = []byte(` @@ -93,8 +96,8 @@ users: client-key: /home/la-croix/apiserver.key `) -func TestSetupKubeConfig(t *testing.T) { - setupCfg := &KubeConfigSetup{ +func TestUpdate(t *testing.T) { + setupCfg := &Settings{ ClusterName: "test", ClusterServerAddress: "192.168.1.1:8080", ClientCertificate: "/home/apiserver.crt", @@ -105,7 +108,7 @@ func TestSetupKubeConfig(t *testing.T) { var tests = []struct { description string - cfg *KubeConfigSetup + cfg *Settings existingCfg []byte expected api.Config err bool @@ -125,7 +128,7 @@ func TestSetupKubeConfig(t *testing.T) { }, { description: "keep context", - cfg: &KubeConfigSetup{ + cfg: &Settings{ ClusterName: "test", ClusterServerAddress: "192.168.1.1:8080", ClientCertificate: "/home/apiserver.crt", @@ -144,20 +147,20 @@ func TestSetupKubeConfig(t *testing.T) { if err != nil { t.Fatalf("Error making temp directory %v", err) } - test.cfg.SetKubeConfigFile(filepath.Join(tmpDir, "kubeconfig")) + test.cfg.SetPath(filepath.Join(tmpDir, "kubeconfig")) if len(test.existingCfg) != 0 { - if err := ioutil.WriteFile(test.cfg.GetKubeConfigFile(), test.existingCfg, 0600); err != nil { + if err := ioutil.WriteFile(test.cfg.filePath(), test.existingCfg, 0600); err != nil { t.Fatalf("WriteFile: %v", err) } } - err = SetupKubeConfig(test.cfg) + err = Update(test.cfg) if err != nil && !test.err { t.Errorf("Got unexpected error: %v", err) } if err == nil && test.err { t.Errorf("Expected error but got none") } - config, err := ReadConfigOrNew(test.cfg.GetKubeConfigFile()) + config, err := readOrNew(test.cfg.filePath()) if err != nil { t.Errorf("Error reading kubeconfig file: %v", err) } @@ -174,7 +177,7 @@ func TestSetupKubeConfig(t *testing.T) { } } -func TestGetKubeConfigStatus(t *testing.T) { +func TestIsClusterInConfig(t *testing.T) { var tests = []struct { description string @@ -212,7 +215,7 @@ func TestGetKubeConfigStatus(t *testing.T) { t.Run(test.description, func(t *testing.T) { t.Parallel() configFilename := tempFile(t, test.existing) - statusActual, err := GetKubeConfigStatus(test.ip, configFilename, "minikube") + statusActual, err := IsClusterInConfig(test.ip, "minikube", configFilename) if err != nil && !test.err { t.Errorf("Got unexpected error: %v", err) } @@ -227,7 +230,7 @@ func TestGetKubeConfigStatus(t *testing.T) { } } -func TestUpdateKubeconfigIP(t *testing.T) { +func TestUpdateIP(t *testing.T) { var tests = []struct { description string @@ -269,7 +272,7 @@ func TestUpdateKubeconfigIP(t *testing.T) { t.Run(test.description, func(t *testing.T) { t.Parallel() configFilename := tempFile(t, test.existing) - statusActual, err := UpdateKubeconfigIP(test.ip, configFilename, "minikube") + statusActual, err := UpdateIP(test.ip, "minikube", configFilename) if err != nil && !test.err { t.Errorf("Got unexpected error: %v", err) } @@ -288,7 +291,7 @@ func TestEmptyConfig(t *testing.T) { tmp := tempFile(t, []byte{}) defer os.Remove(tmp) - cfg, err := ReadConfigOrNew(tmp) + cfg, err := readOrNew(tmp) if err != nil { t.Fatalf("could not read config: %v", err) } @@ -319,12 +322,12 @@ func TestNewConfig(t *testing.T) { // write actual filename := filepath.Join(dir, "config") - err = WriteConfig(expected, filename) + err = writeToFile(expected, filename) if err != nil { t.Fatal(err) } - actual, err := ReadConfigOrNew(filename) + actual, err := readOrNew(filename) if err != nil { t.Fatal(err) } @@ -334,7 +337,7 @@ func TestNewConfig(t *testing.T) { } } -func TestGetIPFromKubeConfig(t *testing.T) { +func Test_extractIP(t *testing.T) { var tests = []struct { description string @@ -356,7 +359,7 @@ func TestGetIPFromKubeConfig(t *testing.T) { for _, test := range tests { t.Run(test.description, func(t *testing.T) { configFilename := tempFile(t, test.cfg) - ip, err := getIPFromKubeConfig(configFilename, "minikube") + ip, err := extractIP("minikube", configFilename) if err != nil && !test.err { t.Errorf("Got unexpected error: %v", err) } @@ -370,131 +373,6 @@ func TestGetIPFromKubeConfig(t *testing.T) { } } -func TestDeleteKubeConfigContext(t *testing.T) { - configFilename := tempFile(t, fakeKubeCfg) - if err := DeleteKubeConfigContext(configFilename, "la-croix"); err != nil { - t.Fatal(err) - } - - cfg, err := ReadConfigOrNew(configFilename) - if err != nil { - t.Fatal(err) - } - - if len(cfg.AuthInfos) != 0 { - t.Fail() - } - - if len(cfg.Clusters) != 0 { - t.Fail() - } - - if len(cfg.Contexts) != 0 { - t.Fail() - } -} - -func TestSetCurrentContext(t *testing.T) { - contextName := "minikube" - - kubeConfigFile, err := ioutil.TempFile("/tmp", "kubeconfig") - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - defer os.Remove(kubeConfigFile.Name()) - - cfg, err := ReadConfigOrNew(kubeConfigFile.Name()) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != "" { - t.Errorf("Expected empty context but got %v", cfg.CurrentContext) - } - - err = SetCurrentContext(kubeConfigFile.Name(), contextName) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - defer func() { - err := UnsetCurrentContext(kubeConfigFile.Name(), contextName) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - }() - - cfg, err = ReadConfigOrNew(kubeConfigFile.Name()) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != contextName { - t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) - } -} - -func TestUnsetCurrentContext(t *testing.T) { - kubeConfigFile := "./testdata/kubeconfig/config1" - contextName := "minikube" - - cfg, err := ReadConfigOrNew(kubeConfigFile) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != contextName { - t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) - } - - err = UnsetCurrentContext(kubeConfigFile, contextName) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - defer func() { - err := SetCurrentContext(kubeConfigFile, contextName) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - }() - - cfg, err = ReadConfigOrNew(kubeConfigFile) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != "" { - t.Errorf("Expected empty context but got %v", cfg.CurrentContext) - } -} - -func TestUnsetCurrentContextOnlyChangesIfProfileIsTheCurrentContext(t *testing.T) { - contextName := "minikube" - kubeConfigFile := "./testdata/kubeconfig/config2" - - cfg, err := ReadConfigOrNew(kubeConfigFile) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != contextName { - t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) - } - - err = UnsetCurrentContext(kubeConfigFile, "differentContextName") - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - cfg, err = ReadConfigOrNew(kubeConfigFile) - if err != nil { - t.Fatalf("Error not expected but got %v", err) - } - - if cfg.CurrentContext != contextName { - t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext) - } -} - // tempFile creates a temporary with the provided bytes as its contents. // The caller is responsible for deleting file after use. func tempFile(t *testing.T, data []byte) string { @@ -521,7 +399,7 @@ func minikubeConfig(config *api.Config) { // cluster clusterName := "minikube" cluster := api.NewCluster() - cluster.Server = "https://192.168.99.100:" + strconv.Itoa(APIServerPort) + cluster.Server = "https://192.168.99.100:" + strconv.Itoa(constants.APIServerPort) cluster.CertificateAuthority = "/home/tux/.minikube/apiserver.crt" config.Clusters[clusterName] = cluster @@ -663,3 +541,26 @@ func contextEquals(aContext, bContext *api.Context) bool { } return true } + +func TestGetKubeConfigPath(t *testing.T) { + var tests = []struct { + input string + want string + }{ + { + input: "/home/fake/.kube/.kubeconfig", + want: "/home/fake/.kube/.kubeconfig", + }, + { + input: "/home/fake/.kube/.kubeconfig:/home/fake2/.kubeconfig", + want: "/home/fake/.kube/.kubeconfig", + }, + } + + for _, test := range tests { + os.Setenv(clientcmd.RecommendedConfigPathEnvVar, test.input) + if result := PathFromEnv(); result != test.want { + t.Errorf("Expected first splitted chunk, got: %s", result) + } + } +} diff --git a/pkg/minikube/kubeconfig/settings.go b/pkg/minikube/kubeconfig/settings.go new file mode 100644 index 0000000000..1fb1f2ba26 --- /dev/null +++ b/pkg/minikube/kubeconfig/settings.go @@ -0,0 +1,137 @@ +/* +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. +*/ + +package kubeconfig + +import ( + "io/ioutil" + "sync/atomic" + + "github.com/golang/glog" + "github.com/pkg/errors" + "k8s.io/client-go/tools/clientcmd/api" +) + +// Settings is the minikubes settings for kubeconfig +type Settings struct { + // The name of the cluster for this context + ClusterName string + + // ClusterServerAddress is the address of the kubernetes cluster + ClusterServerAddress string + + // ClientCertificate is the path to a client cert file for TLS. + ClientCertificate string + + // CertificateAuthority is the path to a cert file for the certificate authority. + CertificateAuthority string + + // ClientKey is the path to a client key file for TLS. + ClientKey string + + // Should the current context be kept when setting up this one + KeepContext bool + + // Should the certificate files be embedded instead of referenced by path + EmbedCerts bool + + // kubeConfigFile is the path where the kube config is stored + // Only access this with atomic ops + kubeConfigFile atomic.Value +} + +// SetPath sets the setting for kubeconfig filepath +func (k *Settings) SetPath(kubeConfigFile string) { + k.kubeConfigFile.Store(kubeConfigFile) +} + +// filePath gets the kubeconfig file +func (k *Settings) filePath() string { + return k.kubeConfigFile.Load().(string) +} + +// Populate populates an api.Config object with values from *Settings +func PopulateFromSettings(cfg *Settings, apiCfg *api.Config) error { + var err error + clusterName := cfg.ClusterName + cluster := api.NewCluster() + cluster.Server = cfg.ClusterServerAddress + if cfg.EmbedCerts { + cluster.CertificateAuthorityData, err = ioutil.ReadFile(cfg.CertificateAuthority) + if err != nil { + return errors.Wrapf(err, "reading CertificateAuthority %s", cfg.CertificateAuthority) + } + } else { + cluster.CertificateAuthority = cfg.CertificateAuthority + } + apiCfg.Clusters[clusterName] = cluster + + // user + userName := cfg.ClusterName + user := api.NewAuthInfo() + if cfg.EmbedCerts { + user.ClientCertificateData, err = ioutil.ReadFile(cfg.ClientCertificate) + if err != nil { + return errors.Wrapf(err, "reading ClientCertificate %s", cfg.ClientCertificate) + } + user.ClientKeyData, err = ioutil.ReadFile(cfg.ClientKey) + if err != nil { + return errors.Wrapf(err, "reading ClientKey %s", cfg.ClientKey) + } + } else { + user.ClientCertificate = cfg.ClientCertificate + user.ClientKey = cfg.ClientKey + } + apiCfg.AuthInfos[userName] = user + + // context + contextName := cfg.ClusterName + context := api.NewContext() + context.Cluster = cfg.ClusterName + context.AuthInfo = userName + apiCfg.Contexts[contextName] = context + + // Only set current context to minikube if the user has not used the keepContext flag + if !cfg.KeepContext { + apiCfg.CurrentContext = cfg.ClusterName + } + + return nil +} + +// update reads config from disk, adds the minikube settings, and writes it back. +// activeContext is true when minikube is the CurrentContext +// If no CurrentContext is set, the given name will be used. +func Update(kcs *Settings) error { + glog.Infoln("Using kubeconfig: ", kcs.filePath()) + + // read existing config or create new if does not exist + kcfg, err := readOrNew(kcs.filePath()) + if err != nil { + return err + } + + err = PopulateFromSettings(kcs, kcfg) + if err != nil { + return err + } + + // write back to disk + if err := writeToFile(kcfg, kcs.filePath()); err != nil { + return errors.Wrap(err, "writing kubeconfig") + } + return nil +} diff --git a/pkg/util/testdata/kubeconfig/config1 b/pkg/minikube/kubeconfig/testdata/kubeconfig/config1 similarity index 100% rename from pkg/util/testdata/kubeconfig/config1 rename to pkg/minikube/kubeconfig/testdata/kubeconfig/config1 diff --git a/pkg/util/testdata/kubeconfig/config2 b/pkg/minikube/kubeconfig/testdata/kubeconfig/config2 similarity index 100% rename from pkg/util/testdata/kubeconfig/config2 rename to pkg/minikube/kubeconfig/testdata/kubeconfig/config2 diff --git a/pkg/minikube/out/style.go b/pkg/minikube/out/style.go index 564abd8fad..b03ea28d68 100644 --- a/pkg/minikube/out/style.go +++ b/pkg/minikube/out/style.go @@ -87,7 +87,7 @@ var styles = map[StyleEnum]style{ Caching: {Prefix: "🤹 "}, StartingVM: {Prefix: "🔥 "}, StartingNone: {Prefix: "🤹 "}, - Provisioner: {Prefix: "ℹ️ "}, + Provisioner: {Prefix: "ℹ️ "}, Resetting: {Prefix: "🔄 "}, DeletingHost: {Prefix: "🔥 "}, Copying: {Prefix: "✨ "}, diff --git a/pkg/minikube/problem/err_map.go b/pkg/minikube/problem/err_map.go index 1ef7e97365..ac69ea3d32 100644 --- a/pkg/minikube/problem/err_map.go +++ b/pkg/minikube/problem/err_map.go @@ -33,7 +33,7 @@ var vmProblems = map[string]match{ "HYPERKIT_NO_IP": { Regexp: re(`IP address never found in dhcp leases file Temporary Error: Could not find an IP address for`), Advice: "Install the latest minikube hyperkit driver, and run 'minikube delete'", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/", Issues: []int{1926, 4206}, }, "VBOX_NOT_FOUND": { @@ -89,12 +89,12 @@ var vmProblems = map[string]match{ "KVM2_NOT_FOUND": { Regexp: re(`Driver "kvm2" not found. Do you have the plugin binary .* accessible in your PATH`), Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", }, "HYPERKIT_NOT_FOUND": { Regexp: re(`Driver "hyperkit" not found. Do you have the plugin binary .* accessible in your PATH?`), Advice: "Please install the minikube hyperkit VM driver, or select an alternative --vm-driver", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/", }, "KVM2_RESTART_NO_IP": { Regexp: re(`Error starting stopped host: Machine didn't return an IP after 120 seconds`), @@ -104,7 +104,7 @@ var vmProblems = map[string]match{ "KVM2_START_NO_IP": { Regexp: re(`Error in driver during machine creation: Machine didn't return an IP after 120 seconds`), Advice: "Install the latest kvm2 driver and run 'virt-host-validate'", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", Issues: []int{4249, 3566}, }, "KVM2_NETWORK_DEFINE_XML": { @@ -127,17 +127,17 @@ var vmProblems = map[string]match{ "KVM_CONNECTION_ERROR": { Regexp: re(`error connecting to libvirt socket`), Advice: "Have you set up libvirt correctly?", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/", }, "DRIVER_CRASHED": { Regexp: re(`Error attempting to get plugin server address for RPC`), Advice: "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/", }, "DRIVER_EXITED": { Regexp: re(`Unable to start VM: create: creating: exit status 1`), Advice: "Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#troubleshooting", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/#troubleshooting", }, "VM_BOOT_FAILED_HYPERV_ENABLED": { Regexp: re(`VirtualBox won't boot a 64bits VM when Hyper-V is activated`), @@ -173,7 +173,7 @@ var vmProblems = map[string]match{ } // proxyDoc is the URL to proxy documentation -const proxyDoc = "https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md" +const proxyDoc = "https://minikube.sigs.k8s.io/docs/reference/networking/proxy/" // netProblems are network related problems. var netProblems = map[string]match{ @@ -262,7 +262,7 @@ var osProblems = map[string]match{ "SYSTEMCTL_EXIT_1": { Regexp: re(`Failed to enable container runtime: .*sudo systemctl start docker: exit status 1`), Advice: "If using the none driver, ensure that systemctl is installed", - URL: "https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md", + URL: "https://minikube.sigs.k8s.io/docs/reference/drivers/none/", Issues: []int{2704}, }, } diff --git a/pkg/util/kubeconfig.go b/pkg/util/kubeconfig.go deleted file mode 100644 index f1efabd9c2..0000000000 --- a/pkg/util/kubeconfig.go +++ /dev/null @@ -1,372 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "fmt" - "io/ioutil" - "net" - "net/url" - "os" - "path/filepath" - "strconv" - "sync/atomic" - - "github.com/golang/glog" - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/client-go/tools/clientcmd/api/latest" -) - -// KubeConfigSetup is the kubeconfig setup -type KubeConfigSetup struct { - // The name of the cluster for this context - ClusterName string - - // ClusterServerAddress is the address of the kubernetes cluster - ClusterServerAddress string - - // ClientCertificate is the path to a client cert file for TLS. - ClientCertificate string - - // CertificateAuthority is the path to a cert file for the certificate authority. - CertificateAuthority string - - // ClientKey is the path to a client key file for TLS. - ClientKey string - - // Should the current context be kept when setting up this one - KeepContext bool - - // Should the certificate files be embedded instead of referenced by path - EmbedCerts bool - - // kubeConfigFile is the path where the kube config is stored - // Only access this with atomic ops - kubeConfigFile atomic.Value -} - -// SetKubeConfigFile sets the kubeconfig file -func (k *KubeConfigSetup) SetKubeConfigFile(kubeConfigFile string) { - k.kubeConfigFile.Store(kubeConfigFile) -} - -// GetKubeConfigFile gets the kubeconfig file -func (k *KubeConfigSetup) GetKubeConfigFile() string { - return k.kubeConfigFile.Load().(string) -} - -// PopulateKubeConfig populates an api.Config object. -func PopulateKubeConfig(cfg *KubeConfigSetup, kubecfg *api.Config) error { - var err error - clusterName := cfg.ClusterName - cluster := api.NewCluster() - cluster.Server = cfg.ClusterServerAddress - if cfg.EmbedCerts { - cluster.CertificateAuthorityData, err = ioutil.ReadFile(cfg.CertificateAuthority) - if err != nil { - return err - } - } else { - cluster.CertificateAuthority = cfg.CertificateAuthority - } - kubecfg.Clusters[clusterName] = cluster - - // user - userName := cfg.ClusterName - user := api.NewAuthInfo() - if cfg.EmbedCerts { - user.ClientCertificateData, err = ioutil.ReadFile(cfg.ClientCertificate) - if err != nil { - return err - } - user.ClientKeyData, err = ioutil.ReadFile(cfg.ClientKey) - if err != nil { - return err - } - } else { - user.ClientCertificate = cfg.ClientCertificate - user.ClientKey = cfg.ClientKey - } - kubecfg.AuthInfos[userName] = user - - // context - contextName := cfg.ClusterName - context := api.NewContext() - context.Cluster = cfg.ClusterName - context.AuthInfo = userName - kubecfg.Contexts[contextName] = context - - // Only set current context to minikube if the user has not used the keepContext flag - if !cfg.KeepContext { - kubecfg.CurrentContext = cfg.ClusterName - } - - return nil -} - -// SetupKubeConfig reads config from disk, adds the minikube settings, and writes it back. -// activeContext is true when minikube is the CurrentContext -// If no CurrentContext is set, the given name will be used. -func SetupKubeConfig(cfg *KubeConfigSetup) error { - glog.Infoln("Using kubeconfig: ", cfg.GetKubeConfigFile()) - - // read existing config or create new if does not exist - config, err := ReadConfigOrNew(cfg.GetKubeConfigFile()) - if err != nil { - return err - } - - err = PopulateKubeConfig(cfg, config) - if err != nil { - return err - } - - // write back to disk - if err := WriteConfig(config, cfg.GetKubeConfigFile()); err != nil { - return errors.Wrap(err, "writing kubeconfig") - } - return nil -} - -// ReadConfigOrNew retrieves Kubernetes client configuration from a file. -// If no files exists, an empty configuration is returned. -func ReadConfigOrNew(filename string) (*api.Config, error) { - data, err := ioutil.ReadFile(filename) - if os.IsNotExist(err) { - return api.NewConfig(), nil - } else if err != nil { - return nil, errors.Wrapf(err, "Error reading file %q", filename) - } - - // decode config, empty if no bytes - config, err := decode(data) - if err != nil { - return nil, errors.Errorf("could not read config: %v", err) - } - - // initialize nil maps - if config.AuthInfos == nil { - config.AuthInfos = map[string]*api.AuthInfo{} - } - if config.Clusters == nil { - config.Clusters = map[string]*api.Cluster{} - } - if config.Contexts == nil { - config.Contexts = map[string]*api.Context{} - } - - return config, nil -} - -// WriteConfig encodes the configuration and writes it to the given file. -// If the file exists, it's contents will be overwritten. -func WriteConfig(config *api.Config, filename string) error { - if config == nil { - glog.Errorf("could not write to '%s': config can't be nil", filename) - } - - // encode config to YAML - data, err := runtime.Encode(latest.Codec, config) - if err != nil { - return errors.Errorf("could not write to '%s': failed to encode config: %v", filename, err) - } - - // create parent dir if doesn't exist - dir := filepath.Dir(filename) - if _, err := os.Stat(dir); os.IsNotExist(err) { - if err = os.MkdirAll(dir, 0755); err != nil { - return errors.Wrapf(err, "Error creating directory: %s", dir) - } - } - - // write with restricted permissions - if err := ioutil.WriteFile(filename, data, 0600); err != nil { - return errors.Wrapf(err, "Error writing file %s", filename) - } - if err := MaybeChownDirRecursiveToMinikubeUser(dir); err != nil { - return errors.Wrapf(err, "Error recursively changing ownership for dir: %s", dir) - } - - return nil -} - -// decode reads a Config object from bytes. -// Returns empty config if no bytes. -func decode(data []byte) (*api.Config, error) { - // if no data, return empty config - if len(data) == 0 { - return api.NewConfig(), nil - } - - config, _, err := latest.Codec.Decode(data, nil, nil) - if err != nil { - return nil, errors.Wrapf(err, "Error decoding config from data: %s", string(data)) - } - - return config.(*api.Config), nil -} - -// GetKubeConfigStatus verifies the ip stored in kubeconfig. -func GetKubeConfigStatus(ip net.IP, filename string, machineName string) (bool, error) { - if ip == nil { - return false, fmt.Errorf("Error, empty ip passed") - } - kip, err := getIPFromKubeConfig(filename, machineName) - if err != nil { - return false, err - } - if kip.Equal(ip) { - return true, nil - } - // Kubeconfig IP misconfigured - return false, nil - -} - -// UpdateKubeconfigIP overwrites the IP stored in kubeconfig with the provided IP. -func UpdateKubeconfigIP(ip net.IP, filename string, machineName string) (bool, error) { - if ip == nil { - return false, fmt.Errorf("Error, empty ip passed") - } - kip, err := getIPFromKubeConfig(filename, machineName) - if err != nil { - return false, err - } - if kip.Equal(ip) { - return false, nil - } - kport, err := GetPortFromKubeConfig(filename, machineName) - if err != nil { - return false, err - } - con, err := ReadConfigOrNew(filename) - if err != nil { - return false, errors.Wrap(err, "Error getting kubeconfig status") - } - // Safe to lookup server because if field non-existent getIPFromKubeconfig would have given an error - con.Clusters[machineName].Server = "https://" + ip.String() + ":" + strconv.Itoa(kport) - err = WriteConfig(con, filename) - if err != nil { - return false, err - } - // Kubeconfig IP reconfigured - return true, nil -} - -// getIPFromKubeConfig returns the IP address stored for minikube in the kubeconfig specified -func getIPFromKubeConfig(filename, machineName string) (net.IP, error) { - con, err := ReadConfigOrNew(filename) - if err != nil { - return nil, errors.Wrap(err, "Error getting kubeconfig status") - } - cluster, ok := con.Clusters[machineName] - if !ok { - return nil, errors.Errorf("Kubeconfig does not have a record of the machine cluster") - } - kurl, err := url.Parse(cluster.Server) - if err != nil { - return net.ParseIP(cluster.Server), nil - } - kip, _, err := net.SplitHostPort(kurl.Host) - if err != nil { - return net.ParseIP(kurl.Host), nil - } - ip := net.ParseIP(kip) - return ip, nil -} - -// GetPortFromKubeConfig returns the Port number stored for minikube in the kubeconfig specified -func GetPortFromKubeConfig(filename, machineName string) (int, error) { - con, err := ReadConfigOrNew(filename) - if err != nil { - return 0, errors.Wrap(err, "Error getting kubeconfig status") - } - cluster, ok := con.Clusters[machineName] - if !ok { - return 0, errors.Errorf("Kubeconfig does not have a record of the machine cluster") - } - kurl, err := url.Parse(cluster.Server) - if err != nil { - return APIServerPort, nil - } - _, kport, err := net.SplitHostPort(kurl.Host) - if err != nil { - return APIServerPort, nil - } - port, err := strconv.Atoi(kport) - return port, err -} - -// UnsetCurrentContext unsets the current-context from minikube to "" on minikube stop -func UnsetCurrentContext(filename, machineName string) error { - confg, err := ReadConfigOrNew(filename) - if err != nil { - return errors.Wrap(err, "Error getting kubeconfig status") - } - - // Unset current-context only if profile is the current-context - if confg.CurrentContext == machineName { - confg.CurrentContext = "" - if err := WriteConfig(confg, filename); err != nil { - return errors.Wrap(err, "writing kubeconfig") - } - return nil - } - - return nil -} - -// SetCurrentContext sets the kubectl's current-context -func SetCurrentContext(kubeCfgPath, name string) error { - kcfg, err := ReadConfigOrNew(kubeCfgPath) - if err != nil { - return errors.Wrap(err, "Error getting kubeconfig status") - } - kcfg.CurrentContext = name - if err := WriteConfig(kcfg, kubeCfgPath); err != nil { - return errors.Wrap(err, "writing kubeconfig") - } - return nil -} - -// DeleteKubeConfigContext deletes the specified machine's kubeconfig context -func DeleteKubeConfigContext(kubeCfgPath, machineName string) error { - kcfg, err := ReadConfigOrNew(kubeCfgPath) - if err != nil { - return errors.Wrap(err, "Error getting kubeconfig status") - } - - if kcfg == nil || api.IsConfigEmpty(kcfg) { - glog.V(2).Info("kubeconfig is empty") - return nil - } - - delete(kcfg.Clusters, machineName) - delete(kcfg.AuthInfos, machineName) - delete(kcfg.Contexts, machineName) - - if kcfg.CurrentContext == machineName { - kcfg.CurrentContext = "" - } - - if err := WriteConfig(kcfg, kubeCfgPath); err != nil { - return errors.Wrap(err, "writing kubeconfig") - } - return nil -} diff --git a/pkg/util/progressbar.go b/pkg/util/progressbar.go index e1bb6ebb70..14bb33f169 100644 --- a/pkg/util/progressbar.go +++ b/pkg/util/progressbar.go @@ -21,22 +21,19 @@ limitations under the License. package util import ( - "fmt" "io" "path/filepath" "sync" - "github.com/cheggaaa/pb" - "github.com/golang/glog" + "github.com/cheggaaa/pb/v3" "github.com/hashicorp/go-getter" ) var defaultProgressBar getter.ProgressTracker = &progressBar{} type progressBar struct { - lock sync.Mutex - pool *pb.Pool - pbs int + lock sync.Mutex + progress *pb.ProgressBar } // TrackProgress instantiates a new progress bar that will @@ -45,38 +42,24 @@ type progressBar struct { func (cpb *progressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { cpb.lock.Lock() defer cpb.lock.Unlock() - - if cpb.pool == nil { - cpb.pool = pb.NewPool() - if err := cpb.pool.Start(); err != nil { - glog.Errorf("pool start: %v", err) - } + if cpb.progress == nil { + cpb.progress = pb.New64(totalSize) } + p := pb.Full.Start64(totalSize) + p.Set("prefix", filepath.Base(src+": ")) + p.SetCurrent(currentSize) + p.Set(pb.Bytes, true) - p := pb.New64(totalSize) - p.Set64(currentSize) - p.SetUnits(pb.U_BYTES) - p.Prefix(fmt.Sprintf(" %s:", filepath.Base(src))) // Just a hair less than 80 (standard terminal width) for aesthetics & pasting into docs - p.SetWidth(78) - cpb.pool.Add(p) - reader := p.NewProxyReader(stream) + p.SetWidth(79) + barReader := p.NewProxyReader(stream) - cpb.pbs++ return &readCloser{ - Reader: reader, + Reader: barReader, close: func() error { cpb.lock.Lock() defer cpb.lock.Unlock() - p.Finish() - cpb.pbs-- - if cpb.pbs <= 0 { - if err := cpb.pool.Stop(); err != nil { - glog.Errorf("pool stop: %v", err) - } - cpb.pool = nil - } return nil }, } diff --git a/site/assets/scss/_variables_project.scss b/site/assets/scss/_variables_project.scss index e737450f4e..01a924faa8 100644 --- a/site/assets/scss/_variables_project.scss +++ b/site/assets/scss/_variables_project.scss @@ -36,7 +36,7 @@ $medium: $mk-medium; // Navigation bar $navbar-dark-color: $mk-dark; $navbar-dark-hover-color: $mk-light !default; -$navbar-dark-active-color: $mk-light !default; +$navbar-dark-active-color: $primary !default; $navbar-dark-disabled-color: rgba($white, 0.25) !default; .td-navbar { background: $white !important; @@ -148,4 +148,18 @@ footer.bg-dark { // Reduce section padding by 1rem section.td-box--height-auto { padding-bottom: 3rem !important; -} \ No newline at end of file +} + + +div.td-content { + // Allow code tags to span most of a window length (default is 80%) + pre { + max-width: 99% !important; + } + h2 { + font-size: 1.4rem !important; + } + h3 { + font-size: 1.3rem !important; + } +} diff --git a/site/config.toml b/site/config.toml index a5f1df2913..1196217fe1 100644 --- a/site/config.toml +++ b/site/config.toml @@ -46,6 +46,12 @@ resampleFilter = "CatmullRom" quality = 75 anchor = "smart" +# Additional menu items +[[menu.main]] + name = "GitHub" + weight = 50 + url = "https://github.com/kubernetes/minikube" + [services] [services.googleAnalytics] # Comment out the next line to disable GA tracking. Also disables the feature described in [params.ui.feedback]. @@ -62,7 +68,7 @@ weight = 1 [params] copyright = "The Kubernetes Authors -- " # The latest release of minikube -latest_release = "1.3.0" +latest_release = "1.3.1" privacy_policy = "" @@ -71,12 +77,12 @@ privacy_policy = "" version_menu = "Releases" # Repository configuration (URLs for in-page links to opening issues and suggesting changes) -github_repo = "http://github.com/minikube/kubernetes" +github_repo = "http://github.com/kubernetes/minikube" # An optional link to a related project repo. For example, the sibling repository where your product code lives. github_project_repo = "" # Specify a value here if your content directory is not in your repo's root directory -github_subdir = "/site/content" +github_subdir = "site" # Google Custom Search Engine ID. Remove or comment out to disable search. gcs_engine_id = "005331096405080631692:s7c4yfpw9sy" @@ -84,7 +90,7 @@ gcs_engine_id = "005331096405080631692:s7c4yfpw9sy" # User interface configuration [params.ui] # Enable to show the side bar menu in its compact state. -sidebar_menu_compact = false +sidebar_menu_compact = true # Set to true to disable breadcrumb navigation. breadcrumb_disable = false # Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) @@ -99,8 +105,8 @@ navbar_logo = true [params.ui.feedback] enable = true # The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). -yes = 'Glad to hear it! Please tell us how we can improve.' -no = 'Sorry to hear that. Please tell us how we can improve.' +yes = 'Glad to hear it! Please tell us how we can improve.' +no = 'Sorry to hear that. Please tell us how we can improve.' [params.links] # End user relevant links. These will show up on left side of footer and in the community page if you have one. diff --git a/site/content/en/_index.html b/site/content/en/_index.html index 12d8977f91..86a6f00cd7 100644 --- a/site/content/en/_index.html +++ b/site/content/en/_index.html @@ -4,7 +4,7 @@ resources: - src: "logo.png" title: "logo" -- src: "start.jpg" +- src: "start.png" title: "start" --- @@ -15,7 +15,7 @@ resources:

Welcome to minikube!

Local Kubernetes, focused on application development & education

- + Get Started @@ -57,10 +57,10 @@ A single command away from reproducing your production environment, from the com {{< blocks/section color="white" >}} {{% blocks/feature icon="fa-star" title="Developer focused" %}} -- [LoadBalancer emulation](https://github.com/kubernetes/minikube/blob/master/docs/tunnel.md) -- [Addons Marketplace](https://github.com/kubernetes/minikube/blob/master/docs/addons.md) -- [Integrated Dashboard](https://github.com/kubernetes/minikube/blob/master/docs/dashboard.md) -- [GPU support](https://github.com/kubernetes/minikube/blob/master/docs/gpu.md) +- [LoadBalancer emulation](https://minikube.sigs.k8s.io/docs/tasks/loadbalancer/) +- [Addons Marketplace](https://minikube.sigs.k8s.io/docs/tasks/addons/) +- [Integrated Dashboard](https://minikube.sigs.k8s.io/docs/tasks/dashboard/) +- [GPU support](https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/) - Reusable Docker daemon {{% /blocks/feature %}} @@ -82,7 +82,7 @@ A single command away from reproducing your production environment, from the com {{< blocks/section color="light" >}} {{% blocks/feature icon="fab fa-slack" title="Chat with us on Slack" %}} - + @@ -90,7 +90,7 @@ The #minikube channel is ready to answer your questions. {{% /blocks/feature %}} {{% blocks/feature icon="fab fa-github" title="Contributions welcome" %}} - + diff --git a/site/content/en/blog/_index.md b/site/content/en/blog/_index.md index 43820eb17d..59c4cdd84b 100644 --- a/site/content/en/blog/_index.md +++ b/site/content/en/blog/_index.md @@ -1,6 +1,6 @@ --- title: "Docsy Blog" -linkTitle: "Blog" +linkTitle: "News" menu: main: weight: 30 diff --git a/site/content/en/blog/news/first-post/featured-sunset-get.png b/site/content/en/blog/news/first-post/featured-sunset-get.png deleted file mode 100644 index db3373c0bf..0000000000 Binary files a/site/content/en/blog/news/first-post/featured-sunset-get.png and /dev/null differ diff --git a/site/content/en/blog/news/first-post/index.md b/site/content/en/blog/news/first-post/index.md deleted file mode 100644 index b6bfb47722..0000000000 --- a/site/content/en/blog/news/first-post/index.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -date: 2018-10-06 -title: "Easy documentation with Docsy" -linkTitle: "Announcing Docsy" -description: "The Docsy Hugo theme lets project maintainers and contributors focus on content, not on reinventing a website infrastructure from scratch" -author: Riona MacNamara ([@rionam](https://twitter.com/bepsays)) -resources: -- src: "**.{png,jpg}" - title: "Image #:counter" - params: - byline: "Photo: Riona MacNamara / CC-BY-CA" ---- - -**This is a typical blog post that includes images.** - -The front matter specifies the date of the blog post, its title, a short description that will be displayed on the blog landing page, and its author. - -## Including images - -Here's an image (`featured-sunset-get.png`) that includes a byline and a caption. - -{{< imgproc sunset Fill "600x300" >}} -Fetch and scale an image in the upcoming Hugo 0.43. -{{< /imgproc >}} - -The front matter of this post specifies properties to be assigned to all image resources: - -``` -resources: -- src: "**.{png,jpg}" - title: "Image #:counter" - params: - byline: "Photo: Riona MacNamara / CC-BY-CA" -``` - -To include the image in a page, specify its details like this: - -``` -{{< imgproc sunset Fill "600x300" >}} -Fetch and scale an image in the upcoming Hugo 0.43. -{{< /imgproc >}} -``` - -The image will be rendered at the size and byline specified in the front matter. - - diff --git a/site/content/en/blog/news/new-website.md b/site/content/en/blog/news/new-website.md new file mode 100755 index 0000000000..4718f0afe2 --- /dev/null +++ b/site/content/en/blog/news/new-website.md @@ -0,0 +1,12 @@ +--- +title: "New website launched" +date: 2019-08-13 +description: > + About the new minikube website +--- + +As you may have noticed, minikube has a brand new website. + +As part of our [2019 roadmap](https://minikube.sigs.k8s.io/docs/contributing/roadmap/), we identified the need for a user-focused website for documentation, and this is it. It's based on the [Hugo Website Framework](https://gohugo.io/) and uses the [Docsy Templates for Technical Documentation](https://github.com/google/docsy). + +We have more work to do with organizing the documentation and making it more useful, but we hope you are able to enjoy the fruits of our labor. PR's welcome! diff --git a/site/content/en/blog/news/second-post.md b/site/content/en/blog/news/second-post.md deleted file mode 100755 index 4277e67178..0000000000 --- a/site/content/en/blog/news/second-post.md +++ /dev/null @@ -1,241 +0,0 @@ - ---- -title: "The second blog post" -linkTitle: "Second blog post" -date: 2018-10-06 -description: > - A short lead descripton about this content page. Text here can also be **bold** or _italic_ and can even be split over multiple paragraphs. ---- - -Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines (unless hovered over). - -There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. - -There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. - -> There should be no margin above this first sentence. -> -> Blockquotes should be a lighter gray with a border along the left side in the secondary color. -> -> There should be no margin below this final sentence. - -## First Header - -This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - - - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -On big screens, paragraphs and headings should not take up the full container width, but we want tables, code blocks and similar to take the full width. - -Lorem markdownum tuta hospes stabat; idem saxum facit quaterque repetito -occumbere, oves novem gestit haerebat frena; qui. Respicit recurvam erat: -pignora hinc reppulit nos **aut**, aptos, ipsa. - -Meae optatos *passa est* Epiros utiliter *Talibus niveis*, hoc lata, edidit. -Dixi ad aestum. - -## Header 2 - -> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Header 3 - -``` -This is a code block following a header. -``` - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| What | Follows | -|-----------|-----------------| -| A table | A header | -| A table | A header | -| A table | A header | - ----------------- - -There's a horizontal rule above and below this. - ----------------- - -Here is an unordered list: - -* Salt-n-Pepa -* Bel Biv DeVoe -* Kid 'N Play - -And an ordered list: - -1. Michael Jackson -2. Michael Bolton -3. Michael Bublé - -And an unordered task list: - -- [x] Create a sample markdown document -- [x] Add task lists to it -- [ ] Take a vacation - -And a "mixed" task list: - -- [ ] Steal underpants -- ? -- [ ] Profit! - -And a nested list: - -* Jackson 5 - * Michael - * Tito - * Jackie - * Marlon - * Jermaine -* TMNT - * Leonardo - * Michelangelo - * Donatello - * Raphael - -Definition lists can be used with Markdown syntax. Definition terms are bold. - -Name -: Godzilla - -Born -: 1952 - -Birthplace -: Japan - -Color -: Green - - ----------------- - -Tables should have bold headings and alternating shaded rows. - -| Artist | Album | Year | -|-------------------|-----------------|------| -| Michael Jackson | Thriller | 1982 | -| Prince | Purple Rain | 1984 | -| Beastie Boys | License to Ill | 1986 | - -If a table is too wide, it should scroll horizontally. - -| Artist | Album | Year | Label | Awards | Songs | -|-------------------|-----------------|------|-------------|----------|-----------| -| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | -| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | -| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | - ----------------- - -Code snippets like `var foo = "bar";` can be shown inline. - -Also, `this should vertically align` ~~`with this`~~ ~~and this~~. - -Code can also be shown in a block element. - -``` -foo := "bar"; -bar := "foo"; -``` - -Code can also use syntax highlighting. - -```go -func main() { - input := `var foo = "bar";` - - lexer := lexers.Get("javascript") - iterator, _ := lexer.Tokenise(nil, input) - style := styles.Get("github") - formatter := html.New(html.WithLineNumbers()) - - var buff bytes.Buffer - formatter.Format(&buff, style, iterator) - - fmt.Println(buff.String()) -} -``` - -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -Inline code inside table cells should still be distinguishable. - -| Language | Code | -|-------------|--------------------| -| Javascript | `var foo = "bar";` | -| Ruby | `foo = "bar"{` | - ----------------- - -Small images should be shown at their actual size. - -Large images should always scale down and fit in the content container. - -## Components - -### Alerts - -{{< alert >}}This is an alert.{{< /alert >}} -{{< alert title="Note:" >}}This is an alert with a title.{{< /alert >}} -{{< alert type="success" >}}This is a successful alert.{{< /alert >}} -{{< alert type="warning" >}}This is a warning!{{< /alert >}} -{{< alert type="warning" title="Warning!" >}}This is a warning with a title!{{< /alert >}} - - -## Sizing - -Add some sections here to see how the ToC looks like. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Parameters available - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Using pixels - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Using rem - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -## Memory - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### RAM to use - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### More is better - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Used RAM - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - - - -``` -This is the final element on the page and there should be no margin below this. -``` diff --git a/site/content/en/blog/releases/in-depth-monoliths-detailed-spec.md b/site/content/en/blog/releases/in-depth-monoliths-detailed-spec.md deleted file mode 100755 index 695908f741..0000000000 --- a/site/content/en/blog/releases/in-depth-monoliths-detailed-spec.md +++ /dev/null @@ -1,241 +0,0 @@ - ---- -title: "Another Great Release" -linkTitle: "Release New Features" -date: 2018-01-04 -description: > - A short lead descripton about this content page. Text here can also be **bold** or _italic_ and can even be split over multiple paragraphs. ---- - -Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines (unless hovered over). - -There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. - -There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. - -> There should be no margin above this first sentence. -> -> Blockquotes should be a lighter gray with a border along the left side in the secondary color. -> -> There should be no margin below this final sentence. - -## First Header - -This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - - - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -On big screens, paragraphs and headings should not take up the full container width, but we want tables, code blocks and similar to take the full width. - -Lorem markdownum tuta hospes stabat; idem saxum facit quaterque repetito -occumbere, oves novem gestit haerebat frena; qui. Respicit recurvam erat: -pignora hinc reppulit nos **aut**, aptos, ipsa. - -Meae optatos *passa est* Epiros utiliter *Talibus niveis*, hoc lata, edidit. -Dixi ad aestum. - -## Header 2 - -> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Header 3 - -``` -This is a code block following a header. -``` - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| What | Follows | -|-----------|-----------------| -| A table | A header | -| A table | A header | -| A table | A header | - ----------------- - -There's a horizontal rule above and below this. - ----------------- - -Here is an unordered list: - -* Salt-n-Pepa -* Bel Biv DeVoe -* Kid 'N Play - -And an ordered list: - -1. Michael Jackson -2. Michael Bolton -3. Michael Bublé - -And an unordered task list: - -- [x] Create a sample markdown document -- [x] Add task lists to it -- [ ] Take a vacation - -And a "mixed" task list: - -- [ ] Steal underpants -- ? -- [ ] Profit! - -And a nested list: - -* Jackson 5 - * Michael - * Tito - * Jackie - * Marlon - * Jermaine -* TMNT - * Leonardo - * Michelangelo - * Donatello - * Raphael - -Definition lists can be used with Markdown syntax. Definition terms are bold. - -Name -: Godzilla - -Born -: 1952 - -Birthplace -: Japan - -Color -: Green - - ----------------- - -Tables should have bold headings and alternating shaded rows. - -| Artist | Album | Year | -|-------------------|-----------------|------| -| Michael Jackson | Thriller | 1982 | -| Prince | Purple Rain | 1984 | -| Beastie Boys | License to Ill | 1986 | - -If a table is too wide, it should scroll horizontally. - -| Artist | Album | Year | Label | Awards | Songs | -|-------------------|-----------------|------|-------------|----------|-----------| -| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | -| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | -| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | - ----------------- - -Code snippets like `var foo = "bar";` can be shown inline. - -Also, `this should vertically align` ~~`with this`~~ ~~and this~~. - -Code can also be shown in a block element. - -``` -foo := "bar"; -bar := "foo"; -``` - -Code can also use syntax highlighting. - -```go -func main() { - input := `var foo = "bar";` - - lexer := lexers.Get("javascript") - iterator, _ := lexer.Tokenise(nil, input) - style := styles.Get("github") - formatter := html.New(html.WithLineNumbers()) - - var buff bytes.Buffer - formatter.Format(&buff, style, iterator) - - fmt.Println(buff.String()) -} -``` - -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -Inline code inside table cells should still be distinguishable. - -| Language | Code | -|-------------|--------------------| -| Javascript | `var foo = "bar";` | -| Ruby | `foo = "bar"{` | - ----------------- - -Small images should be shown at their actual size. - -Large images should always scale down and fit in the content container. - -## Components - -### Alerts - -{{< alert >}}This is an alert.{{< /alert >}} -{{< alert title="Note:" >}}This is an alert with a title.{{< /alert >}} -{{< alert type="success" >}}This is a successful alert.{{< /alert >}} -{{< alert type="warning" >}}This is a warning!{{< /alert >}} -{{< alert type="warning" title="Warning!" >}}This is a warning with a title!{{< /alert >}} - - -## Sizing - -Add some sections here to see how the ToC looks like. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Parameters available - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Using pixels - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Using rem - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -## Memory - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### RAM to use - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### More is better - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Used RAM - -Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - - - -``` -This is the final element on the page and there should be no margin below this. -``` diff --git a/site/content/en/blog/releases/v1.13.1.md b/site/content/en/blog/releases/v1.13.1.md new file mode 100755 index 0000000000..e62fe052bd --- /dev/null +++ b/site/content/en/blog/releases/v1.13.1.md @@ -0,0 +1,26 @@ +--- +title: "v1.3.1" +linkTitle: "v1.3.1 released" +date: 2019-08-13 +description: > + Release notes for v1.3.1 +--- + +minikube v1.3.1 is now available, which addresses regressions found in the v1.3.0 release. Here are the [changes](https://raw.githubusercontent.com/kubernetes/minikube/v1.3.1/CHANGELOG.md) + +* Update code references to point to new documentation site [#5052](https://github.com/kubernetes/minikube/pull/5052) +* Localization support for help text [#4814](https://github.com/kubernetes/minikube/pull/4814) +* Upgrade cheggaaa/pb from v1.0.27 to v3.0.1 [#5025](https://github.com/kubernetes/minikube/pull/5025) +* Restore --disable-driver-mounts flag [#5026](https://github.com/kubernetes/minikube/pull/5026) +* Fixed the template for dashboard output [#5004](https://github.com/kubernetes/minikube/pull/5004) +* Use a temp dest to atomically download the iso [#5000](https://github.com/kubernetes/minikube/pull/5000) + +Thank you to our merry band of contributors for assembling this last minute bug fix release. + +- Jituri, Pranav +- Medya Ghazizadeh +- Pranav Jituri +- Ramiro Berrelleza +- Sharif Elgamal +- Thomas Strömberg +- josedonizetti diff --git a/site/content/en/docs/Contributing/building.en.md b/site/content/en/docs/Contributing/building.en.md index e2fa9a42d6..1379135c0e 100644 --- a/site/content/en/docs/Contributing/building.en.md +++ b/site/content/en/docs/Contributing/building.en.md @@ -1,13 +1,10 @@ --- -title: "Building minikube" +linkTitle: "Building" +title: "Building the minikube binary" date: 2019-07-31 -weight: 4 -description: > - Building minikube +weight: 2 --- -This guide covers both building the minikube binary and the ISO. - ## Prerequisites * A recent Go distribution (>=1.12) @@ -27,13 +24,15 @@ git clone https://github.com/kubernetes/minikube.git cd minikube ``` -## Building the binary +## Compiling minikube ```shell make ``` -Alternatively, you may cross-compile to/from different operating systems: +## Compiling minikube using Docker + +To cross-compile to/from different operating systems: ```shell MINIKUBE_BUILD_IN_DOCKER=y make cross @@ -51,71 +50,7 @@ Start the cluster using your built minikube with: ## Building the ISO -The minikube ISO is booted by each hypervisor to provide a stable minimal Linux environment to start Kubernetes from. It is based on coreboot, uses systemd, and includes all necessary container runtimes and hypervisor guest drivers. - -### Prerequisites - -See the above requirements for building the minikube binary. Additionally, you will need: - -```shell -sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \ - unzip bc gcc-multilib automake libtool locales -``` -### Build instructions - -```shell -$ make buildroot-image -$ make out/minikube.iso -``` - -The build will occur inside a docker container. If you want to do this on -baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`. -The bootable ISO image will be available in `out/minikube.iso`. - -### Using a local ISO image - -```shell -$ ./out/minikube start --iso-url=file://$(pwd)/out/minikube.iso -``` - -### Modifying buildroot components - -To change which Linux userland components are included by the guest VM, use this to modify the buildroot configuration: - -```shell -cd out/buildroot -make menuconfig -make -``` - -To save these configuration changes, execute: - -```shell -make savedefconfig -``` - -The changes will be reflected in the `minikube-iso/configs/minikube_defconfig` file. - -### Adding kernel modules - -To make kernel configuration changes and save them, execute: - -```shell -$ make linux-menuconfig -``` - -This will open the kernel configuration menu, and then save your changes to our -iso directory after they've been selected. - -### Adding third-party packages - -To add your own package to the minikube ISO, create a package directory under `iso/minikube-iso/package`. This directory will require at least 3 files: - -`.mk` - A Makefile describing how to download the source code and build the program -`.hash` - Checksums to verify the downloaded source code -`Config.in` - buildroot configuration. - -For a relatively simple example to start with, you may want to reference the `podman` package. +See [Building the minikube ISO](../iso) ## Continuous Integration Builds diff --git a/site/content/en/docs/Contributing/documentation.en.md b/site/content/en/docs/Contributing/documentation.en.md new file mode 100644 index 0000000000..56017f0484 --- /dev/null +++ b/site/content/en/docs/Contributing/documentation.en.md @@ -0,0 +1,59 @@ +--- +linkTitle: "Documentation" +title: "Contributing to minikube documentation" +date: 2019-07-31 +weight: 2 +--- + +minikube's documentation is in [Markdown](https://www.markdownguide.org/cheat-sheet/), and generated using the following tools: + +* [Hugo](https://gohugo.io) +* [Docsy](https://www.docsy.dev) + +In production, the minikube website is served using [Netlify](http://netlify.com/) + +## Local documentation website + +To serve documentation pages locally, clone the `minikube` repository and run: + +`make site` + +NOTE: On Windows, our site currently causes Hugo to `panic`. + +## Lint + +We recommend installing [markdownlint](https://github.com/markdownlint/markdownlint) to find issues with your markdown file. Once installed, you can use this handy target: + +`make mdlint` + +## Style Guidelines + +We follow the [Kubernetes Documentation Style Guide](https://kubernetes.io/docs/contribute/style/style-guide/) + +## Linking between documents + +For compile-time checking of links, use one of the following forms to link between documentation pages: + + +```go-html-template +{{}} +{{}} +{{}} +{{}} +{{}} +{{}} +{{}} +{{}} +``` + +For more information, please see [Hugo: Links and Cross References](https://gohugo.io/content-management/cross-references/) + +## Pull Request Previews + +When reviewing documentation PR's, look for the test that says: + +**✓ deploy/netlify** Deploy preview ready! *Details* + +The `Details` link will point to a site preview URL in the form of: + + diff --git a/site/content/en/docs/Contributing/guide.en.md b/site/content/en/docs/Contributing/guide.en.md new file mode 100644 index 0000000000..af7bbbaa01 --- /dev/null +++ b/site/content/en/docs/Contributing/guide.en.md @@ -0,0 +1,44 @@ +--- +title: "Contributor Guide" +linkTitle: "Guide" +date: 2019-07-31 +weight: 1 +description: > + How to become a minikube contributor +--- + +### Code of Conduct + + Be excellent to each another. Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md). + +### License Agreement + +We'd love to accept your patches! Before we can take them, [please fill out either the individual or corporate Contributor License Agreement (CLA)](http://git.k8s.io/community/CLA.md) + +### Finding issues to work on + +* ["good first issue"](https://github.com/kubernetes/minikube/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - issues where there is a clear path to resolution +* ["help wanted"](https://github.com/kubernetes/minikube/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+) - issues where we've identified a need but not resources to work on them +"priority/important-soon" or "priority/important-longterm: - high impact issues that need to be addressed in the next couple of releases. + +* Ask on the #minikube Slack if you aren't sure + +Once you've discovered an issue to work on: + +* Add a comment mentioning that you plan to work on the issue +* Send a PR out that mentions the issue +* Comment on the issue with `/assign` to assign it to yourself + +### Contributing A Patch + +1. Submit an issue describing your proposed change +2. A reviewer will respond to your issue promptly. +3. If your proposed change is accepted, and you haven't already done so, sign the [Contributor License Agreement (CLA)](http://git.k8s.io/community/CLA.md) +4. Fork the minikube repository, develop and test your code changes. +5. Submit a pull request. + +### Style Guides + +For coding, refer to the [Kubernetes Coding Conventions](https://github.com/kubernetes/community/blob/master/contributors/guide/coding-conventions.md#code-conventions) + +For documentation, refer to the [Kubernetes Documentation Style Guide](https://kubernetes.io/docs/contribute/style/style-guide/) diff --git a/site/content/en/docs/Contributing/iso.md b/site/content/en/docs/Contributing/iso.md new file mode 100644 index 0000000000..f764d05388 --- /dev/null +++ b/site/content/en/docs/Contributing/iso.md @@ -0,0 +1,102 @@ +--- +linkTitle: "ISO" +title: "Building the minikube ISO" +date: 2019-08-09 +weight: 4 +--- +## Overview + +The minikube ISO is booted by each hypervisor to provide a stable minimal Linux environment to start Kubernetes from. It is based on coreboot, uses systemd, and includes all necessary container runtimes and hypervisor guest drivers. + +## Prerequisites + +* A recent Go distribution (>=1.12) +* If you are on Windows, you'll need Docker to be installed. +* 4GB of RAM +* Build tools: + +```shell +sudo apt-get install build-essential gnupg2 p7zip-full git wget cpio python \ + unzip bc gcc-multilib automake libtool locales +``` + +Additionally, if you are on Fedora, you will need to install `glibc-static`: + +```shell +sudo dnf install -y glibc-static +``` + +## Downloading the source + +```shell +git clone https://github.com/kubernetes/minikube.git +cd minikube +``` + +### Building + +```shell +$ make buildroot-image +$ make out/minikube.iso +``` + +The build will occur inside a docker container. If you want to do this on +baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`. +The bootable ISO image will be available in `out/minikube.iso`. + +### Using a local ISO image + +```shell +$ ./out/minikube start --iso-url=file://$(pwd)/out/minikube.iso +``` + +### Modifying buildroot components + +To change which Linux userland components are included by the guest VM, use this to modify the buildroot configuration: + +```shell +cd out/buildroot +make menuconfig +make +``` + +To save these configuration changes, execute: + +```shell +make savedefconfig +``` + +The changes will be reflected in the `minikube-iso/configs/minikube_defconfig` file. + +### Adding kernel modules + +To make kernel configuration changes and save them, execute: + +```shell +$ make linux-menuconfig +``` + +This will open the kernel configuration menu, and then save your changes to our +iso directory after they've been selected. + +### Adding third-party packages + +To add your own package to the minikube ISO, create a package directory under `iso/minikube-iso/package`. This directory will require at least 3 files: + +`.mk` - A Makefile describing how to download the source code and build the program +`.hash` - Checksums to verify the downloaded source code +`Config.in` - buildroot configuration. + +For a relatively simple example to start with, you may want to reference the `podman` package. + +## Continuous Integration Builds + +We publish CI builds of minikube, built at every Pull Request. Builds are available at (substitute in the relevant PR number): + +- +- +- + +We also publish CI builds of minikube-iso, built at every Pull Request that touches deploy/iso/minikube-iso. Builds are available at: + +- diff --git a/site/content/en/docs/Contributing/roadmap.en.md b/site/content/en/docs/Contributing/roadmap.en.md index b938681a32..b931420fb7 100644 --- a/site/content/en/docs/Contributing/roadmap.en.md +++ b/site/content/en/docs/Contributing/roadmap.en.md @@ -12,7 +12,7 @@ Please send a PR to suggest any improvements to it. ## (#1) User-friendly and accessible -- [ ] Creation of a user-centric minikube website for installation & documentation +- [x] Creation of a user-centric minikube website for installation & documentation - [ ] Localized output to 5+ written languages - [x] Make minikube usable in environments with challenging connectivity requirements - [ ] Support lightweight deployment methods for environments where VM's are impractical diff --git a/site/content/en/docs/Contributing/testing.en.md b/site/content/en/docs/Contributing/testing.en.md index 9f3d35ec88..693170241b 100644 --- a/site/content/en/docs/Contributing/testing.en.md +++ b/site/content/en/docs/Contributing/testing.en.md @@ -1,7 +1,7 @@ --- title: "Testing" date: 2019-07-31 -weight: 4 +weight: 3 description: > How to run tests --- diff --git a/site/content/en/docs/Getting started/_virtualbox.md b/site/content/en/docs/Getting started/_virtualbox.md deleted file mode 100644 index 9f2c51c55f..0000000000 --- a/site/content/en/docs/Getting started/_virtualbox.md +++ /dev/null @@ -1,7 +0,0 @@ -Download and install the latest version of VirtualBox from https://www.virtualbox.org/ - -Once installed, start minikube: - -```shell -minikube start -``` diff --git a/site/content/en/docs/Getting started/macos.md b/site/content/en/docs/Getting started/macos.md deleted file mode 100644 index 938b63e7c9..0000000000 --- a/site/content/en/docs/Getting started/macos.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: "macOS" -linkTitle: "macOS" -weight: 2 ---- - -### Prerequisites - -* macOS 10.12 (Sierra) -* A hypervisor such as Hyperkit, Parallels, VirtualBox, or VMware Fusion - -### Installation - -{{% tabs %}} -{{% tab "Brew" %}} - -If you have the [Brew Package Manager](https://brew.sh/) installed, this will download and install minikube to /usr/local/bin: - -```shell -brew install minikube -``` - -{{% /tab %}} -{{% tab "Direct" %}} - -Download and install minikube to /usr/local/bin: - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \ - && sudo install minikube-darwin-amd64 /usr/local/bin/minikube -``` -{{% /tab %}} - -{{% /tabs %}} - -## Hypervisor Setup - -{{% tabs %}} -{{% tab "VirtualBox" %}} -{{% readfile file="/docs/Getting started/_virtualbox.md" %}} -{{% /tab %}} -{{% tab "Hyperkit" %}} - -The easiest way to install hyperkit is using the [Brew Package Manager](https://brew.sh/): - -```shell -brew install hyperkit -``` - -To use minikube and hyperkit reliably, please download and install our improved fork of the driver: - -```shell -curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \ - && sudo install docker-machine-driver-hyperkit /usr/local/bin/ -``` - -This driver requires root privileges to create and destroy network interfaces: - -```shell -sudo chown root:wheel /usr/local/bin -docker-machine-driver-hyperkit \ -&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit -``` - -### Using the hyperkit driver - -```shell -minikube start --vm-driver=hyperkit -``` - -To make hyperkit the default for future invocations: - -```shell -minikube config set vm-driver hyperkit -``` - -{{% /tab %}} - -{{% tab "Parallels" %}} - -Start minikube with Parallels support using: - -```shell -minikube start --vm-driver=parallels -``` - -To make parallels the default for future invocations: - -```shell -minikube config set vm-driver parallels -``` -{{% /tab %}} - -{{% tab "VMware Fusion" %}} - -Start minikube with VMware Fusion support using: - -```shell -minikube start --vm-driver=vmwarefusion -``` - -To make vmwarefusion the default for future invocations: - -```shell -minikube config set vm-driver vmwarefusion -``` -{{% /tab %}} - -{{% /tabs %}} - -{{% readfile file="/docs/Getting started/_post_install.md" %}} \ No newline at end of file diff --git a/site/content/en/docs/Overview/_index.md b/site/content/en/docs/Overview/_index.md index e173cd330e..a31b1d417f 100644 --- a/site/content/en/docs/Overview/_index.md +++ b/site/content/en/docs/Overview/_index.md @@ -8,25 +8,25 @@ description: > minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. -minikube's [primary goals](https://github.com/kubernetes/minikube/blob/master/docs/contributors/principles.md) are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit. +minikube's [primary goals](https://minikube.sigs.k8s.io/docs/concepts/principles/) are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit. minikube runs the latest 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://minikube.sigs.k8s.io/docs/tasks/loadbalancer/) - 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) +* [Persistent Volumes](https://minikube.sigs.k8s.io/docs/reference/persistent_volumes/) * Ingress * RBAC -* [Dashboard](https://github.com/kubernetes/minikube/blob/master/docs/dashboard.md) - `minikube dashboard` -* [Container runtimes](https://github.com/kubernetes/minikube/blob/master/docs/alternative_runtimes.md) - `start --container-runtime` -* [Configure apiserver and kubelet options](https://github.com/kubernetes/minikube/blob/master/docs/configuring_kubernetes.md) via command-line flags +* [Dashboard](https://minikube.sigs.k8s.io/docs/tasks/dashboard/) - `minikube dashboard` +* [Container runtimes](https://minikube.sigs.k8s.io/docs/reference/runtimes/) - `start --container-runtime` +* [Configure apiserver and kubelet options](https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/) via command-line flags As well as developer-friendly features: -* [Addons](https://github.com/kubernetes/minikube/blob/master/docs/addons.md) - a marketplace for developers to share configurations for running services on minikube -* [GPU support](https://github.com/kubernetes/minikube/blob/master/docs/gpu.md) - for machine learning -* [Filesystem mounts](https://github.com/kubernetes/minikube/blob/master/docs/host_folder_mount.md) +* [Addons](https://minikube.sigs.k8s.io/docs/tasks/addons/) - a marketplace for developers to share configurations for running services on minikube +* [GPU support](https://minikube.sigs.k8s.io/docs/tutorials/nvidia_gpu/) - for machine learning +* [Filesystem mounts](https://minikube.sigs.k8s.io/docs/tasks/mount/) * Automatic failure analysis ## Why do I want it? @@ -40,11 +40,10 @@ If you would like to develop Kubernetes applications: Then minikube is for you. * **What is it good for?** Developing local Kubernetes applications -* **What is it not good for?** Production deployments of Kubernetes applications +* **What is it not good for?** Production Kubernetes deployments * **What is it *not yet* good for?** Environments which do not allow VM's ## Where should I go next? -* [Getting Started](/getting-started/): Get started with minikube +* [Getting Started](/start/): Get started with minikube * [Examples](/examples/): Check out some minikube examples! -* \ No newline at end of file diff --git a/site/content/en/docs/Reference/Commands/_index.md b/site/content/en/docs/Reference/Commands/_index.md index 3d61dcedbd..889734bd1f 100644 --- a/site/content/en/docs/Reference/Commands/_index.md +++ b/site/content/en/docs/Reference/Commands/_index.md @@ -1,13 +1,8 @@ --- title: "Commands" -linkTitle: "Command" -weight: 8 -date: 2017-01-05 +linkTitle: "Commands" +weight: 1 +date: 2019-08-01 description: > minikube command reference --- - -{{% pageinfo %}} -This is a placeholder page where command documentation will go. -{{% /pageinfo %}} - diff --git a/site/content/en/docs/Reference/Commands/addons.md b/site/content/en/docs/Reference/Commands/addons.md new file mode 100644 index 0000000000..d15f38173b --- /dev/null +++ b/site/content/en/docs/Reference/Commands/addons.md @@ -0,0 +1,81 @@ +--- +title: "addons" +linkTitle: "addons" +weight: 1 +date: 2019-08-01 +description: > + Modifies minikube addons files using subcommands like "minikube addons enable heapster" +--- + +## Overview + +* **configure**: Configures the addon w/ADDON_NAME within minikube +* **disable**: Disables the addon w/ADDON_NAME within minikube +* **enable**: Enables the addon w/ADDON_NAME within minikube +* **list**: Lists all available minikube addons as well as their current statuses (enabled/disabled) +* **open**: Opens the addon w/ADDON_NAME within minikube + +## minikube addons configure + +Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list + +``` +minikube addons configure ADDON_NAME [flags] +``` + +## minikube addons disable + +Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list + +``` +minikube addons disable ADDON_NAME [flags] +``` + +## minikube addons enable + +Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list + +``` +minikube addons enable ADDON_NAME [flags] +``` + +## minikube addons list + +Lists all available minikube addons as well as their current statuses (enabled/disabled) + +``` +minikube addons list [flags] +``` +## minikube addons open + +Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list + +``` +minikube addons open ADDON_NAME [flags] +``` + +### Options + +``` + --format string Format to output addons URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}") + -h, --help help for open + --https Open the addons URL with https instead of http + --interval int The time interval for each check that wait performs in seconds (default 6) + --url Display the kubernetes addons URL in the CLI instead of opening it in the default browser + --wait int Amount of time to wait for service in seconds (default 20) +``` + + +## Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/cache.md b/site/content/en/docs/Reference/Commands/cache.md new file mode 100644 index 0000000000..cd4b335f6d --- /dev/null +++ b/site/content/en/docs/Reference/Commands/cache.md @@ -0,0 +1,41 @@ +--- +title: "cache" +linkTitle: "cache" +weight: 1 +date: 2019-08-01 +description: > + Add or delete an image from the local cache. +--- + + +## minikube cache add + +Add an image to local cache. + +``` +minikube cache add [flags] +``` + +## minikube cache delete + +Delete an image from the local cache. + +``` +minikube cache delete [flags] +``` + +## minikube cache list + +List all available images from the local cache. + +``` +minikube cache list [flags] +``` + +### Options + +``` + --format string Go template format string for the cache list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/ + For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#CacheListTemplate (default "{{.CacheImage}}\n") + -h, --help help for list +``` diff --git a/site/content/en/docs/Reference/Commands/completion.md b/site/content/en/docs/Reference/Commands/completion.md new file mode 100644 index 0000000000..11fa3a822f --- /dev/null +++ b/site/content/en/docs/Reference/Commands/completion.md @@ -0,0 +1,56 @@ +--- +title: "completion" +linkTitle: "completion" +weight: 1 +date: 2019-08-01 +description: > + Outputs minikube shell completion for the given shell (bash or zsh) +--- + + +### Overview + +Outputs minikube shell completion for the given shell (bash or zsh) + +This depends on the bash-completion binary. Example installation instructions: + +### Usage + +``` +minikube completion SHELL [flags] +``` + +## Example: macOS + +```shell +brew install bash-completion +source $(brew --prefix)/etc/bash_completion +minikube completion bash > ~/.minikube-completion # for bash users +$ minikube completion zsh > ~/.minikube-completion # for zsh users +$ source ~/.minikube-completion +``` + +## Example: Ubuntu + +```shell +apt-get install bash-completion +source /etc/bash-completion +source <(minikube completion bash) # for bash users +source <(minikube completion zsh) # for zsh users +``` + +Additionally, you may want to output the completion to a file and source in your .bashrc + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/config.md b/site/content/en/docs/Reference/Commands/config.md new file mode 100644 index 0000000000..7dd514c8c1 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/config.md @@ -0,0 +1,126 @@ +--- +title: "config" +linkTitle: "config" +weight: 1 +date: 2019-08-01 +description: > + Modify minikube config +--- + +### Overview + +config modifies minikube config files using subcommands like "minikube config set vm-driver kvm" + +Configurable fields: + + * vm-driver + * feature-gates + * v + * cpus + * disk-size + * host-only-cidr + * memory + * log_dir + * kubernetes-version + * iso-url + * WantUpdateNotification + * ReminderWaitPeriodInHours + * WantReportError + * WantReportErrorPrompt + * WantKubectlDownloadMsg + * WantNoneDriverWarning + * profile + * bootstrapper + * ShowDriverDeprecationNotification + * ShowBootstrapperDeprecationNotification + * dashboard + * addon-manager + * default-storageclass + * heapster + * efk + * ingress + * registry + * registry-creds + * freshpod + * default-storageclass + * storage-provisioner + * storage-provisioner-gluster + * metrics-server + * nvidia-driver-installer + * nvidia-gpu-device-plugin + * logviewer + * gvisor + * hyperv-virtual-switch + * disable-driver-mounts + * cache + * embed-certs + +### subcommands + +- **get**: Gets the value of PROPERTY_NAME from the minikube config file + +## minikube config get + +Returns the value of PROPERTY_NAME from the minikube config file. Can be overwritten at runtime by flags or environmental variables. + +### Usage + +``` +minikube config get PROPERTY_NAME [flags] +``` + +## minikube config set + +Sets the PROPERTY_NAME config value to PROPERTY_VALUE + These values can be overwritten by flags or environment variables at runtime. + +### Usage + +``` +minikube config set PROPERTY_NAME PROPERTY_VALUE [flags] +``` + +## minikube config unset + +unsets PROPERTY_NAME from the minikube config file. Can be overwritten by flags or environmental variables + +### Usage + +``` +minikube config unset PROPERTY_NAME [flags] +``` + + +## minikube config view + +### Overview + +Display values currently set in the minikube config file. + +### Usage + +``` +minikube config view [flags] +``` + +### Options + +``` + --format string Go template format string for the config view output. The format for Go templates can be found here: https://golang.org/pkg/text/template/ + For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#ConfigViewTemplate (default "- {{.ConfigKey}}: {{.ConfigValue}}\n") + -h, --help help for view +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/dashboard.md b/site/content/en/docs/Reference/Commands/dashboard.md new file mode 100644 index 0000000000..4457d65dae --- /dev/null +++ b/site/content/en/docs/Reference/Commands/dashboard.md @@ -0,0 +1,35 @@ +--- +title: "dashboard" +linkTitle: "dashboard" +weight: 1 +date: 2019-08-01 +description: > + Access the kubernetes dashboard running within the minikube cluster +--- + +## Usage + +``` +minikube dashboard [flags] +``` + +## Options + +``` + -h, --help help for dashboard + --url Display dashboard URL instead of opening a browser +``` + +## Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/delete.md b/site/content/en/docs/Reference/Commands/delete.md new file mode 100644 index 0000000000..77fb77de51 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/delete.md @@ -0,0 +1,33 @@ +--- +title: "delete" +linkTitle: "delete" +weight: 1 +date: 2019-08-01 +description: > + Deletes a local kubernetes cluster +--- + +### Overview + +Deletes a local kubernetes cluster. This command deletes the VM, and removes all +associated files. + +## Usage + +``` +minikube delete [flags] +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/docker-env.md b/site/content/en/docs/Reference/Commands/docker-env.md new file mode 100644 index 0000000000..2260564680 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/docker-env.md @@ -0,0 +1,37 @@ +--- +title: "docker-env" +linkTitle: "docker-env" +weight: 1 +date: 2019-08-01 +description: > + Sets up docker env variables; similar to '$(docker-machine env)' +--- + +### Usage + +``` +minikube docker-env [flags] +``` + +### Options + +``` + -h, --help help for docker-env + --no-proxy Add machine IP to NO_PROXY environment variable + --shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect + -u, --unset Unset variables instead of setting them +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/ip.md b/site/content/en/docs/Reference/Commands/ip.md new file mode 100644 index 0000000000..020fe0ed65 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/ip.md @@ -0,0 +1,32 @@ +--- +title: "ip" +linkTitle: "ip" +weight: 1 +date: 2019-08-01 +description: > + Retrieves the IP address of the running cluster +--- + +### Overview + +Retrieves the IP address of the running cluster, and writes it to STDOUT. + +### Usage + +``` +minikube ip [flags] +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/kubectl.md b/site/content/en/docs/Reference/Commands/kubectl.md new file mode 100644 index 0000000000..bd1d399090 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/kubectl.md @@ -0,0 +1,41 @@ +--- +title: "kubectl" +linkTitle: "kubectl" +weight: 1 +date: 2019-08-01 +description: > + Run kubectl +--- + + +### Overview + +Run the kubernetes client, download it if necessary. + +### Usage + +``` +minikube kubectl [flags] +``` + +### Examples: + +``` +minikube kubectl -- --help +kubectl get pods --namespace kube-system +``` + + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/logs.md b/site/content/en/docs/Reference/Commands/logs.md new file mode 100644 index 0000000000..0466ff747f --- /dev/null +++ b/site/content/en/docs/Reference/Commands/logs.md @@ -0,0 +1,37 @@ +--- +title: "logs" +linkTitle: "logs" +weight: 1 +date: 2019-08-01 +description: > + Gets the logs of the running instance, used for debugging minikube, not user code +--- + +## Usage + +``` +minikube logs [flags] +``` + +### Options + +``` + -f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal. + -h, --help help for logs + -n, --length int Number of lines back to go within the log (default 50) + --problems Show only log entries which point to known problems +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/mount.md b/site/content/en/docs/Reference/Commands/mount.md new file mode 100644 index 0000000000..fa85b70922 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/mount.md @@ -0,0 +1,43 @@ +--- +title: "mount" +linkTitle: "mount" +weight: 1 +date: 2019-08-01 +description: > + Mounts the specified directory into minikube +--- + +### Usage + +``` +minikube mount [flags] : +``` + +### Options + +``` + --9p-version string Specify the 9p version that the mount should use (default "9p2000.L") + --gid string Default group id used for the mount (default "docker") + -h, --help help for mount + --ip string Specify the ip that the mount should be setup on + --kill Kill the mount process spawned by minikube start + --mode uint File permissions used for the mount (default 493) + --msize int The number of bytes to use for 9p packet payload (default 262144) + --options strings Additional mount options, such as cache=fscache + --type string Specify the mount filesystem type (supported types: 9p) (default "9p") + --uid string Default user id used for the mount (default "docker") +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/profile.md b/site/content/en/docs/Reference/Commands/profile.md new file mode 100644 index 0000000000..86fd88f796 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/profile.md @@ -0,0 +1,51 @@ +--- +title: "profile" +linkTitle: "profile" +weight: 1 +date: 2019-08-01 +description: > + Profile gets or sets the current minikube profile +--- + +### Overview + +profile sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default` + +### Usage + +``` +minikube profile [MINIKUBE_PROFILE_NAME] + +You can return to the default minikube profile by running `minikube profile default` [flags] +``` + +## Subcommands + +- **list**: Lists all minikube profiles. + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + + +## minikube profile list + +Lists all minikube profiles. + +### Overview + +Lists all valid minikube profiles and detects all possible invalid profiles. + +``` +minikube profile list [flags] +``` diff --git a/site/content/en/docs/Reference/Commands/service.md b/site/content/en/docs/Reference/Commands/service.md new file mode 100644 index 0000000000..e89859fd35 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/service.md @@ -0,0 +1,64 @@ +--- +title: "service" +linkTitle: "service" +weight: 1 +date: 2019-08-01 +description: > + Gets the kubernetes URL(s) for the specified service in your local cluster +--- + +### Overview + +Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time. + +### Usage + +``` +minikube service [flags] SERVICE +``` + +### Subcommands + +- **list**: Lists the URLs for the services in your local cluster + +### Options + +``` + --format string Format to output service URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}") + -h, --help help for service + --https Open the service URL with https instead of http + --interval int The time interval for each check that wait performs in seconds (default 6) + -n, --namespace string The service namespace (default "default") + --url Display the kubernetes service URL in the CLI instead of opening it in the default browser + --wait int Amount of time to wait for a service in seconds (default 20) +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + +## minikube service list + +Lists the URLs for the services in your local cluster + +``` +minikube service list [flags] +``` + +### Options + +``` + -h, --help help for list + -n, --namespace string The services namespace +``` + diff --git a/site/content/en/docs/Reference/Commands/ssh-key.md b/site/content/en/docs/Reference/Commands/ssh-key.md new file mode 100644 index 0000000000..271c736878 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/ssh-key.md @@ -0,0 +1,28 @@ +--- +title: "ssh-key" +linkTitle: "sshs-key" +weight: 1 +date: 2019-08-01 +description: > + Retrieve the ssh identity key path of the specified cluster +--- + +### Usage + +``` +minikube ssh-key [flags] +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/ssh.md b/site/content/en/docs/Reference/Commands/ssh.md new file mode 100644 index 0000000000..6be1d3247c --- /dev/null +++ b/site/content/en/docs/Reference/Commands/ssh.md @@ -0,0 +1,30 @@ +--- +title: "ssh" +linkTitle: "ssh" +weight: 1 +date: 2019-08-01 +description: > + Log into or run a command on a machine with SSH; similar to 'docker-machine ssh' +--- + + +### Usage + +``` +minikube ssh [flags] +``` +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/start.md b/site/content/en/docs/Reference/Commands/start.md new file mode 100644 index 0000000000..cf4d774d8b --- /dev/null +++ b/site/content/en/docs/Reference/Commands/start.md @@ -0,0 +1,81 @@ +--- +title: "start" +linkTitle: "start" +weight: 1 +date: 2019-08-01 +description: > + Starts a local kubernetes cluster +--- + +### Usage + +``` +minikube start [flags] +``` + +### Options + +``` + --apiserver-ips ipSlice A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default []) + --apiserver-name string The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA") + --apiserver-names stringArray A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine + --apiserver-port int The apiserver listening port (default 8443) + --cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none. (default true) + --container-runtime string The container runtime to be used (docker, crio, containerd) (default "docker") + --cpus int Number of CPUs allocated to the minikube VM (default 2) + --cri-socket string The cri socket path to be used + --disk-size string Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "20000mb") + --dns-domain string The cluster dns domain name used in the kubernetes cluster (default "cluster.local") + --dns-proxy Enable proxy for NAT DNS requests (virtualbox) + --docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value) + --docker-opt stringArray Specify arbitrary flags to pass to the Docker daemon. (format: key=value) + --download-only If true, only download and cache files for later use - don't install or start anything. + --enable-default-cni Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni" + --extra-config ExtraOption A set of key=value pairs that describe configuration that may be passed to different components. + The key should be '.' separated, and the first part before the dot is the component to apply the configuration to. + Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler + Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr + --feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental features. + -h, --help help for start + --host-dns-resolver Enable host resolver for NAT DNS requests (virtualbox) (default true) + --host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24") + --hyperkit-vpnkit-sock string Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock. + --hyperkit-vsock-ports strings List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now). + --hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver) + --image-mirror-country string Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn + --image-repository string Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers + --insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added. + --iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso") + --keep-context This will keep the existing kubectl context and will create a minikube context. + --kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3) (default "v1.15.1") + --kvm-gpu Enable experimental NVIDIA GPU support in minikube + --kvm-hidden Hide the hypervisor signature from the guest in minikube + --kvm-network string The KVM network name. (only supported with KVM driver) (default "default") + --kvm-qemu-uri string The KVM QEMU connection URI. (works only with kvm2 driver on linux) (default "qemu:///system") + --memory string Amount of RAM allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "2000mb") + --mount This will start the mount daemon and automatically mount files into minikube + --mount-string string The argument to pass the minikube mount command on start (default "/Users:/minikube-host") + --network-plugin string The name of the network plugin + --nfs-share strings Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now) + --nfs-shares-root string Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now) (default "/nfsshares") + --no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started (virtualbox) + --registry-mirror strings Registry mirrors to pass to the Docker daemon + --service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12") + --uuid string Provide VM UUID to restore MAC address (only supported with Hyperkit driver). + --vm-driver string VM driver is one of: [virtualbox parallels vmwarefusion hyperkit vmware] (default "virtualbox") + --wait Wait until Kubernetes core services are healthy before exiting (default true) +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/status.md b/site/content/en/docs/Reference/Commands/status.md new file mode 100644 index 0000000000..cd08136d33 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/status.md @@ -0,0 +1,43 @@ +--- +title: "status" +linkTitle: "status" +weight: 1 +date: 2019-08-01 +description: > + Gets the status of a local kubernetes cluster +--- + + +### Overview + +Gets the status of a local kubernetes cluster. + Exit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left. + Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK) + +### Usage + +``` +minikube status [flags] +``` + +### Options + +``` + --format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/ + For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "host: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubectl: {{.Kubeconfig}}\n") + -h, --help help for status +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/stop.md b/site/content/en/docs/Reference/Commands/stop.md new file mode 100644 index 0000000000..51f8a89b4c --- /dev/null +++ b/site/content/en/docs/Reference/Commands/stop.md @@ -0,0 +1,33 @@ +--- +title: "stop" +linkTitle: "stop" +weight: 1 +date: 2019-08-01 +description: > + Stops a running local kubernetes cluster +--- + +### Overview + +Stops a local kubernetes cluster running in Virtualbox. This command stops the VM +itself, leaving all files intact. The cluster can be started again with the "start" command. + +### Usage + +``` +minikube stop [flags] +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/tunnel.md b/site/content/en/docs/Reference/Commands/tunnel.md new file mode 100644 index 0000000000..e33e4d80a1 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/tunnel.md @@ -0,0 +1,40 @@ +--- +title: "tunnel" +linkTitle: "tunnel" +weight: 1 +date: 2019-08-01 +description: > + tunnel makes services of type LoadBalancer accessible on localhost +--- + +### Overview + +tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP + +### Usage + +``` +minikube tunnel [flags] +``` + +### Options + +``` + -c, --cleanup call with cleanup=true to remove old tunnels + -h, --help help for tunnel +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + diff --git a/site/content/en/docs/Reference/Commands/update-check.md b/site/content/en/docs/Reference/Commands/update-check.md new file mode 100644 index 0000000000..17a666bffd --- /dev/null +++ b/site/content/en/docs/Reference/Commands/update-check.md @@ -0,0 +1,14 @@ +--- +title: "update-check" +linkTitle: "update-check" +weight: 1 +date: 2019-08-01 +description: > + Print current and latest version number +--- + +### Usage + +``` +minikube update-check [flags] +``` diff --git a/site/content/en/docs/Reference/Commands/update-context.md b/site/content/en/docs/Reference/Commands/update-context.md new file mode 100644 index 0000000000..ba6e3c0b23 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/update-context.md @@ -0,0 +1,28 @@ +--- +title: "update-context" +linkTitle: "update-context" +weight: 1 +date: 2019-08-01 +description: > + Verify the IP address of the running cluster in kubeconfig. +--- + +The `update-context` command retrieves the IP address of the running cluster, checks it with IP in kubeconfig, and corrects kubeconfig if incorrect: + +``` +minikube update-context [flags] +``` + +## Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` diff --git a/site/content/en/docs/Reference/Commands/version.md b/site/content/en/docs/Reference/Commands/version.md new file mode 100644 index 0000000000..df909b4153 --- /dev/null +++ b/site/content/en/docs/Reference/Commands/version.md @@ -0,0 +1,32 @@ +## minikube version + +Print the version of minikube + +### Overview + +Print the version of minikube. + +``` +minikube version [flags] +``` + +### Options + +``` + -h, --help help for version +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + diff --git a/site/content/en/docs/Reference/Configuration/_index.md b/site/content/en/docs/Reference/Configuration/_index.md new file mode 100644 index 0000000000..1615c60d70 --- /dev/null +++ b/site/content/en/docs/Reference/Configuration/_index.md @@ -0,0 +1,8 @@ +--- +title: "Configuration" +linkTitle: "Configuration" +weight: 1 +date: 2019-08-01 +description: > + minikube configuration reference +--- \ No newline at end of file diff --git a/site/content/en/docs/Reference/Configuration/kubernetes.md b/site/content/en/docs/Reference/Configuration/kubernetes.md new file mode 100644 index 0000000000..1ef79adebf --- /dev/null +++ b/site/content/en/docs/Reference/Configuration/kubernetes.md @@ -0,0 +1,52 @@ +--- +title: "Kubernetes" +linkTitle: "Kubernetes" +weight: 3 +date: 2019-08-01 +description: > + Kubernetes configuration reference +--- + +minikube 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. + +## Selecting a Kubernetes version + +minikube defaults to the latest stable version of Kubernetes. You may select a different Kubernetes release by using the `--kubernetes-version` flag, for example: + + `minikube start --kubernetes-version=v1.10.13` + +minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube extends this policy two additional minor releases so that users can emulate legacy environments. + +As of April 2019, this means that minikube supports and actively tests against the latest builds of: + +* v1.14 (default) +* v1.13 +* v1.12 +* v1.11 (best effort) +* v1.10 (best effort) + +For more up to date information, see `OldestKubernetesVersion` and `NewestKubernetesVersion` in [constants.go](https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go) + +## Modifying Kubernetes defaults + +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 + +* kubeadm +* kubelet +* apiserver +* controller-manager +* scheduler + +and `key=value` is a flag=value pair for the component being configured. For example, + +```shell +minikube start --extra-config=apiserver.v=10 --extra-config=kubelet.max-pods=100 +``` + +For instance, to allow Kubernetes to launch on an unsupported Docker release: + +```shell +minikube start --extra-config=kubeadm.ignore-preflight-errors=SystemVerification +``` \ No newline at end of file diff --git a/site/content/en/docs/Reference/Configuration/minikube.md b/site/content/en/docs/Reference/Configuration/minikube.md new file mode 100644 index 0000000000..9b8a6f6d39 --- /dev/null +++ b/site/content/en/docs/Reference/Configuration/minikube.md @@ -0,0 +1,165 @@ +--- +title: "minikube" +linkTitle: "minikube" +weight: 2 +date: 2019-08-01 +description: > + minikube configuration reference +--- + +## Flags + +Most minikube configuration is done via the flags interface. To see which flags are possible for the start command, run: + +```shell +minikube start --help +``` + +For example: + +```shell +minikube start --apiserver-port 9999 +``` + +Many of these flags are also available to be set via persistent configuration or environment variables. +While most flags are applicable to any command, some are globally scoped: + +``` +Flags: + --alsologtostderr log to standard error as well as files + -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm") + -h, --help help for minikube + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + -p, --profile string The name of the minikube VM being used. + This can be modified to allow for multiple minikube instances to be run independently (default "minikube") + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + +## Persistent Configuration + +minikube allows users to persistently store new default values to be used across all profiles, using the `minikube config` command. This is done providing a property name, and a property value. + +### Listing config properties + +```shell +minikube config +``` + +Example: + +```shell +Configurable fields: + + * vm-driver + * feature-gates + * v + * cpus + * disk-size + * host-only-cidr + * memory + * log_dir + * kubernetes-version + * iso-url + * WantUpdateNotification + * ReminderWaitPeriodInHours + * WantReportError + * WantReportErrorPrompt + * WantKubectlDownloadMsg + * WantNoneDriverWarning + * profile + * bootstrapper + * ShowDriverDeprecationNotification + * ShowBootstrapperDeprecationNotification + * dashboard + * addon-manager + * default-storageclass + * heapster + * efk + * ingress + * registry + * registry-creds + * freshpod + * default-storageclass + * storage-provisioner + * storage-provisioner-gluster + * metrics-server + * nvidia-driver-installer + * nvidia-gpu-device-plugin + * logviewer + * gvisor + * hyperv-virtual-switch + * disable-driver-mounts + * cache + * embed-certs +``` + +### Listing your property overrides + +```shell +minikube config view +``` + +Example output: + +```shell +- memory: 4096 +- registry: true +- vm-driver: vmware +- dashboard: true +- gvisor: true +``` + +### Setting a new property override + + +```shell +minikube config set +``` + +For example: + +```shell +minikube config set vm-driver hyperkit +``` + +## Environment Configuration + +### Config 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_`. + +For example the `minikube start --iso-url="$ISO_URL"` flag can also be set by setting the `MINIKUBE_ISO_URL="$ISO_URL"` environment variable. + +### Other variables + +Some features can only be accessed by environment variables, here is a list of these features: + +* **MINIKUBE_HOME** - (string) sets the path for the .minikube directory that minikube uses for state/configuration + +* **MINIKUBE_IN_STYLE** - (bool) manually sets whether or not emoji and colors should appear in minikube. Set to false or 0 to disable this feature, true or 1 to force it to be turned on. + +* **MINIKUBE_WANTUPDATENOTIFICATION** - (bool) sets whether the user wants an update notification for new minikube versions + +* **MINIKUBE_REMINDERWAITPERIODINHOURS** - (int) sets the number of hours to check for an update notification + +* **CHANGE_MINIKUBE_NONE_USER** - (bool) automatically change ownership of ~/.minikube to the value of $SUDO_USER + +* **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube + +### Making environment variables persistent + +To make the exported variables persistent: + +* Linux and macOS: Add these declarations to `~/.bashrc` or wherever your shells environment variables are stored. +* Windows: Add these declarations via [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe) + +#### Example: Disabling emoji + +```shell +export MINIKUBE_IN_STYLE=false +minikube start +``` diff --git a/site/content/en/docs/Reference/Drivers/_index.md b/site/content/en/docs/Reference/Drivers/_index.md index f3ca3ba2fb..c1c0adb612 100644 --- a/site/content/en/docs/Reference/Drivers/_index.md +++ b/site/content/en/docs/Reference/Drivers/_index.md @@ -3,6 +3,8 @@ title: "Drivers" linkTitle: "Drivers" weight: 8 date: 2017-01-05 +date: 2018-08-05 description: > - Configuring minikube drivers + Configuring various minikube drivers --- +minikube uses the Docker Machine library to provide a consistent way to interact with hypervisors. While most drivers are linked directly into the minikube program, some may require an additional binary to be downloaded due to technical or legal restrictions. diff --git a/site/content/en/docs/Reference/Drivers/hyperkit.md b/site/content/en/docs/Reference/Drivers/hyperkit.md new file mode 100644 index 0000000000..6ca563a794 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/hyperkit.md @@ -0,0 +1,41 @@ +--- +title: "hyperkit" +linkTitle: "hyperkit" +weight: 1 +date: 2018-08-08 +description: > + HyperKit driver +--- + +## Overview + +[HyperKit](https://github.com/moby/hyperkit) is an open-source hypervisor for macOS hypervisor, optimized for lightweight virtual machines and container deployment. + +{{% readfile file="/docs/Reference/Drivers/includes/hyperkit_usage.inc" %}} + +## Special features + +minikube start supports additional hyperkit specific flags: + +* **`--hyperkit-vpnkit-sock`**: Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSoc +* **`--hyperkit-vsock-ports`**: List of guest VSock ports that should be exposed as sockets on the host +* **`--nfs-share`**: Local folders to share with Guest via NFS mounts +* **`--nfs-shares-root`**: Where to root the NFS Shares (default "/nfsshares") +* **`--uuid`**: Provide VM UUID to restore MAC address + +## Issues + +### Local DNS server conflict + +If you are using `dnsmasq` and `minikube` fails, add `listen-address=192.168.64.1` to dnsmasq.conf. + +If you are running other DNS servers, shut them off or specify an alternative bind address. + +### Other + +* [Full list of open 'hyperkit' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fhyperkit) + +## Troubleshooting + +* Run `docker-machine-driver-hyperkit version` to make sure the version matches minikube +* Run `minikube start --alsologtostderr -v=7` to debug crashes diff --git a/site/content/en/docs/Reference/Drivers/hyperv.md b/site/content/en/docs/Reference/Drivers/hyperv.md new file mode 100644 index 0000000000..909f1e03f8 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/hyperv.md @@ -0,0 +1,29 @@ +--- +title: "hyperv" +linkTitle: "hyperv" +weight: 2 +date: 2017-01-05 +date: 2018-08-05 +description: > + Microsoft Hyper-V driver +--- + +## Overview + +Hyper-V is a native hypervisor built in to modern versions of Microsoft Windows. + +{{% readfile file="/docs/Reference/Drivers/includes/hyperv_usage.inc" %}} + +## Special features + +The `minikube start` command supports additional hyperv specific flags: + +* **`--hyperv-virtual-switch`**: The hyperv virtual switch name. Defaults to first found + +## Issues + +Also see [co/hyperv open issues](https://github.com/kubernetes/minikube/labels/co%2Fhyperv) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=7` to debug crashes diff --git a/site/content/en/docs/Reference/Drivers/includes/hyperkit_usage.inc b/site/content/en/docs/Reference/Drivers/includes/hyperkit_usage.inc new file mode 100644 index 0000000000..849fa3fcb3 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/hyperkit_usage.inc @@ -0,0 +1,24 @@ +## Requirements + +- macOS 10.11+ +- HyperKit + +## HyperKit installation + +* If Docker for Desktop is installed, you already have HyperKit +* Otherwise, if you have [Brew Package Manager](https://brew.sh/), run: + +```shell +brew install hyperkit +``` + +* As a final alternative, you may [Install HyperKit from GitHub](https://github.com/moby/hyperkit) + +## Driver installation + +You must also download and install the latest minikube driver: + +```shell +curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \ +&& sudo install -o root -m 4755 docker-machine-driver-hyperkit /usr/local/bin/ +``` \ No newline at end of file diff --git a/site/content/en/docs/Reference/Drivers/includes/hyperv_usage.inc b/site/content/en/docs/Reference/Drivers/includes/hyperv_usage.inc new file mode 100644 index 0000000000..9a5b7918e2 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/hyperv_usage.inc @@ -0,0 +1,52 @@ +## Requirements + +* Windows 10 Enterprise, Pro, or Education ([system requirements](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-requirements)) +* Hyper-V enabled +* An active Hyper-V switch + +## Enabling Hyper-V + +Open a PowerShell console as Administrator, and run the following command: + +```powershell +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All +``` + +If Hyper-V was not previously active, you will need to reboot. + +## Network Configuration + +Create a Hyper-V external network switch + +### Using Hyper-V Manager + +1. Open the Hyper-V Manager. (On Windows 10, search for the Hyper-V Manager in the lower left search field.) +2. Select the Virtual Switch Manager on the right-hand Actions panel. +3. Set up a new external network switch to use, named `ExternalSwitch` + * If you already have another network switch set up, use that one instead but make sure it is an external switch. + +### Using PowerShell + +**NOTE: This command is speculative, and may not work in all environments. You may need to use the Hyper-V Administrator UI for wireless interfaces.** + +```powershell +New-VMSwitch -name ExternalSwitch -NetAdapterName Ethernet -AllowManagementOS $true +``` + +## Usage + +Set the switch you created as the minikube default: + +```shell +minikube config set hyperv-virtual-switch ExternalSwitch +``` + + +```shell +minikube start --vm-driver=hyperv +``` +To make hyperv the default driver: + +```shell +minikube config set vm-driver hyperv +``` diff --git a/site/content/en/docs/Reference/Drivers/includes/kvm2_usage.inc b/site/content/en/docs/Reference/Drivers/includes/kvm2_usage.inc new file mode 100644 index 0000000000..2be6136a17 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/kvm2_usage.inc @@ -0,0 +1,29 @@ +## Requirements + +- libvirt v1.3.1 or higher +- qemu-kvm v2.0 or higher + +## Installing Prerequisites + +Proper installation of KVM and libvirt is highly specific to each Linux distribution. Please consult: + +* [ArchLinux](https://wiki.archlinux.org/index.php/Libvirt) +* [Debian](https://wiki.debian.org/KVM#Installation) +* [Fedora](https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-virtualization/) +* [Gentoo](https://wiki.gentoo.org/wiki/QEMU) +* [OpenSUSE](https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha.vt.installation.html) +* [RedHat](https://access.redhat.com/articles/1344173#Q_how-install-virtualization-packages) +* [Ubuntu](https://help.ubuntu.com/community/KVM/Installation) + +Once configured, validate that libvirt reports no errors: + +```shell +virt-host-validate +``` + +## Driver installation + +```shell + curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \ + && sudo install docker-machine-driver-kvm2 /usr/local/bin/ +``` diff --git a/site/content/en/docs/Reference/Drivers/includes/none_usage.inc b/site/content/en/docs/Reference/Drivers/includes/none_usage.inc new file mode 100644 index 0000000000..d6893edd5c --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/none_usage.inc @@ -0,0 +1,17 @@ +## Requirements + +VM running a systemd-based Linux distribution ([see #2704](https://github.com/kubernetes/minikube/issues/2704)) + +## Usage + +The none driver requires minikube to be run as root, until [#3760](https://github.com/kubernetes/minikube/issues/3760) can be addressed. + +```shell +sudo minikube start --vm-driver=none +``` + +To make none the default for future invocations, run: + +```shell +sudo minikube config set vm-driver none +``` diff --git a/site/content/en/docs/Reference/Drivers/includes/parallels_usage.inc b/site/content/en/docs/Reference/Drivers/includes/parallels_usage.inc new file mode 100644 index 0000000000..7e26181b49 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/parallels_usage.inc @@ -0,0 +1,19 @@ +## Requirements + +* Parallels Desktop 11.0.0+ Pro or Business edition + +## Driver Installation + +If the [Brew Package Manager](https://brew.sh/) is installed, run: + +```shell +brew install docker-machine-driver-parallels +``` + +Otherwise: + +```shell +r=https://api.github.com/repos/Parallels/docker-machine-parallels +curl -LO $(curl -s $r/releases/latest | grep -o 'http.*parallels' | head -n1) \ + && install docker-machine-driver-parallels /usr/local/bin/ +``` diff --git a/site/content/en/docs/Reference/Drivers/includes/virtualbox_usage.inc b/site/content/en/docs/Reference/Drivers/includes/virtualbox_usage.inc new file mode 100644 index 0000000000..bb67f88d29 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/virtualbox_usage.inc @@ -0,0 +1,16 @@ +## Requirements + +- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) 5.2 or higher + +## Usage + +minikube currently uses VirtualBox by default, but it can also be explicitly set: + +```shell +minikube start --vm-driver=virtualbox +``` +To make virtualbox the default driver: + +```shell +minikube config set vm-driver virtualbox +``` diff --git a/site/content/en/docs/Reference/Drivers/includes/vmware_macos_usage.inc b/site/content/en/docs/Reference/Drivers/includes/vmware_macos_usage.inc new file mode 100644 index 0000000000..e7f15b381f --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/includes/vmware_macos_usage.inc @@ -0,0 +1,31 @@ +## Requirements + +* VMware Fusion + +## Driver Installation + +If the [Brew Package Manager](https://brew.sh/) is installed, run: + +```shell +brew install docker-machine-driver-vmware +``` + +Otherwise: + +```shell +r=https://api.github.com/repos/machine-drivers/docker-machine-driver-vmware +curl -LO $(curl -s $r/releases/latest | grep -o 'http.*darwin_amd64' | head -n1) \ + && install docker-machine-driver-vmware_darwin_amd64 \ + /usr/local/bin/docker-machine-driver-vmware +``` + +## Usage + +```shell +minikube start --vm-driver=vmware +``` +To make vmware the default driver: + +```shell +minikube config set vm-driver vmware +``` diff --git a/site/content/en/docs/Reference/Drivers/kvm2.md b/site/content/en/docs/Reference/Drivers/kvm2.md new file mode 100644 index 0000000000..066eabb4a9 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/kvm2.md @@ -0,0 +1,39 @@ +--- +title: "kvm2" +linkTitle: "kvm2" +weight: 2 +date: 2017-01-05 +date: 2018-08-05 +description: > + Linux KVM (Kernel-based Virtual Machine) driver +--- + +## Overview + +[KVM (Kernel-based Virtual Machine)](https://www.linux-kvm.org/page/Main_Page) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions. To work with KVM, minikube uses the [libvirt virtualization API](https://libvirt.org/) + +{{% readfile file="/docs/Reference/Drivers/includes/kvm2_usage.inc" %}} + +## Special features + +The `minikube start` command supports 3 additional kvm specific flags: + +* **`--gpu`**: Enable experimental NVIDIA GPU support in minikube +* **`--hidden`**: Hide the hypervisor signature from the guest in minikube +* **`--kvm-network`**: The KVM network name + +## Issues + +* `minikube` will repeatedly for the root password if user is not in the correct `libvirt` group [#3467](https://github.com/kubernetes/minikube/issues/3467) +* `Machine didn't return an IP after 120 seconds` when firewall prevents VM network access [#3566](https://github.com/kubernetes/minikube/issues/3566) +* `unable to set user and group to '65534:992` when `dynamic ownership = 1` in `qemu.conf` [#4467](https://github.com/kubernetes/minikube/issues/4467) +* KVM VM's cannot be used simultaneously with VirtualBox [#4913](https://github.com/kubernetes/minikube/issues/4913) +* On some distributions, libvirt bridge networking may fail until the host reboots + +Also see [co/kvm2 open issues](https://github.com/kubernetes/minikube/labels/co%2Fkvm2) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=7` to debug crashes +* Run `docker-machine-driver-kvm2 version` to verify the kvm2 driver executes properly. +* Read [How to debug Virtualization problems](https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems) diff --git a/site/content/en/docs/Reference/Drivers/none.md b/site/content/en/docs/Reference/Drivers/none.md new file mode 100644 index 0000000000..f9591bca67 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/none.md @@ -0,0 +1,65 @@ +--- +title: "none" +linkTitle: "none" +weight: 3 +date: 2017-01-05 +date: 2018-08-05 +description: > + Linux none (bare-metal) driver +--- + +## Overview + +This document is written for system integrators who are familiar with minikube, and wish to run it within a customized VM environment. The `none` driver allows advanced minikube users to skip VM creation, allowing minikube to be run on a user-supplied VM. + +{{% readfile file="/docs/Reference/Drivers/includes/none_usage.inc" %}} + +## Issues + +### Decreased security + +* minikube starts services that may be available on the Internet. Please ensure that you have a firewall to protect your host from unexpected access. For instance: + * apiserver listens on TCP *:8443 + * kubelet listens on TCP *:10250 and *:10255 + * kube-scheduler listens on TCP *:10259 + * kube-controller listens on TCP *:10257 +* Containers may have full access to your filesystem. +* Containers may be able to execute arbitrary code on your host, by using container escape vulnerabilities such as [CVE-2019-5736](https://access.redhat.com/security/vulnerabilities/runcescape). Please keep your release of minikube up to date. + +### Decreased reliability + +* minikube with the none driver may be tricky to configure correctly at first, because there are many more chances for interference with other locally run services, such as dnsmasq. + +* When run in `none` mode, minikube has no built-in resource limit mechanism, which means you could deploy pods which would consume all of the hosts resources. + +* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, containerd, cri-o. + +### Data loss + +With the `none` driver, minikube will overwrite the following system paths: + +* /usr/bin/kubeadm - Updated to match the exact version of Kubernetes selected +* /usr/bin/kubelet - Updated to match the exact version of Kubernetes selected +* /etc/kubernetes - configuration files + +These paths will be erased when running `minikube delete`: + +* /data/minikube +* /etc/kubernetes/manifests +* /var/lib/minikube + +As Kubernetes has full access to both your filesystem as well as your docker images, it is possible that other unexpected data loss issues may arise. + +### Other + +* `-p` (profiles) are unsupported: It is not possible to run more than one `--vm-driver=none` instance +* Many `minikube` commands are not supported, such as: `dashboard`, `mount`, `ssh` +* minikube with the `none` driver has a confusing permissions model, as some commands need to be run as root ("start"), and others by a regular user ("dashboard") +* CoreDNS detects resolver loop, goes into CrashLoopBackOff - [#3511](https://github.com/kubernetes/minikube/issues/3511) +* Some versions of Linux have a version of docker that is newer then what Kubernetes expects. To overwrite this, run minikube with the following parameters: `sudo -E minikube start --vm-driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification` + +* [Full list of open 'none' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fnone-driver) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=4` to debug crashes diff --git a/site/content/en/docs/Reference/Drivers/parallels.md b/site/content/en/docs/Reference/Drivers/parallels.md new file mode 100644 index 0000000000..8bcfbb0222 --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/parallels.md @@ -0,0 +1,22 @@ +--- +title: "parallels" +linkTitle: "parallels" +weight: 4 +date: 2018-08-08 +description: > + Parallels driver +--- + +## Overview + +The Parallels driver is particularly useful for users who own Parallels Desktop, as it does not require VT-x hardware support. + +{{% readfile file="/docs/Reference/Drivers/includes/parallels_usage.inc" %}} + +## Issues + +* [Full list of open 'parallels' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fparallels) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=7` to debug crashes diff --git a/site/content/en/docs/Reference/Drivers/virtualbox.md b/site/content/en/docs/Reference/Drivers/virtualbox.md new file mode 100644 index 0000000000..f979ad499e --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/virtualbox.md @@ -0,0 +1,29 @@ +--- +title: "virtualbox" +linkTitle: "virtualbox" +weight: 5 +date: 2018-08-08 +description: > + VirtualBox driver +--- + +## Overview + +VirtualBox is the oldest and most stable VM driver for minikube. + +{{% readfile file="/docs/Reference/Drivers/includes/virtualbox_usage.inc" %}} + +## Special features + +minikube start supports some VirtualBox specific flags: + +* **`--host-only-cidr`**: The CIDR to be used for the minikube VM (default "192.168.99.1/24") +* **`--no-vtx-check`**: Disable checking for the availability of hardware virtualization + +## Issues + +* [Full list of open 'virtualbox' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fvirtualbox) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=7` to debug crashes diff --git a/site/content/en/docs/Reference/Drivers/vmware.md b/site/content/en/docs/Reference/Drivers/vmware.md new file mode 100644 index 0000000000..cd355144aa --- /dev/null +++ b/site/content/en/docs/Reference/Drivers/vmware.md @@ -0,0 +1,32 @@ +--- +title: "vmware" +linkTitle: "vmware" +weight: 6 +date: 2018-08-08 +description: > + VMware driver +--- + +## Overview + +The vmware driver supports virtualization across all VMware based hypervisors. + +{{% tabs %}} +{{% tab "macOS" %}} +{{% readfile file="/docs/Reference/Drivers/includes/vmware_macos_usage.inc" %}} +{{% /tab %}} +{{% tab "Linux" %}} +No documentation is available yet. +{{% /tab %}} +{{% tab "Windows" %}} +No documentation is available yet. +{{% /tab %}} +{{% /tabs %}} + +## Issues + +* [Full list of open 'vmware' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fvmware) + +## Troubleshooting + +* Run `minikube start --alsologtostderr -v=7` to debug crashes diff --git a/site/content/en/docs/Reference/Networking/_index.md b/site/content/en/docs/Reference/Networking/_index.md index 1e2effb540..b1add3ea29 100644 --- a/site/content/en/docs/Reference/Networking/_index.md +++ b/site/content/en/docs/Reference/Networking/_index.md @@ -1,10 +1,10 @@ --- title: "Networking" linkTitle: "Networking" -weight: 8 -date: 2017-01-05 +weight: 6 +date: 2018-08-01 description: > - Configuring networking with minikube + How minikube interacts with networks. --- -Since minikube runs all services within a VM environment, networking gets pretty complicated. Networking is both a popular topic among power users, and the most common cause for failed minikube deployments. +Since minikube runs everything from within a VM, networking can get fairly complicated. \ No newline at end of file diff --git a/site/content/en/docs/Reference/Networking/proxy.md b/site/content/en/docs/Reference/Networking/proxy.md new file mode 100644 index 0000000000..fa3690b103 --- /dev/null +++ b/site/content/en/docs/Reference/Networking/proxy.md @@ -0,0 +1,109 @@ +--- +title: "HTTP Proxiies" +linkTitle: "HTTP Proxies" +weight: 6 +date: 2017-01-05 +description: > + How to use an HTTP/HTTPS proxy with minikube +--- + +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: + +* `HTTP_PROXY` - The URL to your HTTP proxy +* `HTTPS_PROXY` - The URL to your HTTPS proxy +* `NO_PROXY` - A comma-separated list of hosts which should not go through the proxy. + +The NO_PROXY variable here is important: Without setting it, minikube may not be able to access resources within the VM. minikube uses two IP ranges, which should not go through the proxy: + +* **192.168.99.0/24**: Used by the minikube VM. Configurable for some hypervisors via `--host-only-cidr` +* **192.168.39.0/24**: Used by the minikube kvm2 driver. +* **10.96.0.0/12**: Used by service cluster IP's. Configurable via `--service-cluster-ip-range` + +One important note: If NO_PROXY is required by non-Kubernetes applications, such as Firefox or Chrome, you may want to specifically add the minikube IP to the comma-separated list, as they may not understand IP ranges ([#3827](https://github.com/kubernetes/minikube/issues/3827)). + +## Example Usage + +### 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.0/24,192.168.39.0/24 + +minikube start +``` + +To make the exported variables permanent, consider adding the declarations to ~/.bashrc or wherever your user-set environment variables are stored. + +### 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,192.168.39.0/24 + +minikube start +``` + +To set these environment variables permanently, consider adding these to your [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe) + +## Configuring Docker to use a proxy + +As of v1.0, minikube automatically configures the Docker instance inside of the VM to use the proxy environment variables, unless you have specified a `--docker-env` override. If you need to manually configure Docker for a set of proxies, use: + +```shell +minikube start \ + --docker-env=HTTP_PROXY=$HTTP_PROXY \ + --docker-env HTTPS_PROXY=$HTTPS_PROXY \ + --docker-env NO_PROXY=$NO_PROXY +``` + +## Troubleshooting + +### 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: + +* Temporary download error: Get https://storage.googleapis.com/minikube/iso/minikube.iso: +proxyconnect tcp: dial tcp :: connect: connection refused +``` + +This error indicates that the host:port combination defined by HTTPS_PROXY or HTTP_PROXY is incorrect, or that the proxy is unavailable. + +## Unable to pull images..Client.Timeout exceeded while awaiting headers + +```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 +(Client.Timeout exceeded while awaiting headers) +``` + +This error indicates that the container runtime running within the VM does not have access to the internet. Verify that you are passing the appropriate value to `--docker-env HTTPS_PROXY`. + +## 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 +``` + +This is because minikube VM is stuck behind a proxy that rewrites HTTPS responses to contain its own TLS certificate. The [solution](https://github.com/kubernetes/minikube/issues/3613#issuecomment-461034222) is to install the proxy certificate into a location that is copied to the VM at startup, so that it can be validated. + +Ask your IT department for the appropriate PEM file, and add it to: + +`~/.minikube/files/etc/ssl/certs` + +Then run `minikube delete` and `minikube start`. + +## downloading binaries: proxyconnect tcp: tls: oversized record received with length 20527 + +The supplied value of `HTTPS_PROXY` is probably incorrect. Verify that this value is not pointing to an HTTP proxy rather than an HTTPS proxy. + +## Additional Information + +* [Configure Docker to use a proxy server](https://docs.docker.com/network/proxy/) diff --git a/site/content/en/docs/Reference/Networking/vpn.md b/site/content/en/docs/Reference/Networking/vpn.md new file mode 100644 index 0000000000..94392a3980 --- /dev/null +++ b/site/content/en/docs/Reference/Networking/vpn.md @@ -0,0 +1,23 @@ +--- +title: "Host VPN" +linkTitle: "Host VPN" +weight: 6 +date: 2019-08-01 +description: > + Using minikube on a host with a VPN installed +--- + +minikube requires access from the host to the following IP ranges: + +* **192.168.99.0/24**: Used by the minikube VM. Configurable for some hypervisors via `--host-only-cidr` +* **192.168.39.0/24**: Used by the minikube kvm2 driver. +* **10.96.0.0/12**: Used by service cluster IP's. Configurable via `--service-cluster-ip-range` + +Unfortunately, many VPN configurations route packets to these destinations through an encrypted tunnel, rather than allowing the packets to go to the minikube VM. + +### Possible workarounds + +1. If you have access, whitelist the above IP ranges in your VPN software +2. In your VPN software, select an option similar to "Allow local (LAN) access when using VPN" [(Cisco VPN example)](https://superuser.com/questions/987150/virtualbox-guest-os-through-vpn) +3. You may have luck selecting alternate values to the `--host-only-cidr` and `--service-cluster-ip-range` flags. +4. Turn off the VPN diff --git a/site/content/en/docs/Reference/_index.md b/site/content/en/docs/Reference/_index.md index e8d2e3f801..bfe11dd2b6 100644 --- a/site/content/en/docs/Reference/_index.md +++ b/site/content/en/docs/Reference/_index.md @@ -1,13 +1,8 @@ --- title: "Reference" linkTitle: "Reference" -weight: 9 +weight: 5 description: > Low level reference docs --- -{{% pageinfo %}} -This is a placeholder page that shows you how to use this template site. -{{% /pageinfo %}} - -If your project has an API, configuration, or other reference - anything that users need to look up that’s at an even lower level than a single task - put (or link to it) here. diff --git a/site/content/en/docs/Reference/disk_cache.md b/site/content/en/docs/Reference/disk_cache.md new file mode 100644 index 0000000000..84d43112ef --- /dev/null +++ b/site/content/en/docs/Reference/disk_cache.md @@ -0,0 +1,48 @@ +--- +title: "Disk cache" +linkTitle: "Disk cache" +weight: 6 +date: 2019-08-01 +description: > + Cache Rules Everything Around Minikube +--- + +minikube has built-in support for caching downloaded resources into `$MINIKUBE_HOME/cache`. Here are the important file locations: + +* `~/.minikube/cache` - Top-level folder +* `~/.minikube/cache/iso` - VM ISO image. Typically updated once per major minikube release. +* `~/.minikube/cache/images` - Docker images used by Kubernetes. +* `~/.minikube/cache/` - Kubernetes binaries, such as `kubeadm` and `kubelet` + +## Kubernetes image cache + +`minikube start` caches all required Kubernetes images by default. This default may be changed by setting `--cache-images=false`. These images are not displayed by the `minikube cache` command. + +## Arbitrary docker image cache + +See [Tasks: Caching images]({{< ref "/docs/tasks/caching.md" >}}) + +## Sharing the minikube cache + +For offline use on other hosts, one can copy the contents of `~/.minikube/cache`. As of the v1.0 release, this directory contains 685MB of data: + +```text +cache/iso/minikube-v1.0.0.iso +cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1 +cache/images/k8s.gcr.io/k8s-dns-sidecar-amd64_1.14.13 +cache/images/k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64_1.14.13 +cache/images/k8s.gcr.io/kubernetes-dashboard-amd64_v1.10.1 +cache/images/k8s.gcr.io/kube-scheduler_v1.14.0 +cache/images/k8s.gcr.io/coredns_1.3.1 +cache/images/k8s.gcr.io/kube-controller-manager_v1.14.0 +cache/images/k8s.gcr.io/kube-apiserver_v1.14.0 +cache/images/k8s.gcr.io/pause_3.1 +cache/images/k8s.gcr.io/etcd_3.3.10 +cache/images/k8s.gcr.io/kube-addon-manager_v9.0 +cache/images/k8s.gcr.io/k8s-dns-kube-dns-amd64_1.14.13 +cache/images/k8s.gcr.io/kube-proxy_v1.14.0 +cache/v1.14.0/kubeadm +cache/v1.14.0/kubelet +``` + +If any of these files exist, minikube will use copy them into the VM directly rather than pulling them from the internet. diff --git a/site/content/en/docs/Reference/environment_variables.md b/site/content/en/docs/Reference/environment_variables.md new file mode 100644 index 0000000000..2b6596d21f --- /dev/null +++ b/site/content/en/docs/Reference/environment_variables.md @@ -0,0 +1,44 @@ +--- +title: "Environment Variables" +linkTitle: "Environment Variables" +weight: 6 +date: 2019-08-01 +--- + +## 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_`. + +For example the `minikube start --iso-url="$ISO_URL"` flag can also be set by setting the `MINIKUBE_ISO_URL="$ISO_URL"` environment variable. + +## Other variables + +Some features can only be accessed by environment variables, here is a list of these features: + +* **MINIKUBE_HOME** - (string) sets the path for the .minikube directory that minikube uses for state/configuration + +* **MINIKUBE_IN_STYLE** - (bool) manually sets whether or not emoji and colors should appear in minikube. Set to false or 0 to disable this feature, true or 1 to force it to be turned on. + +* **MINIKUBE_WANTUPDATENOTIFICATION** - (bool) sets whether the user wants an update notification for new minikube versions + +* **MINIKUBE_REMINDERWAITPERIODINHOURS** - (int) sets the number of hours to check for an update notification + +* **CHANGE_MINIKUBE_NONE_USER** - (bool) automatically change ownership of ~/.minikube to the value of $SUDO_USER + +* **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube + + +## Example: Disabling emoji + +```shell +export MINIKUBE_IN_STYLE=false +minikube start +``` + +## Making values persistent + +To make the exported variables persistent across reboots: + +* Linux and macOS: Add these declarations to `~/.bashrc` or wherever your shells environment variables are stored. +* Windows: Add these declarations via [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe) + diff --git a/site/content/en/docs/Reference/persistent_volumes.md b/site/content/en/docs/Reference/persistent_volumes.md new file mode 100644 index 0000000000..fd7a82b456 --- /dev/null +++ b/site/content/en/docs/Reference/persistent_volumes.md @@ -0,0 +1,46 @@ +--- +title: "Persistent Volumes" +linkTitle: "Persistent Volumes" +weight: 6 +date: 2019-08-01 +description: > + About persistent volumes (hostPath) +--- + +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 + +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. + +* `/data` +* `/var/lib/minikube` +* `/var/lib/docker` +* `/tmp/hostpath_pv` +* `/tmp/hostpath-provisioner` + +Here is an example PersistentVolume config to persist data in the '/data' directory: + +```yaml +apiVersion: v1 +kind: PersistentVolume +metadata: + name: pv0001 +spec: + accessModes: + - ReadWriteOnce + capacity: + storage: 5Gi + hostPath: + path: /data/pv0001/ +``` + +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 dynamic storage controller that runs alongside its deployment. This manages provisioning of *hostPath* volumes (rather then via the previous, in-tree hostPath provider). + +The default [Storage Provisioner Controller](https://github.com/kubernetes/minikube/blob/master/pkg/storage/storage_provisioner.go) is managed internally, in the minikube codebase, demonstrating how easy it is to plug a custom storage controller into kubernetes as a storage component of the system, and provides pods with dynamically, to test your pod's behaviour when persistent storage is mapped to it. + +Note that this is not a CSI based storage provider, rather, it simply declares a PersistentVolume object of type hostpath dynamically when the controller see's that there is an outstanding storage request. diff --git a/site/content/en/docs/Reference/runtimes.md b/site/content/en/docs/Reference/runtimes.md new file mode 100644 index 0000000000..5973040ff7 --- /dev/null +++ b/site/content/en/docs/Reference/runtimes.md @@ -0,0 +1,47 @@ +--- +title: "Container Runtimes" +linkTitle: "Container Runtimes" +weight: 6 +date: 2019-08-01 +description: > + Available container runtimes +--- + +### Docker + +The default container runtime in minikube is Docker. You can select it explicitly by using: + +```shell +minikube start --container-runtime=docker +``` + +### CRI-O + +To use [CRI-O](https://github.com/kubernetes-sigs/cri-o): + +```shell +minikube start --container-runtime=cri-o +``` + +## containerd + +To use [containerd](https://github.com/containerd/containerd): + +```shell +minikube start --container-runtime=containerd +``` + +## gvisor + +To use [gvisor](https://gvisor.dev): + +```shell +minikube start --container-runtime=containerd +minikube addons enable gvisor +``` + +## Kata + +Native support for [Kata containers](https://katacontainers.io) is a work-in-progress. See [#4347](https://github.com/kubernetes/minikube/issues/4347) for details. + +In the mean time, it's possible to make Kata containers work within minikube using a bit of [elbow grease](https://gist.github.com/olberger/0413cfb0769dcdc34c83788ced583fa9). diff --git a/site/content/en/docs/Getting started/_index.md b/site/content/en/docs/Start/_index.md similarity index 100% rename from site/content/en/docs/Getting started/_index.md rename to site/content/en/docs/Start/_index.md diff --git a/site/content/en/docs/Getting started/_post_install.md b/site/content/en/docs/Start/includes/post_install.inc similarity index 100% rename from site/content/en/docs/Getting started/_post_install.md rename to site/content/en/docs/Start/includes/post_install.inc diff --git a/site/content/en/docs/Getting started/linux.md b/site/content/en/docs/Start/linux.md similarity index 52% rename from site/content/en/docs/Getting started/linux.md rename to site/content/en/docs/Start/linux.md index a4b421aea4..f932e8a1bb 100644 --- a/site/content/en/docs/Getting started/linux.md +++ b/site/content/en/docs/Start/linux.md @@ -55,61 +55,16 @@ If the above command outputs "no": {{% tabs %}} {{% tab "VirtualBox" %}} -{{% readfile file="/docs/Getting started/_virtualbox.md" %}} +{{% readfile file="/docs/Reference/Drivers/includes/virtualbox_usage.inc" %}} {{% /tab %}} {{% tab "KVM" %}} - -The KVM driver requires libvirt and qemu-kvm to be installed: - -- Debian or Ubuntu 18.x: `sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm` -- Ubuntu 16.x or older: `sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm` -- Fedora/CentOS/RHEL: `sudo yum install libvirt libvirt-daemon-kvm qemu-kvm` -- openSUSE/SLES: `sudo zypper install libvirt qemu-kvm` - -Additionally, The KVM driver requires an additional binary to be installed: - -```shell - curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \ - && sudo install docker-machine-driver-kvm2 /usr/local/bin/ -``` - -### Validate libvirt - -Before trying minikube, assert that libvirt is in a healthy state: - -```shell -virt-host-validate -``` - -If you see any errors, stop now and consult your distributions documentation on configuring libvirt. - -### Using the kvm2 driver - -```shell -minikube start --vm-driver=kvm2 -``` -To make kvm2 the default for future invocations, run: - -```shell -minikube config set vm-driver kvm2 -``` - +{{% readfile file="/docs/Reference/Drivers/includes/kvm2_usage.inc" %}} {{% /tab %}} {{% tab "None (bare-metal)" %}} +If you are already running minikube from inside a VM, it is possible to skip the creation of an additional VM layer by using the `none` driver. -If you are already running minikube from inside a VM, it is possible to skip the creation of an additional VM layer by using the `none` driver. -This mode does come with additional requirements: - -- docker -- systemd -- sudo access - -```shell -sudo minikube start --vm-driver=none -``` - -Please see the [docs/reference/drivers/none](none driver) documentation for more information. +{{% readfile file="/docs/Reference/Drivers/includes/none_usage.inc" %}} {{% /tab %}} {{% /tabs %}} -{{% readfile file="/docs/Getting started/_post_install.md" %}} +{{% readfile file="/docs/Start/includes/post_install.inc" %}} diff --git a/site/content/en/docs/Start/macos.md b/site/content/en/docs/Start/macos.md new file mode 100644 index 0000000000..669bef6298 --- /dev/null +++ b/site/content/en/docs/Start/macos.md @@ -0,0 +1,53 @@ +--- +title: "macOS" +linkTitle: "macOS" +weight: 2 +--- + +### Prerequisites + +* macOS 10.12 (Sierra) +* A hypervisor such as Hyperkit, Parallels, VirtualBox, or VMware Fusion + +### Installation + +{{% tabs %}} +{{% tab "Brew" %}} + +If the [Brew Package Manager](https://brew.sh/) is installed, use it to download and install minikube: + +```shell +brew install minikube +``` + +{{% /tab %}} +{{% tab "Direct" %}} + +Download and install minikube to /usr/local/bin: + +```shell +curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \ + && sudo install minikube-darwin-amd64 /usr/local/bin/minikube +``` +{{% /tab %}} +{{% /tabs %}} + +## Hypervisor Setup + +{{% tabs %}} +{{% tab "VirtualBox" %}} +{{% readfile file="/docs/Reference/Drivers/includes/virtualbox_usage.inc" %}} +{{% /tab %}} +{{% tab "Hyperkit" %}} +{{% readfile file="/docs/Reference/Drivers/includes/hyperkit_usage.inc" %}} +{{% /tab %}} +{{% tab "Parallels" %}} +{{% readfile file="/docs/Reference/Drivers/includes/parallels_usage.inc" %}} +{{% /tab %}} +{{% tab "VMware" %}} +{{% readfile file="/docs/Reference/Drivers/includes/vmware_macos_usage.inc" %}} +{{% /tab %}} + +{{% /tabs %}} + +{{% readfile file="/docs/Start/includes/post_install.inc" %}} diff --git a/site/content/en/docs/Getting started/windows.md b/site/content/en/docs/Start/windows.md similarity index 52% rename from site/content/en/docs/Getting started/windows.md rename to site/content/en/docs/Start/windows.md index e01a6662e5..21bb84a77a 100644 --- a/site/content/en/docs/Getting started/windows.md +++ b/site/content/en/docs/Start/windows.md @@ -6,21 +6,21 @@ weight: 3 ### Prerequisites - * Windows 8 or above - * A hypervisor, such as Hyper-V or VirtualBox - * Hardware virtualization support must be enabled in BIOS - * 4GB of RAM +* Windows 8 or above +* A hypervisor, such as Hyper-V or VirtualBox +* Hardware virtualization support must be enabled in BIOS +* 4GB of RAM ### Installation {{% tabs %}} {{% tab "Direct" %}} -Download and run the [installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe) +Download and run the [minikube installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe) {{% /tab %}} {{% tab "Chocolatey" %}} -If you have the [Chocolatey Package Manager](https://chocolatey.org/) installed, you can install minikube if run as an Administrator: +If the [Chocolatey Package Manager](https://chocolatey.org/) is installed, use it to install minikube: ```shell choco install minikube @@ -30,7 +30,6 @@ After it has installed, close the current CLI session and reopen it. minikube sh {{% /tab %}} {{% /tabs %}} - ## Hypervisor Setup To check if virtualization is supported, run the following command on your Windows terminal or command prompt. @@ -49,32 +48,17 @@ Hyper-V Requirements: VM Monitor Mode Extensions: Yes If you see the following output, your system already has a Hypervisor installed and you can skip the next step. -``` +```shell Hyper-V Requirements: A hypervisor has been detected. - Features required for Hyper-V will not be displayed. ``` {{% tabs %}} {{% tab "VirtualBox" %}} -{{% readfile file="/docs/Getting started/_virtualbox.md" %}} +{{% readfile file="/docs/Reference/Drivers/includes/virtualbox_usage.inc" %}} {{% /tab %}} {{% tab "Hyper-V" %}} - -If Hyper-V is active, you can start minikube with Hyper-V support using: - -```shell -minikube start --vm-driver=hyperv -``` - -NOTE: If this fails due to networking issues, see the [Hyper-V driver documentation](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyper-v-driver) for further instructions. - -To make hyperv the default for future invocations: - -```shell -minikube config set vm-driver hyperv -``` - +{{% readfile file="/docs/Reference/Drivers/includes/hyperv_usage.inc" %}} {{% /tab %}} {{% /tabs %}} -{{% readfile file="/docs/Getting started/_post_install.md" %}} \ No newline at end of file +{{% readfile file="/docs/Start/includes/post_install.inc" %}} diff --git a/site/content/en/docs/Tasks/Registry/_index.md b/site/content/en/docs/Tasks/Registry/_index.md new file mode 100644 index 0000000000..cdecd6eff2 --- /dev/null +++ b/site/content/en/docs/Tasks/Registry/_index.md @@ -0,0 +1,8 @@ +--- +title: "Working with Registries" +linkTitle: "Working with Registries" +weight: 6 +date: 2017-01-05 +description: > + How to interact with Docker registries. +--- \ No newline at end of file diff --git a/site/content/en/docs/Tasks/Registry/insecure.md b/site/content/en/docs/Tasks/Registry/insecure.md new file mode 100644 index 0000000000..aceba59e66 --- /dev/null +++ b/site/content/en/docs/Tasks/Registry/insecure.md @@ -0,0 +1,17 @@ +--- +title: "Insecure" +linkTitle: "Insecure" +weight: 6 +date: 2019-08-1 +description: > + How to enable insecure registry support within minikube +--- + +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. + +One nifty hack is to allow the kubelet running in minikube to talk to registries deployed inside a pod in the cluster without backing them +with TLS certificates. Because the default service cluster IP is known to be available at 10.0.0.1, users can pull images from registries +deployed inside the cluster by creating the cluster with `minikube start --insecure-registry "10.0.0.0/24"`. diff --git a/site/content/en/docs/Tasks/Registry/private.md b/site/content/en/docs/Tasks/Registry/private.md new file mode 100644 index 0000000000..b2a835e7e8 --- /dev/null +++ b/site/content/en/docs/Tasks/Registry/private.md @@ -0,0 +1,28 @@ +--- +title: "Private" +linkTitle: "Private" +weight: 6 +date: 2019-08-01 +description: > + How to use a private registry within minikube +--- + + +**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 + +Do you want to enable Google Container Registry? [y/n]: y +-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):/home/user/.config/gcloud/application_default_credentials.json + +Do you want to enable Docker Registry? [y/n]: n +registry-creds was successfully configured +$ minikube addons enable registry-creds +``` + +For additional information on private container registries, see [this page](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). + +We recommend you use _ImagePullSecrets_, but if you would like to configure access on the minikube VM you can place the `.dockercfg` in the `/home/docker` directory or the `config.json` in the `/var/lib/kubelet` directory. Make sure to restart your kubelet (for kubeadm) process with `sudo systemctl restart kubelet`. + diff --git a/site/content/en/docs/Tasks/_index.md b/site/content/en/docs/Tasks/_index.md index 3d0254cb19..b5a2e67ad4 100755 --- a/site/content/en/docs/Tasks/_index.md +++ b/site/content/en/docs/Tasks/_index.md @@ -1,20 +1,12 @@ --- title: "Core Tasks" linkTitle: "Core Tasks" -weight: 6 +weight: 4 date: 2017-01-05 description: > What can you do with minikube? --- -{{% pageinfo %}} -This is a placeholder page that shows you how to use this template site. -{{% /pageinfo %}} - -Think about your project’s features and use cases. Use these to choose your core tasks. Each granular use case (enable x, configure y) should have a corresponding tasks page or tasks page section. Users should be able to quickly refer to your core tasks when they need to find out how to do one specific thing, rather than having to look for the instructions in a bigger tutorial or example. Think of your tasks pages as a cookbook with different procedures your users can combine to create something more substantial. - -You can give each task a page, or you can group related tasks together in a page, such as tasks related to a particular feature. As well as grouping related tasks in single pages, you can also group task pages in nested folders with an index page as an overview, as seen in this example site. Or if you have a small docset like the [Docsy User Guide](https://docsy.dev/docs/) with no Tutorials or Concepts pages, consider adding your feature-specific pages at the top level of your docs rather than in a Tasks section. - Each task should give the user * The prerequisites for this task, if any (this can be specified at the top of a multi-task page if they're the same for all the page's tasks. "All these tasks assume that you understand....and that you have already...."). diff --git a/site/content/en/docs/Reference/Networking/accessing-host-resources.md b/site/content/en/docs/Tasks/accessing-host-resources.md similarity index 100% rename from site/content/en/docs/Reference/Networking/accessing-host-resources.md rename to site/content/en/docs/Tasks/accessing-host-resources.md diff --git a/site/content/en/docs/Tasks/building.md b/site/content/en/docs/Tasks/building.md new file mode 100644 index 0000000000..1da1b95408 --- /dev/null +++ b/site/content/en/docs/Tasks/building.md @@ -0,0 +1,37 @@ +--- +title: "Building images within minikube" +date: 2019-08-05 +weight: 1 +description: > + Building images within minikube +--- + +When using a single VM of Kubernetes it's really handy to build 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 machine as minikube which speeds up local experiments. + +## Docker (containerd) + +For Docker, you can either set up your host docker client to communicate by [reusing the docker daemon]({{< ref "/docs/tasks/docker_daemon.md" >}}). + +Or you can use `minikube ssh` to connect to the virtual machine, and run the `docker build` there: + +```shell +docker build +``` + +For more information on the `docker build` command, read the [Docker documentation](https://docs.docker.com/engine/reference/commandline/build/) (docker.com). + +## Podman (cri-o) + +For Podman, there is no daemon running. The processes are started by the user, monitored by `conmon`. + +So you need to use `minikube ssh`, and you will also make sure to run the command as the root user: + +```shell +sudo -E podman build +``` + +For more information on the `podman build` command, read the [Podman documentation](https://github.com/containers/libpod/blob/master/docs/podman-build.1.md) (podman.io). + +## Build context + +For the build context you can use any directory on the virtual machine, or any address on the network. diff --git a/site/content/en/docs/Tasks/caching.md b/site/content/en/docs/Tasks/caching.md new file mode 100644 index 0000000000..51b9d6d67b --- /dev/null +++ b/site/content/en/docs/Tasks/caching.md @@ -0,0 +1,42 @@ +--- +title: "Caching images" +date: 2019-08-05 +weight: 1 +description: > + How to cache arbitrary Docker images +--- + +## Overview + +For offline use and performance reasons, minikube caches required Docker images onto the local file system. Developers may find it useful to add their own images to this cache for local development. + +## Adding an image + +To add the ubuntu 16.04 image to minikube's image cache: + +```shell +minikube cache add ubuntu:16.04 +``` + +The add command will store the requested image to `$MINIKUBE_HOME/cache/images`, and load it into the VM's container runtime environment next time `minikube start` is called. + +## Listing images + +To display images you have added to the cache: + +```shell +minikube cache list +``` + +This listing will not include the images which are built-in to minikube. + +## Deleting an image + +```shell +minikube cache delete +``` + +### Additional Information + +* [Reference: Disk Cache]({{< ref "/docs/reference/disk_cache.md" >}}) +* [Reference: cache command]({{< ref "/docs/reference/commands/cache.md" >}}) \ No newline at end of file diff --git a/site/content/en/docs/Tasks/dashboard.md b/site/content/en/docs/Tasks/dashboard.md new file mode 100644 index 0000000000..3fec853830 --- /dev/null +++ b/site/content/en/docs/Tasks/dashboard.md @@ -0,0 +1,49 @@ +--- +title: "Dashboard" +date: 2019-07-31 +weight: 1 +description: > + Using the Kubernetes Dashboard +--- + +minikube has integrated support for the [Kubernetes Dashboard UI](https://github.com/kubernetes/dashboard). + +## Overview + +The Dashboard is a web-based Kubernetes user interface. You can use it to: + + +- deploy containerized applications to a Kubernetes cluster +- troubleshoot your containerized application +- manage the cluster resources +- get an overview of applications running on your cluster +- creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc) + +For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard. + +## Basic usage + +To access the dashboard: + +```shell +minikube dashboard +``` + +This will enable the dashboard add-on, and open the proxy in the default web browser. + +It's worth noting that web browsers generally do not run properly as the root user, so if you are +in an environment where you are running as root, see the URL-only option. + +To stop the proxy (leaves the dashboard running), abort the started process (`Ctrl+C`). + +## Getting just the dashboard URL + +If you don't want to open a web browser, the dashboard command can also simply emit a URL: + +```shell +minikube dashboard --url +``` + +## Reference + +For additional information, see [the official Dashboard documentation](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/). diff --git a/site/content/en/docs/Tasks/debug.md b/site/content/en/docs/Tasks/debug.md new file mode 100644 index 0000000000..bab4de45c7 --- /dev/null +++ b/site/content/en/docs/Tasks/debug.md @@ -0,0 +1,68 @@ +--- +title: "Debugging" +linkTitle: "Debugging" +weight: 9 +date: 2019-08-01 +description: > + How to debug issues within minikube +--- + +## Enabling debug logs + +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 + +* `--v=3` will output *libmachine* logging +* `--v=7` will output *libmachine --debug* level logging + +Example: + +`minikube start --v=7` will start minikube and output all the important debug logs to stdout. + +## Gathering VM logs + +To debug issues where Kubernetes failed to deploy, it is very useful to collect the Kubernetes pod and kernel logs: + +```shell +minikube logs +``` + +## Viewing Pod Status + +To view the deployment state of all Kubernetes pods, use: + +```shell +kubectl get po -A +``` + +Example output: + +```shell +NAMESPACE NAME READY STATUS RESTARTS AGE +kube-system coredns-5c98db65d4-299md 1/1 Running 0 11m +kube-system coredns-5c98db65d4-qlpkd 1/1 Running 0 11m +kube-system etcd-minikube 1/1 Running 0 10m +kube-system gvisor 1/1 Running 0 11m +... +kube-system storage-provisioner 1/1 Running 0 11m +``` + +To view more detailed information about a pod, use: + +```shell +kubectl describe pod -n +``` + +## Debugging hung start-up + +minikube will wait ~8 minutes before giving up on a Kubernetes deployment. If you want to see startup fails more immediately, consider using: + +```shell +minikube logs --problems +``` + +This will attempt to surface known errors, such as invalid configuration flags. If nothing interesting shows up, try `minikube logs`. + diff --git a/site/content/en/docs/Tasks/docker_daemon.md b/site/content/en/docs/Tasks/docker_daemon.md new file mode 100644 index 0000000000..d8e00e0d5b --- /dev/null +++ b/site/content/en/docs/Tasks/docker_daemon.md @@ -0,0 +1,56 @@ +--- +title: "Using the Docker daemon" +linkTitle: "Using the Docker daemon" +weight: 6 +date: 2018-08-02 +description: > + How to access the Docker daemon within minikube +--- + +## Prerequisites + +You must be using minikube with the container runtime set to Docker. This is the default setting. + +## Method 1: Without minikube registry addon + +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. + +To be able to work with the docker daemon on your mac/linux host use the docker-env command in your shell: + +```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 +``` + +Docker may report following forbidden error if you are using http proxy and the `$(minikube ip)` is not added to `no_proxy`/`NO_PROXY`: + +```shell +error during connect: Get https://192.168.39.98:2376/v1.39/containers/json: Forbidden +``` + +On Centos 7, docker may report the following error: + +```shell +Could not read CA certificate "/etc/docker/ca.pem": open /etc/docker/ca.pem: no such file or directory +``` + +The fix is to update /etc/sysconfig/docker to ensure that minikube's environment changes are respected: + +```diff +< DOCKER_CERT_PATH=/etc/docker +--- +> if [ -z "${DOCKER_CERT_PATH}" ]; then +> DOCKER_CERT_PATH=/etc/docker +> fi +``` + +Remember to turn off the _imagePullPolicy:Always_, as otherwise Kubernetes won't use images you built locally. + +## Related Documentation + +- [docker_registry.md](Using the Docker registry) \ No newline at end of file diff --git a/site/content/en/docs/Tasks/docker_registry.md b/site/content/en/docs/Tasks/docker_registry.md new file mode 100644 index 0000000000..64afca1c00 --- /dev/null +++ b/site/content/en/docs/Tasks/docker_registry.md @@ -0,0 +1,48 @@ +--- +title: "Using the Docker registry" +linkTitle: "Using the Docker registry" +weight: 6 +date: 2018-08-02 +description: > + How to access the Docker registry within minikube +--- + +As an alternative to [reusing the Docker daemon]({{< ref "/docs/tasks/docker_daemon.md" >}}), you may enable the registry addon to push images directly into registry. + +Steps are as follows: + +For illustration purpose, we will assume that minikube VM has one of the ip from `192.168.39.0/24` subnet. If you have not overridden these subnets as per [networking guide](https://minikube.sigs.k8s.io/docs/reference/networking/), you can find out default subnet being used by minikube for a specific OS and driver combination [here](https://github.com/kubernetes/minikube/blob/dfd9b6b83d0ca2eeab55588a16032688bc26c348/pkg/minikube/cluster/cluster.go#L408) which is subject to change. Replace `192.168.39.0/24` with appropriate values for your environment wherever applicable. + +Ensure that docker is configured to use `192.168.39.0/24` as insecure registry. Refer [here](https://docs.docker.com/registry/insecure/) for instructions. + +Ensure that `192.168.39.0/24` is enabled as insecure registry in minikube. Refer [here](https://minikube.sigs.k8s.io/docs/tasks/registry/insecure/) for instructions.. + +Enable minikube registry addon: + +```shell +minikube addons enable registry +``` + +Build docker image and tag it appropriately: + +```shell +docker build --tag $(minikube ip):5000/test-img . +``` + +Push docker image to minikube registry: + +```shell +docker push $(minikube ip):5000/test-img +``` + +Now run it in minikube: + +```shell +kubectl run test-img --image=$(minikube ip):5000/test-img +``` + +Or if `192.168.39.0/24` is not enabled as insecure registry in minikube, then: + +```shell +kubectl run test-img --image=localhost:5000/test-img +``` diff --git a/site/content/en/docs/Tasks/loadbalancer.md b/site/content/en/docs/Tasks/loadbalancer.md new file mode 100644 index 0000000000..2c18063860 --- /dev/null +++ b/site/content/en/docs/Tasks/loadbalancer.md @@ -0,0 +1,58 @@ +--- +title: "LoadBalancer access" +linkTitle: "LoadBalancer access" +weight: 6 +date: 2018-08-02 +description: > + How to access a LoadBalancer service in minikube +--- + +## Overview + +A LoadBalancer service is the standard way to expose a service to the internet. With this method, each service gets it's own IP address. + + +## Using `minikube tunnel` + +Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command. It will run until Ctrl-C is hit. + +````shell +minikube tunnel +```` +Example output: + +```text +out/minikube tunnel +Password: ***** +Status: + machine: minikube + pid: 59088 + route: 10.96.0.0/12 -> 192.168.99.101 + minikube: Running + services: [] + errors: + minikube: no errors + router: no errors + loadbalancer emulator: no errors +``` + + +`minikube tunnel` runs as a separate daemon, creating a network route on the host to the service CIDR of the cluster using the cluster's IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system. + +### DNS resolution (experimental) + +If you are on macOS, the tunnel command also allows DNS resolution for Kubernetes services from the host. + +### Cleaning up orphaned routes + +If the `minikube tunnel` shuts down in an abrupt manner, it may leave orphaned network routes on your system. If this happens, the ~/.minikube/tunnels.json file will contain an entry for that tunnel. To remove orphaned routes, run: + +````shell +minikube tunnel --cleanup +```` + +### Avoiding password prompts + +Adding a route requires root privileges for the user, and thus there are differences in how to run `minikube tunnel` depending on the OS. If you want to avoid entering the root password, consider setting NOPASSWD for "ip" and "route" commands: + + diff --git a/site/content/en/docs/Tasks/nodeport.md b/site/content/en/docs/Tasks/nodeport.md new file mode 100644 index 0000000000..5e73db4cad --- /dev/null +++ b/site/content/en/docs/Tasks/nodeport.md @@ -0,0 +1,33 @@ +--- +title: "NodePort access" +linkTitle: "NodePort access" +weight: 6 +date: 2018-08-02 +description: > + How to access a NodePort service in minikube +--- + +A NodePort service is the most basic way to get external traffic directly to your service. NodePort, as the name implies, opens a specific port, and any traffic that is sent to this port is forwarded to the service. + +### Getting the NodePort using the service command + +We also have a shortcut for fetching the minikube IP and a service's `NodePort`: + +`minikube service --url $SERVICE` + +## Getting the NodePort using kubectl + +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. + +To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output): + +`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'` + +### Increasing the NodePort range + +By default, minikube only exposes ports 30000-32767. If this does not work for you, you can adjust the range by using: + +`minikube start --extra-config=apiserver.service-node-port-range=1-65535` + +This flag also accepts a comma separated list of ports and port ranges. + diff --git a/site/content/en/docs/Tasks/sync.md b/site/content/en/docs/Tasks/sync.md new file mode 100644 index 0000000000..fc66a5822a --- /dev/null +++ b/site/content/en/docs/Tasks/sync.md @@ -0,0 +1,38 @@ +--- +title: "File Sync" +linkTitle: "File Sync" +weight: 6 +date: 2019-08-01 +description: > + How to sync files into minikube +--- + +## Built-in sync + +minikube has a built-in file sync mechanism, but it only syncs when `minikube start` is run, though before Kubernetes is started. Examples where this may be useful are custom versions of system or Kubernetes configuration files, such as: + +- DNS configuration +- SSL certificates +- Kubernetes service metadata + +### Adding files + +Place files to be synced in `$MINIKUBE_HOME/files` + +For example, running the following will result in the deployment of a custom /etc/resolv.conf: + +``` +mkdir -p ~/.minikube/files/etc +echo nameserver 8.8.8.8 > ~/.minikube/files/etc/resolv.conf +minikube start +``` + +## Other approaches + +With a bit of work, one could setup [Syncthing](https://syncthing.net) between the host and the guest VM for persistent file synchronization. + +If you are looking for a solution tuned for iterative application development, consider using a Kubernetes tool that is known to work well with minikube: + +- [Draft](https://draft.sh): see specific [minikube instructions](https://github.com/Azure/draft/blob/master/docs/install-minikube.md) +- [Okteto](https://github.com/okteto/okteto) +- [Skaffold](http://github.com/ContainerTools/skaffold) diff --git a/site/content/en/docs/Tutorials/_index.md b/site/content/en/docs/Tutorials/_index.md index b58fb2a184..60e07fef45 100755 --- a/site/content/en/docs/Tutorials/_index.md +++ b/site/content/en/docs/Tutorials/_index.md @@ -1,8 +1,7 @@ - --- title: "Tutorials" linkTitle: "Tutorials" -weight: 8 +weight: 4 date: 2017-01-04 description: > Contributed end-to-end tutorials using minikube diff --git a/site/content/en/docs/Tutorials/continuous_integration.md b/site/content/en/docs/Tutorials/continuous_integration.md new file mode 100644 index 0000000000..eaf357a964 --- /dev/null +++ b/site/content/en/docs/Tutorials/continuous_integration.md @@ -0,0 +1,43 @@ +--- +title: "Continuous Integration" +linkTitle: "Continuous Integration" +weight: 1 +date: 2018-01-02 +description: > + Using minikube for Continuous Integration +--- + +## Overview + +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. + +## Prerequisites + +- VM running a systemd based Linux distribution + +## Tutorial + + 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/ + +kv=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) +curl -Lo kubectl \ + https://storage.googleapis.com/kubernetes-release/release/$kv/bin/linux/amd64/kubectl \ + && sudo install kubectl /usr/local/bin/ + +export MINIKUBE_WANTUPDATENOTIFICATION=false +export MINIKUBE_WANTREPORTERRORPROMPT=false +export MINIKUBE_HOME=$HOME +export CHANGE_MINIKUBE_NONE_USER=true +export KUBECONFIG=$HOME/.kube/config + +mkdir -p $HOME/.kube $HOME/.minikube +touch $KUBECONFIG + +sudo -E minikube start --vm-driver=none +``` + diff --git a/site/content/en/docs/Tutorials/multi-bear.md b/site/content/en/docs/Tutorials/multi-bear.md deleted file mode 100644 index 2b6a33483c..0000000000 --- a/site/content/en/docs/Tutorials/multi-bear.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -title: "Multi-Bear Domicile Setup" -date: 2017-01-05 -weight: 4 -description: > - A short lead descripton about this content page. It can be **bold** or _italic_ and can be split over multiple paragraphs. ---- - -{{% pageinfo %}} -This is a placeholder page. Replace it with your own content. -{{% /pageinfo %}} - -Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://gohugo.io) should be blue with no underlines (unless hovered over). - -There should be whitespace between paragraphs. Vape migas chillwave sriracha poutine try-hard distillery. Tattooed shabby chic small batch, pabst art party heirloom letterpress air plant pop-up. Sustainable chia skateboard art party banjo cardigan normcore affogato vexillologist quinoa meggings man bun master cleanse shoreditch readymade. Yuccie prism four dollar toast tbh cardigan iPhone, tumblr listicle live-edge VHS. Pug lyft normcore hot chicken biodiesel, actually keffiyeh thundercats photo booth pour-over twee fam food truck microdosing banh mi. Vice activated charcoal raclette unicorn live-edge post-ironic. Heirloom vexillologist coloring book, beard deep v letterpress echo park humblebrag tilde. - -90's four loko seitan photo booth gochujang freegan tumeric listicle fam ugh humblebrag. Bespoke leggings gastropub, biodiesel brunch pug fashion axe meh swag art party neutra deep v chia. Enamel pin fanny pack knausgaard tofu, artisan cronut hammock meditation occupy master cleanse chartreuse lumbersexual. Kombucha kogi viral truffaut synth distillery single-origin coffee ugh slow-carb marfa selfies. Pitchfork schlitz semiotics fanny pack, ugh artisan vegan vaporware hexagon. Polaroid fixie post-ironic venmo wolf ramps **kale chips**. - -> There should be no margin above this first sentence. -> -> Blockquotes should be a lighter gray with a border along the left side in the secondary color. -> -> There should be no margin below this final sentence. - -## First Header 2 - -This is a normal paragraph following a header. Knausgaard kale chips snackwave microdosing cronut copper mug swag synth bitters letterpress glossier **craft beer**. Mumblecore bushwick authentic gochujang vegan chambray meditation jean shorts irony. Viral farm-to-table kale chips, pork belly palo santo distillery activated charcoal aesthetic jianbing air plant woke lomo VHS organic. Tattooed locavore succulents heirloom, small batch sriracha echo park DIY af. Shaman you probably haven't heard of them copper mug, crucifix green juice vape *single-origin coffee* brunch actually. Mustache etsy vexillologist raclette authentic fam. Tousled beard humblebrag asymmetrical. I love turkey, I love my job, I love my friends, I love Chardonnay! - -Deae legum paulatimque terra, non vos mutata tacet: dic. Vocant docuique me plumas fila quin afuerunt copia haec o neque. - -On big screens, paragraphs and headings should not take up the full container width, but we want tables, code blocks and similar to take the full width. - -Scenester tumeric pickled, authentic crucifix post-ironic fam freegan VHS pork belly 8-bit yuccie PBR&B. **I love this life we live in**. - - -## Second Header 2 - -> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Header 3 - -``` -This is a code block following a header. -``` - -Next level leggings before they sold out, PBR&B church-key shaman echo park. Kale chips occupy godard whatever pop-up freegan pork belly selfies. Gastropub Belinda subway tile woke post-ironic seitan. Shabby chic man bun semiotics vape, chia messenger bag plaid cardigan. - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| What | Follows | -|-----------|-----------------| -| A table | A header | -| A table | A header | -| A table | A header | - ----------------- - -There's a horizontal rule above and below this. - ----------------- - -Here is an unordered list: - -* Liverpool F.C. -* Chelsea F.C. -* Manchester United F.C. - -And an ordered list: - -1. Michael Brecker -2. Seamus Blake -3. Branford Marsalis - -And an unordered task list: - -- [x] Create a Hugo theme -- [x] Add task lists to it -- [ ] Take a vacation - -And a "mixed" task list: - -- [ ] Pack bags -- ? -- [ ] Travel! - -And a nested list: - -* Jackson 5 - * Michael - * Tito - * Jackie - * Marlon - * Jermaine -* TMNT - * Leonardo - * Michelangelo - * Donatello - * Raphael - -Definition lists can be used with Markdown syntax. Definition headers are bold. - -Name -: Godzilla - -Born -: 1952 - -Birthplace -: Japan - -Color -: Green - - ----------------- - -Tables should have bold headings and alternating shaded rows. - -| Artist | Album | Year | -|-------------------|-----------------|------| -| Michael Jackson | Thriller | 1982 | -| Prince | Purple Rain | 1984 | -| Beastie Boys | License to Ill | 1986 | - -If a table is too wide, it should scroll horizontally. - -| Artist | Album | Year | Label | Awards | Songs | -|-------------------|-----------------|------|-------------|----------|-----------| -| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | -| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | -| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | - ----------------- - -Code snippets like `var foo = "bar";` can be shown inline. - -Also, `this should vertically align` ~~`with this`~~ ~~and this~~. - -Code can also be shown in a block element. - -``` -foo := "bar"; -bar := "foo"; -``` - -Code can also use syntax highlighting. - -```go -func main() { - input := `var foo = "bar";` - - lexer := lexers.Get("javascript") - iterator, _ := lexer.Tokenise(nil, input) - style := styles.Get("github") - formatter := html.New(html.WithLineNumbers()) - - var buff bytes.Buffer - formatter.Format(&buff, style, iterator) - - fmt.Println(buff.String()) -} -``` - -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -Inline code inside table cells should still be distinguishable. - -| Language | Code | -|-------------|--------------------| -| Javascript | `var foo = "bar";` | -| Ruby | `foo = "bar"{` | - ----------------- - -Small images should be shown at their actual size. - -![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/240px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg) - -Large images should always scale down and fit in the content container. - -![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/1024px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg) - -_The photo above of the Spruce Picea abies shoot with foliage buds: Bjørn Erik Pedersen, CC-BY-SA._ - - -## Components - -### Alerts - -{{< alert >}}This is an alert.{{< /alert >}} -{{< alert title="Note" >}}This is an alert with a title.{{< /alert >}} -{{% alert title="Note" %}}This is an alert with a title and **Markdown**.{{% /alert %}} -{{< alert color="success" >}}This is a successful alert.{{< /alert >}} -{{< alert color="warning" >}}This is a warning.{{< /alert >}} -{{< alert color="warning" title="Warning" >}}This is a warning with a title.{{< /alert >}} - - -## Another Heading - -Add some sections here to see how the ToC looks like. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### This Document - -Inguina genus: Anaphen post: lingua violente voce suae meus aetate diversi. Orbis unam nec flammaeque status deam Silenum erat et a ferrea. Excitus rigidum ait: vestro et Herculis convicia: nitidae deseruit coniuge Proteaque adiciam *eripitur*? Sitim noceat signa *probat quidem*. Sua longis *fugatis* quidem genae. - - -### Pixel Count - -Tilde photo booth wayfarers cliche lomo intelligentsia man braid kombucha vaporware farm-to-table mixtape portland. PBR&B pickled cornhole ugh try-hard ethical subway tile. Fixie paleo intelligentsia pabst. Ennui waistcoat vinyl gochujang. Poutine salvia authentic affogato, chambray lumbersexual shabby chic. - -### Contact Info - -Plaid hell of cred microdosing, succulents tilde pour-over. Offal shabby chic 3 wolf moon blue bottle raw denim normcore poutine pork belly. - - -### External Links - -Stumptown PBR&B keytar plaid street art, forage XOXO pitchfork selvage affogato green juice listicle pickled everyday carry hashtag. Organic sustainable letterpress sartorial scenester intelligentsia swag bushwick. Put a bird on it stumptown neutra locavore. IPhone typewriter messenger bag narwhal. Ennui cold-pressed seitan flannel keytar, single-origin coffee adaptogen occupy yuccie williamsburg chillwave shoreditch forage waistcoat. - - - -``` -This is the final element on the page and there should be no margin below this. -``` diff --git a/site/content/en/docs/Tutorials/nvidia_gpu.md b/site/content/en/docs/Tutorials/nvidia_gpu.md new file mode 100644 index 0000000000..64626c3ce9 --- /dev/null +++ b/site/content/en/docs/Tutorials/nvidia_gpu.md @@ -0,0 +1,132 @@ +--- +title: "NVIDIA GPU Support" +linkTitle: "NVIDIA GPU support" +weight: 1 +date: 2018-01-02 +description: > + Using NVIDIA GPU support within minikube +--- + +## Prerequisites + +- Linux +- kvm2 driver +- Latest NVIDIA GPU drivers + +## Using the KVM2 driver + +When using NVIDIA GPUs with the kvm2 vm-driver. We passthrough spare GPUs on the +host to the minikube VM. Doing so has a few prerequisites: + +- You must install the [kvm2 driver](drivers.md#kvm2-driver). If you already had + this installed make sure that you fetch the latest + `docker-machine-driver-kvm2` binary that has GPU support. + +- Your CPU must support IOMMU. Different vendors have different names for this + technology. Intel calls it Intel VT-d. AMD calls it AMD-Vi. Your motherboard + must also support IOMMU. + +- You must enable IOMMU in the kernel: add `intel_iommu=on` or `amd_iommu=on` + (depending to your CPU vendor) to the kernel command line. Also add `iommu=pt` + to the kernel command line. + +- You must have spare GPUs that are not used on the host and can be passthrough + to the VM. These GPUs must not be controlled by the nvidia/nouveau driver. You + can ensure this by either not loading the nvidia/nouveau driver on the host at + all or assigning the spare GPU devices to stub kernel modules like `vfio-pci` + or `pci-stub` at boot time. You can do that by adding the + [vendorId:deviceId](https://pci-ids.ucw.cz/read/PC/10de) of your spare GPU to + the kernel command line. For ex. for Quadro M4000 add `pci-stub.ids=10de:13f1` + to the kernel command line. Note that you will have to do this for all GPUs + you want to passthrough to the VM and all other devices that are in the IOMMU + group of these GPUs. + +- 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 + + +### 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 the 'none' driver + +NOTE: This approach used to expose GPUs here is different than the approach used +to expose GPUs with `--vm-driver=kvm2`. Please don't mix these instructions. + +- Install minikube. + +- Install the nvidia driver, nvidia-docker and configure docker with nvidia as + the default runtime. See instructions at + + +- 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 + supported GPUs listed are AMD’s. + +- 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 + host](http://www.virtualbox.org/manual/ch09.html#pcipassthrough). + +- Hyper-V supports DDA (discrete device assignment) but [only for Windows Server + 2016](https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/plan/plan-for-deploying-devices-using-discrete-device-assignment) + +Since the only possibility of supporting GPUs on minikube on Windows is on a +server OS where users don't usually run minikube, we haven't invested time in +trying to support NVIDIA GPUs on minikube on Windows. + +Also, nvidia-docker [doesn't support +Windows](https://github.com/NVIDIA/nvidia-docker/issues/197) either. diff --git a/site/content/en/docs/Tutorials/openid_connect_auth.md b/site/content/en/docs/Tutorials/openid_connect_auth.md new file mode 100644 index 0000000000..46fbe28968 --- /dev/null +++ b/site/content/en/docs/Tutorials/openid_connect_auth.md @@ -0,0 +1,40 @@ +--- +title: "OpenID Connect Authentication" +linkTitle: "OpenID Connect Authentication" +weight: 1 +date: 2018-01-02 +description: > + Configuring minikube to use OpenID Connect Authentication +--- + +The `kube-apiserver` in minikube can be configured to support OpenID Connect Authentication. + +Read more about OpenID Connect Authentication for Kubernetes here: + +## Configuring the API Server + +Configuration values can be passed to the API server using the `--extra-config` flag on the `minikube start` command. See [configuring_kubernetes.md](https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/) for more details. + +The following example configures your Minikube cluster to support RBAC and OIDC: + +```shell +minikube start \ + --extra-config=apiserver.authorization-mode=RBAC \ + --extra-config=apiserver.oidc-issuer-url=https://example.com \ + --extra-config=apiserver.oidc-username-claim=email \ + --extra-config=apiserver.oidc-client-id=kubernetes-local +``` + +## Configuring kubectl + +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: + +```shell +kubectl config set-context kubernetes-local-oidc --cluster=minikube --user username@example.com +Context "kubernetes-local-oidc" created. +kubectl config use-context kubernetes-local-oidc +``` + +For the new context to work you will need to create, at the very minimum, a `Role` and a `RoleBinding` in your cluster to grant permissions to the `subjects` included in your `oidc-username-claim`. diff --git a/site/content/en/docs/Tutorials/tutorial2.md b/site/content/en/docs/Tutorials/tutorial2.md deleted file mode 100644 index b6afc4e503..0000000000 --- a/site/content/en/docs/Tutorials/tutorial2.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -title: "Another Tutorial" -date: 2017-01-05 -weight: 5 -description: > - A short lead descripton about this content page. It can be **bold** or _italic_ and can be split over multiple paragraphs. ---- - -{{% pageinfo %}} -This is a placeholder page. Replace it with your own content. -{{% /pageinfo %}} - -Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://gohugo.io) should be blue with no underlines (unless hovered over). - -There should be whitespace between paragraphs. Vape migas chillwave sriracha poutine try-hard distillery. Tattooed shabby chic small batch, pabst art party heirloom letterpress air plant pop-up. Sustainable chia skateboard art party banjo cardigan normcore affogato vexillologist quinoa meggings man bun master cleanse shoreditch readymade. Yuccie prism four dollar toast tbh cardigan iPhone, tumblr listicle live-edge VHS. Pug lyft normcore hot chicken biodiesel, actually keffiyeh thundercats photo booth pour-over twee fam food truck microdosing banh mi. Vice activated charcoal raclette unicorn live-edge post-ironic. Heirloom vexillologist coloring book, beard deep v letterpress echo park humblebrag tilde. - -90's four loko seitan photo booth gochujang freegan tumeric listicle fam ugh humblebrag. Bespoke leggings gastropub, biodiesel brunch pug fashion axe meh swag art party neutra deep v chia. Enamel pin fanny pack knausgaard tofu, artisan cronut hammock meditation occupy master cleanse chartreuse lumbersexual. Kombucha kogi viral truffaut synth distillery single-origin coffee ugh slow-carb marfa selfies. Pitchfork schlitz semiotics fanny pack, ugh artisan vegan vaporware hexagon. Polaroid fixie post-ironic venmo wolf ramps **kale chips**. - -> There should be no margin above this first sentence. -> -> Blockquotes should be a lighter gray with a border along the left side in the secondary color. -> -> There should be no margin below this final sentence. - -## First Header 2 - -This is a normal paragraph following a header. Knausgaard kale chips snackwave microdosing cronut copper mug swag synth bitters letterpress glossier **craft beer**. Mumblecore bushwick authentic gochujang vegan chambray meditation jean shorts irony. Viral farm-to-table kale chips, pork belly palo santo distillery activated charcoal aesthetic jianbing air plant woke lomo VHS organic. Tattooed locavore succulents heirloom, small batch sriracha echo park DIY af. Shaman you probably haven't heard of them copper mug, crucifix green juice vape *single-origin coffee* brunch actually. Mustache etsy vexillologist raclette authentic fam. Tousled beard humblebrag asymmetrical. I love turkey, I love my job, I love my friends, I love Chardonnay! - -Deae legum paulatimque terra, non vos mutata tacet: dic. Vocant docuique me plumas fila quin afuerunt copia haec o neque. - -On big screens, paragraphs and headings should not take up the full container width, but we want tables, code blocks and similar to take the full width. - -Scenester tumeric pickled, authentic crucifix post-ironic fam freegan VHS pork belly 8-bit yuccie PBR&B. **I love this life we live in**. - - -## Second Header 2 - -> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Header 3 - -``` -This is a code block following a header. -``` - -Next level leggings before they sold out, PBR&B church-key shaman echo park. Kale chips occupy godard whatever pop-up freegan pork belly selfies. Gastropub Belinda subway tile woke post-ironic seitan. Shabby chic man bun semiotics vape, chia messenger bag plaid cardigan. - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| What | Follows | -|-----------|-----------------| -| A table | A header | -| A table | A header | -| A table | A header | - ----------------- - -There's a horizontal rule above and below this. - ----------------- - -Here is an unordered list: - -* Liverpool F.C. -* Chelsea F.C. -* Manchester United F.C. - -And an ordered list: - -1. Michael Brecker -2. Seamus Blake -3. Branford Marsalis - -And an unordered task list: - -- [x] Create a Hugo theme -- [x] Add task lists to it -- [ ] Take a vacation - -And a "mixed" task list: - -- [ ] Pack bags -- ? -- [ ] Travel! - -And a nested list: - -* Jackson 5 - * Michael - * Tito - * Jackie - * Marlon - * Jermaine -* TMNT - * Leonardo - * Michelangelo - * Donatello - * Raphael - -Definition lists can be used with Markdown syntax. Definition headers are bold. - -Name -: Godzilla - -Born -: 1952 - -Birthplace -: Japan - -Color -: Green - - ----------------- - -Tables should have bold headings and alternating shaded rows. - -| Artist | Album | Year | -|-------------------|-----------------|------| -| Michael Jackson | Thriller | 1982 | -| Prince | Purple Rain | 1984 | -| Beastie Boys | License to Ill | 1986 | - -If a table is too wide, it should scroll horizontally. - -| Artist | Album | Year | Label | Awards | Songs | -|-------------------|-----------------|------|-------------|----------|-----------| -| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | -| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | -| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | - ----------------- - -Code snippets like `var foo = "bar";` can be shown inline. - -Also, `this should vertically align` ~~`with this`~~ ~~and this~~. - -Code can also be shown in a block element. - -``` -foo := "bar"; -bar := "foo"; -``` - -Code can also use syntax highlighting. - -```go -func main() { - input := `var foo = "bar";` - - lexer := lexers.Get("javascript") - iterator, _ := lexer.Tokenise(nil, input) - style := styles.Get("github") - formatter := html.New(html.WithLineNumbers()) - - var buff bytes.Buffer - formatter.Format(&buff, style, iterator) - - fmt.Println(buff.String()) -} -``` - -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -Inline code inside table cells should still be distinguishable. - -| Language | Code | -|-------------|--------------------| -| Javascript | `var foo = "bar";` | -| Ruby | `foo = "bar"{` | - ----------------- - -Small images should be shown at their actual size. - -![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/240px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg) - -Large images should always scale down and fit in the content container. - -![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/1024px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg) - -_The photo above of the Spruce Picea abies shoot with foliage buds: Bjørn Erik Pedersen, CC-BY-SA._ - - -## Components - -### Alerts - -{{< alert >}}This is an alert.{{< /alert >}} -{{< alert title="Note" >}}This is an alert with a title.{{< /alert >}} -{{% alert title="Note" %}}This is an alert with a title and **Markdown**.{{% /alert %}} -{{< alert color="success" >}}This is a successful alert.{{< /alert >}} -{{< alert color="warning" >}}This is a warning.{{< /alert >}} -{{< alert color="warning" title="Warning" >}}This is a warning with a title.{{< /alert >}} - - -## Another Heading - -Add some sections here to see how the ToC looks like. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### This Document - -Inguina genus: Anaphen post: lingua violente voce suae meus aetate diversi. Orbis unam nec flammaeque status deam Silenum erat et a ferrea. Excitus rigidum ait: vestro et Herculis convicia: nitidae deseruit coniuge Proteaque adiciam *eripitur*? Sitim noceat signa *probat quidem*. Sua longis *fugatis* quidem genae. - - -### Pixel Count - -Tilde photo booth wayfarers cliche lomo intelligentsia man braid kombucha vaporware farm-to-table mixtape portland. PBR&B pickled cornhole ugh try-hard ethical subway tile. Fixie paleo intelligentsia pabst. Ennui waistcoat vinyl gochujang. Poutine salvia authentic affogato, chambray lumbersexual shabby chic. - -### Contact Info - -Plaid hell of cred microdosing, succulents tilde pour-over. Offal shabby chic 3 wolf moon blue bottle raw denim normcore poutine pork belly. - - -### External Links - -Stumptown PBR&B keytar plaid street art, forage XOXO pitchfork selvage affogato green juice listicle pickled everyday carry hashtag. Organic sustainable letterpress sartorial scenester intelligentsia swag bushwick. Put a bird on it stumptown neutra locavore. IPhone typewriter messenger bag narwhal. Ennui cold-pressed seitan flannel keytar, single-origin coffee adaptogen occupy yuccie williamsburg chillwave shoreditch forage waistcoat. - - - -``` -This is the final element on the page and there should be no margin below this. -``` diff --git a/site/content/en/start.jpg b/site/content/en/start.jpg deleted file mode 100644 index 1ee9cc3e6c..0000000000 Binary files a/site/content/en/start.jpg and /dev/null differ diff --git a/site/content/en/start.png b/site/content/en/start.png new file mode 100644 index 0000000000..7ee9706c31 Binary files /dev/null and b/site/content/en/start.png differ diff --git a/site/layouts/partials/community-links.html b/site/layouts/partials/community-links.html new file mode 100644 index 0000000000..9c5545d4dc --- /dev/null +++ b/site/layouts/partials/community-links.html @@ -0,0 +1,29 @@ +{{ $links := .Site.Params.links }} + + + +{{ define "community-links-list" }} + +{{ end }} diff --git a/site/static/css/tabs.css b/site/static/css/tabs.css index 9bbc3ea8b0..d3c83fd294 100644 --- a/site/static/css/tabs.css +++ b/site/static/css/tabs.css @@ -15,22 +15,22 @@ div.code-tabs li.nav-tab { color: #666; font-size: 14px; - border-top: 1px solid #CBCBCB; - border-left: 1px solid #CBCBCB; - border-right: 1px solid #CBCBCB; + border-top: 1px solid #C7EAEC; + border-left: 1px solid #C7EAEC; + border-right: 1px solid #C7EAEC; margin-right: 0.5em; border-top-left-radius: 4px; border-top-right-radius: 4px; - background-color: #E5E5E5; + background-color: #c7eaec; } div.code-tabs li.active { - color:#000; - border-top: 1px solid #A9A9A9; - border-left: 1px solid #A9A9A9; - border-right: 1px solid #A9A9A9; - background: #f5f5f5; + color: #f2771a; + border-top: 1px solid #C7EAEC; + border-left: 1px solid #C7EAEC; + border-right: 1px solid #C7EAEC; + background: rgb(244, 255, 255); font-weight: bold; } @@ -47,10 +47,19 @@ div.tab-pane { div.tab-pane.active { display: block; padding: 2em; - background: #f5f5f5; - border: 1px solid #CBCBCB; + background: rgb(244, 255, 255); + border: 1px solid #C7EAEC; } div.code-tabs code { word-break: keep-all; -} \ No newline at end of file +} + +div.code-tabs h2 { + font-size: 1.2rem !important; + font-weight: bold !important; + margin-top: 1.3rem; +} +div.code-tabs h3 { + font-size: 1.1rem !important; +} diff --git a/test.sh b/test.sh index 6f8d4705b8..e052ed6045 100755 --- a/test.sh +++ b/test.sh @@ -28,7 +28,7 @@ make -s lint-ci && echo ok || ((exitcode += 4)) echo "= boilerplate ===========================================================" readonly PYTHON=$(type -P python || echo docker run --rm -it -v $(pwd):/minikube -w /minikube python python) readonly BDIR="./hack/boilerplate" -missing="$($PYTHON ${BDIR}/boilerplate.py --rootdir . --boilerplate-dir ${BDIR} | egrep -v '/assets.go|/translations.go|/site/themes/|/site/node_modules' || true)" +missing="$($PYTHON ${BDIR}/boilerplate.py --rootdir . --boilerplate-dir ${BDIR} | egrep -v '/assets.go|/translations.go|/site/themes/|/site/node_modules|\./out|/hugo/' || true)" if [[ -n "${missing}" ]]; then echo "boilerplate missing: $missing" echo "consider running: ${BDIR}/fix.sh" diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index f8b57d2097..bae1efded5 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -48,6 +48,7 @@ func TestFunctional(t *testing.T) { t.Run("ServicesList", testServicesList) t.Run("Provisioning", testProvisioning) t.Run("Tunnel", testTunnel) + t.Run("kubecontext", testKubeConfigCurrentCtx) if !isTestNoneDriver(t) { t.Run("EnvVars", testClusterEnv) diff --git a/test/integration/none_test.go b/test/integration/none_test.go new file mode 100644 index 0000000000..826026bed0 --- /dev/null +++ b/test/integration/none_test.go @@ -0,0 +1,114 @@ +// +build integration +// +build linux + +/* +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. +*/ + +package integration + +import ( + "os" + "os/user" + "path/filepath" + "strconv" + "strings" + "syscall" + "testing" +) + +func TestNone(t *testing.T) { + if !isTestNoneDriver(t) { + t.Skip("Only test none driver.") + } + if shouldRunInParallel(t) { + t.Parallel() + } + + err := os.Setenv("CHANGE_MINIKUBE_NONE_USER", "true") + if err != nil { + t.Fatalf("Failed to setup TestNone: set env: %v", err) + } + + p := profileName(t) + mk := NewMinikubeRunner(t, p, "--wait=false") + mk.RunCommand("delete", false) + stdout, stderr, err := mk.Start() + if err != nil { + t.Fatalf("failed to start minikube (for profile %s) failed : %v\nstdout: %s\nstderr: %s", p, err, stdout, stderr) + } + msg := "Configuring local host environment" + if !strings.Contains(stdout, msg) { + t.Errorf("Expected: stdout to contain %q, got: %s", msg, stdout) + } + msg = "may reduce system security and reliability." + if !strings.Contains(stderr, msg) { + t.Errorf("Expected: stderr to contain %q, got: %s", msg, stderr) + } + + t.Run("minikube permissions", testNoneMinikubeFolderPermissions) + t.Run("kubeconfig permissions", testNoneKubeConfigPermissions) + +} + +func testNoneMinikubeFolderPermissions(t *testing.T) { + username := os.Getenv("SUDO_USER") + if username == "" { + t.Fatal("Expected $SUDO_USER env to not be empty") + } + u, err := user.Lookup(username) + if err != nil { + t.Fatalf("Getting user failed: %v", err) + } + uid, err := strconv.Atoi(u.Uid) + if err != nil { + t.Errorf("Failed to convert uid to int: %v", err) + } + info, err := os.Stat(filepath.Join(u.HomeDir, ".minikube")) + if err != nil { + t.Fatalf("Failed to get .minikube dir info, %v", err) + } + fileUID := info.Sys().(*syscall.Stat_t).Uid + + if fileUID != uint32(uid) { + t.Errorf("Expected .minikube folder user: %d, got: %d", uint32(uid), fileUID) + } + +} + +func testNoneKubeConfigPermissions(t *testing.T) { + username := os.Getenv("SUDO_USER") + if username == "" { + t.Fatal("Expected $SUDO_USER env to not be empty") + } + u, err := user.Lookup(username) + if err != nil { + t.Fatalf("Getting user failed: %v", err) + } + uid, err := strconv.Atoi(u.Uid) + if err != nil { + t.Errorf("Failed to convert uid to int: %v", err) + } + info, err := os.Stat(filepath.Join(u.HomeDir, ".kube/config")) + if err != nil { + t.Errorf("Failed to get .minikube dir info, %v", err) + } + fileUID := info.Sys().(*syscall.Stat_t).Uid + + if fileUID != uint32(uid) { + t.Errorf("Expected .minikube folder user: %d, got: %d", uint32(uid), fileUID) + } + +} diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 2d13a17069..f0cb7c93db 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -44,7 +44,7 @@ func TestStartStop(t *testing.T) { name string args []string }{ - {"oldest", []string{ // nocache_oldest + {"oldest", []string{ "--cache-images=false", fmt.Sprintf("--kubernetes-version=%s", constants.OldestKubernetesVersion), // default is the network created by libvirt, if we change the name minikube won't boot @@ -52,7 +52,7 @@ func TestStartStop(t *testing.T) { "--kvm-network=default", "--kvm-qemu-uri=qemu:///system", }}, - {"cni", []string{ // feature_gates_newest_cni + {"cni", []string{ "--feature-gates", "ServerSideApply=true", "--network-plugin=cni", @@ -60,15 +60,15 @@ func TestStartStop(t *testing.T) { "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", fmt.Sprintf("--kubernetes-version=%s", constants.NewestKubernetesVersion), }}, - {"containerd", []string{ // containerd_and_non_default_apiserver_port + {"containerd", []string{ "--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock", "--apiserver-port=8444", }}, - {"crio", []string{ // crio_ignore_preflights + {"crio", []string{ "--container-runtime=crio", - "--extra-config", - "kubeadm.ignore-preflight-errors=SystemVerification", + "--disable-driver-mounts", + "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", }}, } @@ -108,9 +108,6 @@ func TestStartStop(t *testing.T) { err = util.RetryX(stop, 10*time.Second, 2*time.Minute) mk.CheckStatus(state.Stopped.String()) - // TODO medyagh: - // https://github.com/kubernetes/minikube/issues/4854 - stdout, stderr, err = mk.Start(tc.args...) if err != nil { t.Fatalf("failed to start minikube (for profile %s) failed : %v\nstdout: %s\nstderr: %s", t.Name(), err, stdout, stderr) diff --git a/test/integration/z_proxy_test.go b/test/integration/z_proxy_test.go index 69a14be0c7..86b9e2e1fc 100644 --- a/test/integration/z_proxy_test.go +++ b/test/integration/z_proxy_test.go @@ -37,6 +37,7 @@ import ( retryablehttp "github.com/hashicorp/go-retryablehttp" "github.com/phayes/freeport" "github.com/pkg/errors" + "k8s.io/minikube/test/integration/util" ) // setUpProxy runs a local http proxy and sets the env vars for it. @@ -70,7 +71,6 @@ func TestProxy(t *testing.T) { origHP := os.Getenv("HTTP_PROXY") origNP := os.Getenv("NO_PROXY") p := profileName(t) // profile name - if isTestNoneDriver(t) { // TODO fix this later t.Skip("Skipping proxy warning for none") @@ -105,14 +105,14 @@ func TestProxy(t *testing.T) { }(t) t.Run("ProxyConsoleWarnning", testProxyWarning) t.Run("ProxyDashboard", testProxyDashboard) - + t.Run("KubeconfigContext", testKubeConfigCurrentCtx) } // testProxyWarning checks user is warned correctly about the proxy related env vars func testProxyWarning(t *testing.T) { p := profileName(t) // profile name mk := NewMinikubeRunner(t, p) - stdout, stderr, err := mk.Start() + stdout, stderr, err := mk.Start("--wait=false") if err != nil { t.Fatalf("failed to start minikube (for profile %s) failed : %v\nstdout: %s\nstderr: %s", t.Name(), err, stdout, stderr) } @@ -162,3 +162,17 @@ func testProxyDashboard(t *testing.T) { t.Errorf("%s returned status code %d, expected %d.\nbody:\n%s", u, resp.StatusCode, http.StatusOK, body) } } + +// testKubeConfigCurrentCtx checks weather the current-context is set after star +func testKubeConfigCurrentCtx(t *testing.T) { + p := profileName(t) // profile name + kr := util.NewKubectlRunner(t, p) + ctxAfter, err := kr.RunCommand([]string{"config", "current-context"}, false) + if err != nil { + t.Errorf("expected not to get error for kubectl config current-context but got error: %v", err) + } + + if !strings.Contains(string(ctxAfter), p) { + t.Errorf("expected kubecontext after start to be %s but got %s", p, ctxAfter) + } +} diff --git a/translations/fr-FR.json b/translations/fr-FR.json index aac753e008..9217fe419f 100644 --- a/translations/fr-FR.json +++ b/translations/fr-FR.json @@ -1,4 +1,5 @@ { + "\n\tOutputs minikube shell completion for the given shell (bash or zsh)\n\n\tThis depends on the bash-completion binary. Example installation instructions:\n\tOS X:\n\t\t$ brew install bash-completion\n\t\t$ source $(brew --prefix)/etc/bash_completion\n\t\t$ minikube completion bash \u003e ~/.minikube-completion # for bash users\n\t\t$ minikube completion zsh \u003e ~/.minikube-completion # for zsh users\n\t\t$ source ~/.minikube-completion\n\tUbuntu:\n\t\t$ apt-get install bash-completion\n\t\t$ source /etc/bash-completion\n\t\t$ source \u003c(minikube completion bash) # for bash users\n\t\t$ source \u003c(minikube completion zsh) # for zsh users\n\n\tAdditionally, you may want to output the completion to a file and source in your .bashrc\n\n\tNote for zsh users: [1] zsh completions are only supported in versions of zsh \u003e= 5.2\n": "", "\"{{.minikube_addon}}\" was successfully disabled": "", "\"{{.name}}\" cluster does not exist": "", "\"{{.profile_name}}\" VM does not exist, nothing to stop": "", @@ -8,34 +9,73 @@ "'none' driver does not support 'minikube docker-env' command": "", "'none' driver does not support 'minikube mount' command": "", "'none' driver does not support 'minikube ssh' command": "", - "==\u003e {{.name}} \u003c==": "", "A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "", "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "", "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "", + "A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "A set of key=value pairs that describe feature gates for alpha/experimental features.": "", + "Access the kubernetes dashboard running within the minikube cluster": "", + "Add an image to local cache.": "", + "Add machine IP to NO_PROXY environment variable": "", + "Add or delete an image from the local cache.": "", + "Additional help topics": "", + "Additional mount options, such as cache=fscache": "", + "Advanced Commands:": "", + "Aliases": "", + "Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to \\\"auto\\\" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers": "", "Alternatively, you may delete the existing VM using `minikube delete -p {{.profile_name}}`": "", + "Amount of RAM allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "", + "Amount of time to wait for a service in seconds": "", + "Amount of time to wait for service in seconds": "", + "Available Commands": "", + "Basic Commands:": "", "Cannot find directory {{.path}} for mount": "", "Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "", "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "", + "Configuration and Management Commands:": "", "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "", + "Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list ": "", "Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}": "Configurant l'environment pour Kubernetes {{.k8sVersion}} sur {{.runtime}} {{.runtimeVersion}}", "Configuring local host environment ...": "", + "Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn": "", "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "Créant un VM %s (CPUs=%d, Mémoire=%dMB, Disque=%dMB)", "Creating mount {{.name}} ...": "", "Creating {{.driver_name}} VM (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "", + "Default group id used for the mount": "", + "Default user id used for the mount": "", + "Delete an image from the local cache.": "", + "Deletes a local kubernetes cluster": "", + "Deletes a local kubernetes cluster. This command deletes the VM, and removes all\nassociated files.": "", "Deleting \"{{.profile_name}}\" in {{.driver_name}} ...": "", "Disable Hyper-V when you want to run VirtualBox to boot the VM": "", + "Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)": "", "Disable dynamic memory in your VM manager, or pass in a larger --memory value": "", "Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.": "", + "Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list ": "", + "Disables the filesystem mounts provided by the hypervisors": "", + "Disk size allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "", + "Display dashboard URL instead of opening a browser": "", + "Display the kubernetes addons URL in the CLI instead of opening it in the default browser": "", + "Display the kubernetes service URL in the CLI instead of opening it in the default browser": "", + "Display values currently set in the minikube config file": "", + "Display values currently set in the minikube config file.": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Documentation: {{.url}}": "", - "Done! kubectl is now configured to use {{.name}}": "Fini! kubectl est maintenant configuré pour utiliser {{.name}}.", + "Done! kubectl is now configured to use \"{{.name}}\"": "Fini! kubectl est maintenant configuré pour utiliser \"{{.name}}\".", "Download complete!": "", - "Downloading Minikube ISO ...": "", + "Downloading VM boot image ...": "", "Downloading {{.name}} {{.version}}": "", "ERROR creating `registry-creds-dpr` secret": "", "ERROR creating `registry-creds-ecr` secret: {{.error}}": "", "ERROR creating `registry-creds-gcr` secret: {{.error}}": "", + "Enable experimental NVIDIA GPU support in minikube": "", + "Enable host resolver for NAT DNS requests (virtualbox)": "", + "Enable proxy for NAT DNS requests (virtualbox)": "", + "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \\\"--network-plugin=cni\\\"": "", + "Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list ": "", "Enabling dashboard ...": "", + "Environment variables to pass to the Docker daemon. (format: key=value)": "", "Error checking driver version: {{.error}}": "", "Error creating list template": "", "Error creating minikube directory": "", @@ -77,6 +117,7 @@ "Error while setting kubectl current context : {{.error}}": "", "Error writing mount pid": "", "Error: [{{.id}}] {{.error}}": "", + "Examples": "", "Failed runtime": "", "Failed to cache ISO": "", "Failed to cache and load images": "", @@ -108,33 +149,80 @@ "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", + "File permissions used for the mount": "", + "Flags": "", "Follow": "", "For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "", "For more information, see:": "", + "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Found network options:": "", + "Found {{.number}} invalid profile(s) ! ": "", + "Gets the kubernetes URL(s) for the specified service in your local cluster": "", + "Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.": "", + "Gets the logs of the running instance, used for debugging minikube, not user code.": "", + "Gets the status of a local kubernetes cluster": "", + "Gets the status of a local kubernetes cluster.\n\tExit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left.\n\tEg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK)": "", + "Gets the value of PROPERTY_NAME from the minikube config file": "", + "Global Flags": "", + "Go template format string for the addon list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#AddonListTemplate": "", + "Go template format string for the cache list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#CacheListTemplate": "", + "Go template format string for the config view output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#ConfigViewTemplate": "", + "Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status": "", "Group ID: {{.groupID}}": "", "Have you set up libvirt correctly?": "", + "Hide the hypervisor signature from the guest in minikube": "", "If the above advice does not help, please let us know: ": "", + "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none.": "", + "If true, only download and cache files for later use - don't install or start anything.": "", "If using the none driver, ensure that systemctl is installed": "", "Ignoring --vm-driver={{.driver_name}}, as the existing \"{{.profile_name}}\" VM was created using the {{.driver_name2}} driver.": "", + "Images Commands:": "", "In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'": "", + "Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.": "", "Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver": "", "Install the latest kvm2 driver and run 'virt-host-validate'": "", "Install the latest minikube hyperkit driver, and run 'minikube delete'": "", "Invalid size passed in argument: {{.error}}": "", "IsEnabled failed": "", + "Kill the mount process spawned by minikube start": "", "Kubernetes downgrade is not supported, will continue to use {{.version}}": "", "Launching Kubernetes ... ": "Lançant Kubernetes ...", "Launching proxy ...": "", + "List all available images from the local cache.": "", + "List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).": "", + "Lists all available minikube addons as well as their current statuses (enabled/disabled)": "", + "Lists all minikube profiles.": "", + "Lists all valid minikube profiles and detects all possible invalid profiles.": "", + "Lists the URLs for the services in your local cluster": "", + "Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now)": "", + "Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.": "", + "Location of the minikube iso": "", + "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'": "", + "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'.": "", "Message Size: {{.size}}": "", + "Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.": "", + "Minikube is a tool for managing local Kubernetes clusters.": "", + "Modify minikube config": "", + "Modify minikube's kubernetes addons": "", "Mount type: {{.name}}": "", "Mounting host path {{.sourcePath}} into VM as {{.destinationPath}} ...": "", + "Mounts the specified directory into minikube": "", + "Mounts the specified directory into minikube.": "", "NOTE: This process must stay alive for the mount to be accessible ...": "", + "Networking and Connectivity Commands:": "", + "No minikube profile was found. You can create one using `minikube start`.": "", "None of known repositories in your location is accessible. Use {{.image_repository_name}} as fallback.": "", "None of known repositories is accessible. Consider specifying an alternative image repository with --image-repository flag": "", - "Opening %s in your default browser...": "", + "Number of CPUs allocated to the minikube VM": "", + "Number of lines back to go within the log": "", + "OS release is {{.pretty_name}}": "", + "Open the addons URL with https instead of http": "", + "Open the service URL with https instead of http": "", "Opening kubernetes service {{.namespace_name}}/{{.service_name}} in default browser...": "", + "Opening {{.url}} in your default browser...": "", + "Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list ": "", "Options: {{.options}}": "", + "Outputs minikube shell completion for the given shell (bash or zsh)": "", "Permissions: {{.octalMode}} ({{.writtenMode}})": "", "Please check your BIOS, and ensure that you are running without HyperV or other nested virtualization that may interfere": "", "Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with {{.driver}} driver.": "", @@ -144,30 +232,49 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please run with sudo. the vm-driver \"{{.driver_name}}\" requires sudo.": "", "Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "", - "Please upgrade the 'docker-machine-driver-kvm2'. {{.documentation_url}}": "", + "Please upgrade the '{{.driver_executable}}'. {{.documentation_url}}": "", "Powering off \"{{.profile_name}}\" via SSH ...": "", + "Preparing Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}} ...": "", + "Print current and latest version number": "", + "Print the version of minikube": "", + "Print the version of minikube.": "", "Problems detected in {{.entry}}:": "", "Problems detected in {{.name}}:": "", + "Profile gets or sets the current minikube profile": "", + "Provide VM UUID to restore MAC address (only supported with Hyperkit driver).": "", "Pulling images ...": "Extrayant les images ... ", "Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message": "", - "Re-using the currently running {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "", "Rebuild libvirt with virt-network support": "", "Received {{.name}} signal": "", + "Registry mirrors to pass to the Docker daemon": "", "Reinstall VirtualBox and verify that it is not blocked: System Preferences -\u003e Security \u0026 Privacy -\u003e General -\u003e Some system software was blocked from loading": "", "Related issues:": "", - "Relaunching Kubernetes {{.version}} using {{.bootstrapper}} ... ": "", - "Requested disk size {{.size_in_mb}} is less than minimum of {{.size_in_mb2}}": "", + "Relaunching Kubernetes using {{.bootstrapper}} ... ": "", + "Requested disk size {{.requested_size}} is less than minimum of {{.minimum_size}}": "", "Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default_memorysize}}MB. Beware that minikube might not work correctly or crash unexpectedly.": "", - "Requested memory allocation {{.size_in_mb}} is less than the minimum allowed of {{.size_in_mb2}}": "", - "Restarting existing {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", + "Requested memory allocation {{.requested_size}} is less than the minimum allowed of {{.minimum_size}}": "", + "Retrieve the ssh identity key path of the specified cluster": "", + "Retrieve the ssh identity key path of the specified cluster.": "", + "Retrieves the IP address of the running cluster": "", + "Retrieves the IP address of the running cluster, and writes it to STDOUT.": "", + "Retrieves the IP address of the running cluster, checks it\n\t\t\twith IP in kubeconfig, and corrects kubeconfig if incorrect.": "", + "Returns the value of PROPERTY_NAME from the minikube config file. Can be overwritten at runtime by flags or environmental variables.": "", "Run 'minikube delete' to delete the stale VM": "", "Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration": "", "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.": "", + "Run kubectl": "", "Run minikube from the C: drive.": "", + "Run the kubernetes client, download it if necessary.\nExamples:\nminikube kubectl -- --help\nkubectl get pods --namespace kube-system": "", "Running on localhost (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "", "Set failed": "", + "Sets an individual value in a minikube config file": "", + "Sets the PROPERTY_NAME config value to PROPERTY_VALUE\n\tThese values can be overwritten by flags or environment variables at runtime.": "", + "Sets up docker env variables; similar to '$(docker-machine env)'": "", + "Sets up docker env variables; similar to '$(docker-machine env)'.": "", "Setting profile failed": "", + "Show only log entries which point to known problems": "", + "Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.": "", "Skipped switching kubectl context for {{.profile_name}} , because --keep-context": "", "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "", "Sorry, completion support is not yet implemented for {{.name}}": "", @@ -175,30 +282,60 @@ "Sorry, url provided with --registry-mirror flag is invalid {{.url}}": "", "Specify --kubernetes-version in v\u003cmajor\u003e.\u003cminor.\u003cbuild\u003e form. example: 'v1.1.14'": "", "Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "", + "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "", + "Specify the 9p version that the mount should use": "", + "Specify the ip that the mount should be setup on": "", + "Specify the mount filesystem type (supported types: 9p)": "", + "Starting existing {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", + "Starts a local kubernetes cluster": "Démarre un cluster Kubernetes", "Stopping \"{{.profile_name}}\" in {{.driver_name}} ...": "", + "Stops a local kubernetes cluster running in Virtualbox. This command stops the VM\nitself, leaving all files intact. The cluster can be started again with the \"start\" command.": "", + "Stops a running local kubernetes cluster": "", "Successfully mounted {{.sourcePath}} to {{.destinationPath}}": "", "Suggestion: {{.advice}}": "", "Target directory {{.path}} must be an absolute path": "", "The \"{{.cluster_name}}\" cluster has been deleted.": "", - "The 'docker-machine-driver-kvm2' version is old. Please consider upgrading. {{.documentation_url}}": "", "The 'none' driver provides limited isolation and may reduce system security and reliability.": "", + "The CIDR to be used for service cluster IPs.": "", + "The CIDR to be used for the minikube VM (only supported with Virtualbox driver)": "", + "The KVM QEMU connection URI. (works only with kvm2 driver on linux)": "", "The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.": "", + "The KVM network name. (only supported with KVM driver)": "", "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error": "", + "The apiserver listening port": "", + "The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "The argument to pass the minikube mount command on start": "", + "The cluster dns domain name used in the kubernetes cluster": "", + "The container runtime to be used (docker, crio, containerd)": "", + "The cri socket path to be used": "", "The docker host is currently not running": "", "The docker service is currently not active": "", + "The driver '{{.driver}}' is not supported on {{.os}}": "", + "The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)": "", + "The kubernetes version that the minikube VM will use (ex: v1.2.3)": "", "The minikube VM is offline. Please run 'minikube start' to start it again.": "", + "The name of the network plugin": "", + "The number of bytes to use for 9p packet payload": "", + "The service namespace": "", + "The services namespace": "", + "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", "The value passed to --format is invalid: {{.error}}": "", - "The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.\n\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "", + "The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\tSee https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information.\n\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "", + "There's a new version for '{{.driver_executable}}'. Please consider upgrading. {{.documentation_url}}": "", "These changes will take effect upon a minikube delete and then a minikube start": "", "This addon does not have an endpoint defined for the 'addons open' command.\nYou can add one by annotating a service with the label {{.labelName}}:{{.addonName}}": "", "This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true": "", + "This will keep the existing kubectl context and will create a minikube context.": "", + "This will start the mount daemon and automatically mount files into minikube": "", "Tip: Use 'minikube start -p \u003cname\u003e' to create a new cluster, or 'minikube delete' to delete this one.": "", "To connect to this cluster, use: kubectl --context={{.name}}": "", "To connect to this cluster, use: kubectl --context={{.profile_name}}": "", "To disable this notice, run: 'minikube config set WantUpdateNotification false'": "", + "To start minikube with HyperV Powershell must be in your PATH`": "", "To switch drivers, you may create a new VM using `minikube start -p \u003cname\u003e --vm-driver={{.driver_name}}`": "", "To use kubectl or minikube commands as your own user, you may": "", + "Troubleshooting Commands:": "", "Unable to bind flags": "", "Unable to enable dashboard": "", "Unable to fetch latest version info": "", @@ -209,72 +346,85 @@ "Unable to load cached images from config file.": "", "Unable to load cached images: {{.error}}": "", "Unable to load config: {{.error}}": "", - "Unable to parse \"{{.kubenretes_version}}\": {{.error}}": "", + "Unable to parse \"{{.kubernetes_version}}\": {{.error}}": "", "Unable to pull images, which may be OK: {{.error}}": "", "Unable to start VM": "", "Unable to stop VM": "", "Uninstalling Kubernetes {{.kubernetes_version}} using {{.bootstrapper_name}} ...": "", "Unmounting {{.path}} ...": "", + "Unset variables instead of setting them": "", "Update server returned an empty list": "", "Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.": "", + "Upgrading from Kubernetes {{.old}} to {{.new}}": "", + "Usage": "Usage", "Usage: minikube completion SHELL": "", + "Use \"{{.CommandPath}} [command] --help\" for more information about a command.": "", "User ID: {{.userID}}": "", "Userspace file server is shutdown": "", "Userspace file server: ": "", "Using image repository {{.name}}": "", + "Using the running {{.driver_name}} \"{{.profile_name}}\" VM ...": "", "Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.": "", + "Verify the IP address of the running cluster in kubeconfig.": "", "Verifying dashboard health ...": "", "Verifying proxy health ...": "", "Verifying:": "Vérifiant:", "Version: {{.version}}": "", "Wait failed": "", "Wait failed: {{.error}}": "", + "Wait until Kubernetes core services are healthy before exiting": "", "Waiting for SSH access ...": "Attendant l'accès SSH ...", - "You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details": "", + "Waiting for the host to be provisioned ...": "", + "Waiting for:": "", + "Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now)": "", + "You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://minikube.sigs.k8s.io/docs/reference/networking/proxy/ for more details": "", + "You can delete them using the following command(s): ": "", "You must specify a service name": "", "Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem": "", "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.": "", - "\\n": "", "addon '{{.name}}' is currently not enabled.\nTo enable this addon run:\nminikube addons enable {{.name}}": "", "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addon list failed": "", + "addons modifies minikube addons files using subcommands like \"minikube addons enable heapster\"": "", "api load": "", "bash completion failed": "", "browser failed to open url: {{.error}}": "", + "call with cleanup=true to remove old tunnels": "", "command runner": "", + "config modifies minikube config files using subcommands like \"minikube config set vm-driver kvm\"\nConfigurable fields: \\n\\n": "", "config view failed": "", "dashboard service is not running: {{.error}}": "", "disable failed": "", "enable failed": "", - "env {{.docker_env}}": "", "error creating clientset": "", "error creating machine client": "", "error getting driver": "", "error parsing the input ip address for mount": "", "error starting tunnel": "", "failed to open browser: {{.error}}": "", - "kube-system": "", "kubectl and minikube configuration will be stored in {{.home_folder}}": "", - "kubectl has been configured configured to use {{.name}}": "", "kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "", "kubectl proxy": "", "logdir set failed": "", "minikube is not running, so the service cannot be accessed": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube profile was successfully set to {{.profile_name}}": "", - "minikube will upgrade the local cluster from Kubernetes {{.old}} to {{.new}}": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "minikube {{.version}} on {{.os}} ({{.arch}})": "minikube {{.version}} sur {{.os}} ({{.arch}})", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", "mount failed": "", "need to relocate them. For example, to overwrite your own settings:": "", - "opt {{.docker_option}}": "", + "profile sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default`": "", "service {{.namespace_name}}/{{.service_name}} has no node port": "", "stat failed": "", + "tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP": "", + "tunnel makes services of type LoadBalancer accessible on localhost": "", "unable to bind flags": "", "unable to set logtostderr": "", "unset failed": "", - "unsupported driver: {{.driver_name}}": "", + "unset minikube profile": "", + "unsets PROPERTY_NAME from the minikube config file. Can be overwritten by flags or environmental variables": "", + "unsets an individual value in a minikube config file": "", "unsupported driver: {{.name}}": "", "update config": "", "usage: minikube addons configure ADDON_NAME": "", @@ -288,16 +438,13 @@ "usage: minikube profile [MINIKUBE_PROFILE_NAME]": "", "zsh completion failed": "", "{{.addonName}} was successfully enabled": "", - "{{.error}}": "", "{{.extra_option_component_name}}.{{.key}}={{.value}}": "", - "{{.key}}={{.value}}": "", "{{.machine}} IP has been updated to point at {{.ip}}": "", "{{.machine}} IP was already correctly configured for {{.ip}}": "", - "{{.msg}}: {{.err}}": "", "{{.name}} cluster does not exist": "", "{{.name}} has no available configuration options": "", "{{.name}} was successfully configured": "", + "{{.prefix}}minikube {{.version}} on {{.platform}}": "", "{{.type}} is not yet a supported filesystem. We will try anyways!": "", - "{{.url}}": "", "{{.url}} is not accessible: {{.error}}": "" } \ No newline at end of file diff --git a/translations/zh-CN.json b/translations/zh-CN.json index b9a194609b..788106e2e4 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -1,4 +1,5 @@ { + "\n\tOutputs minikube shell completion for the given shell (bash or zsh)\n\n\tThis depends on the bash-completion binary. Example installation instructions:\n\tOS X:\n\t\t$ brew install bash-completion\n\t\t$ source $(brew --prefix)/etc/bash_completion\n\t\t$ minikube completion bash \u003e ~/.minikube-completion # for bash users\n\t\t$ minikube completion zsh \u003e ~/.minikube-completion # for zsh users\n\t\t$ source ~/.minikube-completion\n\tUbuntu:\n\t\t$ apt-get install bash-completion\n\t\t$ source /etc/bash-completion\n\t\t$ source \u003c(minikube completion bash) # for bash users\n\t\t$ source \u003c(minikube completion zsh) # for zsh users\n\n\tAdditionally, you may want to output the completion to a file and source in your .bashrc\n\n\tNote for zsh users: [1] zsh completions are only supported in versions of zsh \u003e= 5.2\n": "", "\"{{.minikube_addon}}\" was successfully disabled": "", "\"{{.name}}\" cluster does not exist": "", "\"{{.profile_name}}\" VM does not exist, nothing to stop": "", @@ -8,34 +9,74 @@ "'none' driver does not support 'minikube docker-env' command": "", "'none' driver does not support 'minikube mount' command": "", "'none' driver does not support 'minikube ssh' command": "", - "==\u003e {{.name}} \u003c==": "", "A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "", "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "", "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "", + "A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "A set of key=value pairs that describe feature gates for alpha/experimental features.": "", + "Access the kubernetes dashboard running within the minikube cluster": "", + "Add an image to local cache.": "", + "Add machine IP to NO_PROXY environment variable": "", + "Add or delete an image from the local cache.": "", + "Additional help topics": "", + "Additional mount options, such as cache=fscache": "", + "Advanced Commands:": "", + "Aliases": "", + "Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to \\\"auto\\\" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers": "", "Alternatively, you may delete the existing VM using `minikube delete -p {{.profile_name}}`": "", + "Amount of RAM allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "", + "Amount of time to wait for a service in seconds": "", + "Amount of time to wait for service in seconds": "", + "Available Commands": "", + "Basic Commands:": "", "Cannot find directory {{.path}} for mount": "", "Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "", "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "", + "Configuration and Management Commands:": "", "Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "", + "Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list ": "", "Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}": "开始为Kubernetes {{.k8sVersion}},{{.runtime}} {{.runtimeVersion}} 配置环境变量", "Configuring local host environment ...": "", + "Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn": "", "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "正在创建%s虚拟机(CPU=%d,内存=%dMB,磁盘=%dMB)...", "Creating mount {{.name}} ...": "", "Creating {{.driver_name}} VM (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "", + "Default group id used for the mount": "", + "Default user id used for the mount": "", + "Delete an image from the local cache.": "", + "Deletes a local kubernetes cluster": "", + "Deletes a local kubernetes cluster. This command deletes the VM, and removes all\nassociated files.": "", "Deleting \"{{.profile_name}}\" in {{.driver_name}} ...": "", "Disable Hyper-V when you want to run VirtualBox to boot the VM": "", + "Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)": "", "Disable dynamic memory in your VM manager, or pass in a larger --memory value": "", "Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.": "", + "Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list ": "", + "Disables the filesystem mounts provided by the hypervisors": "", + "Disk size allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "", + "Display dashboard URL instead of opening a browser": "", + "Display the kubernetes addons URL in the CLI instead of opening it in the default browser": "", + "Display the kubernetes service URL in the CLI instead of opening it in the default browser": "", + "Display values currently set in the minikube config file": "", + "Display values currently set in the minikube config file.": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Documentation: {{.url}}": "", + "Done! kubectl is now configured to use \"{{.name}}\"": "", "Done! kubectl is now configured to use {{.name}}": "完成!kubectl已经配置至{{.name}}", "Download complete!": "", - "Downloading Minikube ISO ...": "", + "Downloading VM boot image ...": "", "Downloading {{.name}} {{.version}}": "", "ERROR creating `registry-creds-dpr` secret": "", "ERROR creating `registry-creds-ecr` secret: {{.error}}": "", "ERROR creating `registry-creds-gcr` secret: {{.error}}": "", + "Enable experimental NVIDIA GPU support in minikube": "", + "Enable host resolver for NAT DNS requests (virtualbox)": "", + "Enable proxy for NAT DNS requests (virtualbox)": "", + "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \\\"--network-plugin=cni\\\"": "", + "Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list ": "", "Enabling dashboard ...": "", + "Environment variables to pass to the Docker daemon. (format: key=value)": "", "Error checking driver version: {{.error}}": "", "Error creating list template": "", "Error creating minikube directory": "", @@ -77,6 +118,7 @@ "Error while setting kubectl current context : {{.error}}": "", "Error writing mount pid": "", "Error: [{{.id}}] {{.error}}": "", + "Examples": "", "Failed runtime": "", "Failed to cache ISO": "", "Failed to cache and load images": "", @@ -108,33 +150,80 @@ "Failed to update cluster": "", "Failed to update config": "", "Failed unmount: {{.error}}": "", + "File permissions used for the mount": "", + "Flags": "", "Follow": "", "For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "", "For more information, see:": "", + "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Found network options:": "", + "Found {{.number}} invalid profile(s) ! ": "", + "Gets the kubernetes URL(s) for the specified service in your local cluster": "", + "Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.": "", + "Gets the logs of the running instance, used for debugging minikube, not user code.": "", + "Gets the status of a local kubernetes cluster": "", + "Gets the status of a local kubernetes cluster.\n\tExit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left.\n\tEg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK)": "", + "Gets the value of PROPERTY_NAME from the minikube config file": "", + "Global Flags": "", + "Go template format string for the addon list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#AddonListTemplate": "", + "Go template format string for the cache list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#CacheListTemplate": "", + "Go template format string for the config view output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#ConfigViewTemplate": "", + "Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/\nFor the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status": "", "Group ID: {{.groupID}}": "", "Have you set up libvirt correctly?": "", + "Hide the hypervisor signature from the guest in minikube": "", "If the above advice does not help, please let us know: ": "", + "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none.": "", + "If true, only download and cache files for later use - don't install or start anything.": "", "If using the none driver, ensure that systemctl is installed": "", "Ignoring --vm-driver={{.driver_name}}, as the existing \"{{.profile_name}}\" VM was created using the {{.driver_name2}} driver.": "", + "Images Commands:": "", "In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'": "", + "Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.": "", "Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver": "", "Install the latest kvm2 driver and run 'virt-host-validate'": "", "Install the latest minikube hyperkit driver, and run 'minikube delete'": "", "Invalid size passed in argument: {{.error}}": "", "IsEnabled failed": "", + "Kill the mount process spawned by minikube start": "", "Kubernetes downgrade is not supported, will continue to use {{.version}}": "", "Launching Kubernetes ... ": "正在启动 Kubernetes ... ", "Launching proxy ...": "", + "List all available images from the local cache.": "", + "List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).": "", + "Lists all available minikube addons as well as their current statuses (enabled/disabled)": "", + "Lists all minikube profiles.": "", + "Lists all valid minikube profiles and detects all possible invalid profiles.": "", + "Lists the URLs for the services in your local cluster": "", + "Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now)": "", + "Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.": "", + "Location of the minikube iso": "", + "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'": "", + "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'.": "", "Message Size: {{.size}}": "", + "Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.": "", + "Minikube is a tool for managing local Kubernetes clusters.": "", + "Modify minikube config": "", + "Modify minikube's kubernetes addons": "", "Mount type: {{.name}}": "", "Mounting host path {{.sourcePath}} into VM as {{.destinationPath}} ...": "", + "Mounts the specified directory into minikube": "", + "Mounts the specified directory into minikube.": "", "NOTE: This process must stay alive for the mount to be accessible ...": "", + "Networking and Connectivity Commands:": "", + "No minikube profile was found. You can create one using `minikube start`.": "", "None of known repositories in your location is accessible. Use {{.image_repository_name}} as fallback.": "", "None of known repositories is accessible. Consider specifying an alternative image repository with --image-repository flag": "", - "Opening %s in your default browser...": "", + "Number of CPUs allocated to the minikube VM": "", + "Number of lines back to go within the log": "", + "OS release is {{.pretty_name}}": "", + "Open the addons URL with https instead of http": "", + "Open the service URL with https instead of http": "", "Opening kubernetes service {{.namespace_name}}/{{.service_name}} in default browser...": "", + "Opening {{.url}} in your default browser...": "", + "Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list ": "", "Options: {{.options}}": "", + "Outputs minikube shell completion for the given shell (bash or zsh)": "", "Permissions: {{.octalMode}} ({{.writtenMode}})": "", "Please check your BIOS, and ensure that you are running without HyperV or other nested virtualization that may interfere": "", "Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with {{.driver}} driver.": "", @@ -144,30 +233,49 @@ "Please make sure the service you are looking for is deployed or is in the correct namespace.": "", "Please run with sudo. the vm-driver \"{{.driver_name}}\" requires sudo.": "", "Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "", - "Please upgrade the 'docker-machine-driver-kvm2'. {{.documentation_url}}": "", + "Please upgrade the '{{.driver_executable}}'. {{.documentation_url}}": "", "Powering off \"{{.profile_name}}\" via SSH ...": "", + "Preparing Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}} ...": "", + "Print current and latest version number": "", + "Print the version of minikube": "", + "Print the version of minikube.": "", "Problems detected in {{.entry}}:": "", "Problems detected in {{.name}}:": "", + "Profile gets or sets the current minikube profile": "", + "Provide VM UUID to restore MAC address (only supported with Hyperkit driver).": "", "Pulling images ...": "拉取镜像 ...", "Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message": "", - "Re-using the currently running {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", "Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "", "Rebuild libvirt with virt-network support": "", "Received {{.name}} signal": "", + "Registry mirrors to pass to the Docker daemon": "", "Reinstall VirtualBox and verify that it is not blocked: System Preferences -\u003e Security \u0026 Privacy -\u003e General -\u003e Some system software was blocked from loading": "", "Related issues:": "", - "Relaunching Kubernetes {{.version}} using {{.bootstrapper}} ... ": "", - "Requested disk size {{.size_in_mb}} is less than minimum of {{.size_in_mb2}}": "", + "Relaunching Kubernetes using {{.bootstrapper}} ... ": "", + "Requested disk size {{.requested_size}} is less than minimum of {{.minimum_size}}": "", "Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default_memorysize}}MB. Beware that minikube might not work correctly or crash unexpectedly.": "", - "Requested memory allocation {{.size_in_mb}} is less than the minimum allowed of {{.size_in_mb2}}": "", - "Restarting existing {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", + "Requested memory allocation {{.requested_size}} is less than the minimum allowed of {{.minimum_size}}": "", + "Retrieve the ssh identity key path of the specified cluster": "", + "Retrieve the ssh identity key path of the specified cluster.": "", + "Retrieves the IP address of the running cluster": "", + "Retrieves the IP address of the running cluster, and writes it to STDOUT.": "", + "Retrieves the IP address of the running cluster, checks it\n\t\t\twith IP in kubeconfig, and corrects kubeconfig if incorrect.": "", + "Returns the value of PROPERTY_NAME from the minikube config file. Can be overwritten at runtime by flags or environmental variables.": "", "Run 'minikube delete' to delete the stale VM": "", "Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration": "", "Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.": "", + "Run kubectl": "", "Run minikube from the C: drive.": "", + "Run the kubernetes client, download it if necessary.\nExamples:\nminikube kubectl -- --help\nkubectl get pods --namespace kube-system": "", "Running on localhost (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "", "Set failed": "", + "Sets an individual value in a minikube config file": "", + "Sets the PROPERTY_NAME config value to PROPERTY_VALUE\n\tThese values can be overwritten by flags or environment variables at runtime.": "", + "Sets up docker env variables; similar to '$(docker-machine env)'": "", + "Sets up docker env variables; similar to '$(docker-machine env)'.": "", "Setting profile failed": "", + "Show only log entries which point to known problems": "", + "Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.": "", "Skipped switching kubectl context for {{.profile_name}} , because --keep-context": "", "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "", "Sorry, completion support is not yet implemented for {{.name}}": "", @@ -175,30 +283,60 @@ "Sorry, url provided with --registry-mirror flag is invalid {{.url}}": "", "Specify --kubernetes-version in v\u003cmajor\u003e.\u003cminor.\u003cbuild\u003e form. example: 'v1.1.14'": "", "Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "", + "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "", + "Specify the 9p version that the mount should use": "", + "Specify the ip that the mount should be setup on": "", + "Specify the mount filesystem type (supported types: 9p)": "", + "Starting existing {{.driver_name}} VM for \"{{.profile_name}}\" ...": "", + "Starts a local kubernetes cluster": "", "Stopping \"{{.profile_name}}\" in {{.driver_name}} ...": "", + "Stops a local kubernetes cluster running in Virtualbox. This command stops the VM\nitself, leaving all files intact. The cluster can be started again with the \"start\" command.": "", + "Stops a running local kubernetes cluster": "", "Successfully mounted {{.sourcePath}} to {{.destinationPath}}": "", "Suggestion: {{.advice}}": "", "Target directory {{.path}} must be an absolute path": "", "The \"{{.cluster_name}}\" cluster has been deleted.": "", - "The 'docker-machine-driver-kvm2' version is old. Please consider upgrading. {{.documentation_url}}": "", "The 'none' driver provides limited isolation and may reduce system security and reliability.": "", + "The CIDR to be used for service cluster IPs.": "", + "The CIDR to be used for the minikube VM (only supported with Virtualbox driver)": "", + "The KVM QEMU connection URI. (works only with kvm2 driver on linux)": "", "The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.": "", + "The KVM network name. (only supported with KVM driver)": "", "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error": "", + "The apiserver listening port": "", + "The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "", + "The argument to pass the minikube mount command on start": "", + "The cluster dns domain name used in the kubernetes cluster": "", + "The container runtime to be used (docker, crio, containerd)": "", + "The cri socket path to be used": "", "The docker host is currently not running": "", "The docker service is currently not active": "", + "The driver '{{.driver}}' is not supported on {{.os}}": "", + "The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)": "", + "The kubernetes version that the minikube VM will use (ex: v1.2.3)": "", "The minikube VM is offline. Please run 'minikube start' to start it again.": "", + "The name of the network plugin": "", + "The number of bytes to use for 9p packet payload": "", + "The service namespace": "", + "The services namespace": "", + "The time interval for each check that wait performs in seconds": "", "The value passed to --format is invalid": "", "The value passed to --format is invalid: {{.error}}": "", - "The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.\n\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "", + "The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\tSee https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information.\n\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "", + "There's a new version for '{{.driver_executable}}'. Please consider upgrading. {{.documentation_url}}": "", "These changes will take effect upon a minikube delete and then a minikube start": "", "This addon does not have an endpoint defined for the 'addons open' command.\nYou can add one by annotating a service with the label {{.labelName}}:{{.addonName}}": "", "This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true": "", + "This will keep the existing kubectl context and will create a minikube context.": "", + "This will start the mount daemon and automatically mount files into minikube": "", "Tip: Use 'minikube start -p \u003cname\u003e' to create a new cluster, or 'minikube delete' to delete this one.": "", "To connect to this cluster, use: kubectl --context={{.name}}": "", "To connect to this cluster, use: kubectl --context={{.profile_name}}": "", "To disable this notice, run: 'minikube config set WantUpdateNotification false'": "", + "To start minikube with HyperV Powershell must be in your PATH`": "", "To switch drivers, you may create a new VM using `minikube start -p \u003cname\u003e --vm-driver={{.driver_name}}`": "", "To use kubectl or minikube commands as your own user, you may": "", + "Troubleshooting Commands:": "", "Unable to bind flags": "", "Unable to enable dashboard": "", "Unable to fetch latest version info": "", @@ -209,72 +347,84 @@ "Unable to load cached images from config file.": "", "Unable to load cached images: {{.error}}": "", "Unable to load config: {{.error}}": "", - "Unable to parse \"{{.kubenretes_version}}\": {{.error}}": "", + "Unable to parse \"{{.kubernetes_version}}\": {{.error}}": "", "Unable to pull images, which may be OK: {{.error}}": "", "Unable to start VM": "", "Unable to stop VM": "", "Uninstalling Kubernetes {{.kubernetes_version}} using {{.bootstrapper_name}} ...": "", "Unmounting {{.path}} ...": "", + "Unset variables instead of setting them": "", "Update server returned an empty list": "", "Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.": "", + "Upgrading from Kubernetes {{.old}} to {{.new}}": "", + "Usage": "", "Usage: minikube completion SHELL": "", + "Use \"{{.CommandPath}} [command] --help\" for more information about a command.": "", "User ID: {{.userID}}": "", "Userspace file server is shutdown": "", "Userspace file server: ": "", "Using image repository {{.name}}": "", + "Using the running {{.driver_name}} \"{{.profile_name}}\" VM ...": "", "Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.": "", + "Verify the IP address of the running cluster in kubeconfig.": "", "Verifying dashboard health ...": "", "Verifying proxy health ...": "", "Verifying:": "正在验证:", "Version: {{.version}}": "", "Wait failed": "", "Wait failed: {{.error}}": "", - "Waiting for SSH access ...": "", - "You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details": "", + "Wait until Kubernetes core services are healthy before exiting": "", + "Waiting for the host to be provisioned ...": "", + "Waiting for:": "", + "Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now)": "", + "You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP ({{.ip_address}}). Please see https://minikube.sigs.k8s.io/docs/reference/networking/proxy/ for more details": "", + "You can delete them using the following command(s): ": "", "You must specify a service name": "", "Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem": "", "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.": "", - "\\n": "", "addon '{{.name}}' is currently not enabled.\nTo enable this addon run:\nminikube addons enable {{.name}}": "", "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addon list failed": "", + "addons modifies minikube addons files using subcommands like \"minikube addons enable heapster\"": "", "api load": "", "bash completion failed": "", "browser failed to open url: {{.error}}": "", + "call with cleanup=true to remove old tunnels": "", "command runner": "", + "config modifies minikube config files using subcommands like \"minikube config set vm-driver kvm\"\nConfigurable fields: \\n\\n": "", "config view failed": "", "dashboard service is not running: {{.error}}": "", "disable failed": "", "enable failed": "", - "env {{.docker_env}}": "", "error creating clientset": "", "error creating machine client": "", "error getting driver": "", "error parsing the input ip address for mount": "", "error starting tunnel": "", "failed to open browser: {{.error}}": "", - "kube-system": "", "kubectl and minikube configuration will be stored in {{.home_folder}}": "", - "kubectl has been configured configured to use {{.name}}": "", "kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "", "kubectl proxy": "", "logdir set failed": "", "minikube is not running, so the service cannot be accessed": "", "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "", "minikube profile was successfully set to {{.profile_name}}": "", - "minikube will upgrade the local cluster from Kubernetes {{.old}} to {{.new}}": "", "minikube {{.version}} is available! Download it: {{.url}}": "", "minikube {{.version}} on {{.os}} ({{.arch}})": "您正在使用minikube {{.version}}, 运行平台:{{.os}} ({{.arch}})", "mount argument \"{{.value}}\" must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "", "mount failed": "", "need to relocate them. For example, to overwrite your own settings:": "", - "opt {{.docker_option}}": "", + "profile sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default`": "", "service {{.namespace_name}}/{{.service_name}} has no node port": "", "stat failed": "", + "tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP": "", + "tunnel makes services of type LoadBalancer accessible on localhost": "", "unable to bind flags": "", "unable to set logtostderr": "", "unset failed": "", - "unsupported driver: {{.driver_name}}": "", + "unset minikube profile": "", + "unsets PROPERTY_NAME from the minikube config file. Can be overwritten by flags or environmental variables": "", + "unsets an individual value in a minikube config file": "", "unsupported driver: {{.name}}": "", "update config": "", "usage: minikube addons configure ADDON_NAME": "", @@ -288,16 +438,13 @@ "usage: minikube profile [MINIKUBE_PROFILE_NAME]": "", "zsh completion failed": "", "{{.addonName}} was successfully enabled": "", - "{{.error}}": "", "{{.extra_option_component_name}}.{{.key}}={{.value}}": "", - "{{.key}}={{.value}}": "", "{{.machine}} IP has been updated to point at {{.ip}}": "", "{{.machine}} IP was already correctly configured for {{.ip}}": "", - "{{.msg}}: {{.err}}": "", "{{.name}} cluster does not exist": "", "{{.name}} has no available configuration options": "", "{{.name}} was successfully configured": "", + "{{.prefix}}minikube {{.version}} on {{.platform}}": "", "{{.type}} is not yet a supported filesystem. We will try anyways!": "", - "{{.url}}": "", "{{.url}} is not accessible: {{.error}}": "" } \ No newline at end of file