From 7fd579d2acb234fac385c4ef4658b676cde66e3a Mon Sep 17 00:00:00 2001 From: Dan Lorenc Date: Mon, 20 Jun 2016 10:12:26 -0700 Subject: [PATCH] Add minikube page to Getting Started section. --- _data/guides.yml | 2 + docs/getting-started-guides/docker.md | 2 + docs/getting-started-guides/locally.md | 2 + docs/getting-started-guides/minikube.md | 116 ++++++++++++++++++++++++ docs/getting-started-guides/vagrant.md | 2 + 5 files changed, 124 insertions(+) create mode 100644 docs/getting-started-guides/minikube.md diff --git a/_data/guides.yml b/_data/guides.yml index f5654a6efd..dec1026a5a 100644 --- a/_data/guides.yml +++ b/_data/guides.yml @@ -128,6 +128,8 @@ toc: path: /docs/getting-started-guides/ - title: Running Kubernetes on Your Local Machine section: + - title: Running Kubernetes Locally via Minikube + path: /docs/getting-started-guides/minikube/ - title: Running Kubernetes Locally via Docker path: /docs/getting-started-guides/docker/ - title: Running Kubernetes Locally with No VM diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 8efa8ad4e1..80bce6a5a7 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -1,6 +1,8 @@ --- --- +**Stop. This guide has been superseded by [Minikube](../minikube/) which is the recommended method of running Kubernetes on your local machine.** + The following instructions show you how to set up a simple, single node Kubernetes cluster using Docker. Here's a diagram of what the final result will look like: diff --git a/docs/getting-started-guides/locally.md b/docs/getting-started-guides/locally.md index 84ecec34c1..cd08a8b141 100644 --- a/docs/getting-started-guides/locally.md +++ b/docs/getting-started-guides/locally.md @@ -1,6 +1,8 @@ --- --- +**Stop. This guide has been superseded by [Minikube](../minikube/) which is the recommended method of running Kubernetes on your local machine.** + * TOC {:toc} diff --git a/docs/getting-started-guides/minikube.md b/docs/getting-started-guides/minikube.md new file mode 100644 index 0000000000..e4633dfca9 --- /dev/null +++ b/docs/getting-started-guides/minikube.md @@ -0,0 +1,116 @@ +--- +--- + +* TOC +{:toc} + +Minikube starts a single node kubernetes cluster locally for purposes of development and testing. +Minikube packages and configures a Linux VM, Docker and all Kubernetes components, optimized for local development. +Minikube supports Kubernetes features such as: + +* DNS +* NodePorts +* ConfigMaps and Secrets +* Dashboards + +Minikube does not yet support Cloud Provider specific features such as: + +* LoadBalancers +* PersistentVolumes +* Ingress + +### Requirements + +Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS on all platforms. + +To check that this is enabled on Linux, run: + +```shell +cat /proc/cpuinfo | grep 'vmx\|svm' +``` + +This command should output something if the setting is enabled. + +To check that this is enabled on OSX (most newer Macs have this enabled by default), run: + +```shell +sysctl -a | grep machdep.cpu.features | grep VMX + +``` + +This command should output something if the setting is enabled. + +#### Linux + +Minikube requires the latest [Virtualbox](https://www.virtualbox.org/wiki/Downloads) to be installed on your system. + +#### OSX + +Minikube requires one of the following: + +* The latest [Virtualbox](https://www.virtualbox.org/wiki/Downloads). +* The latest version of [VMWare Fusion](https://www.vmware.com/products/fusion). + +### Installation + +See the [latest Minikube release](https://github.com/kubernetes/minikube/releases) for installation instructions. + +### Starting the cluster + +To start a cluster, run the command: + +```shell +minikube start +Starting local Kubernetes cluster... +Kubernetes is available at https://192.168.99.100:443. +``` + +This will build and start a lightweight local cluster, consisting of a master, etcd, Docker and a single node. + +Minikube will also create a "minikube" context, and set it to default in kubectl. +To switch back to this context later, run this command: `kubectl config use-context minikube`. + +Type `minikube stop` to shut the cluster down. + +Minikube also includes the [Kubernetes dashboard](http://kubernetes.io/docs/user-guide/ui/). Run this command to see the included kube-system pods: + +```shell +$ kubectl get pods --all-namespaces +NAMESPACE NAME READY STATUS RESTARTS AGE +kube-system kube-addon-manager-127.0.0.1 1/1 Running 0 35s +kube-system kubernetes-dashboard-9brhv 1/1 Running 0 20s +``` + +Run this command to open the Kubernetes dashboard: + +```shell +minikube dashboard +``` + +### Test it out + +List the nodes in your cluster by running: + +```shell +kubectl get nodes +``` + +Minikube contains a built-in Docker daemon that for running containers. +If you use another Docker daemon for building your containers, you will have to publish them to a registry before minikube can pull them. +You can use minikube's built in Docker daemon to avoid this extra step of pushing your images. +Use the built-in Docker daemon with: + +```shell +eval $(minikube docker-env) +``` + +This command sets up the Docker environment variables so a Docker client can communicate with the minikube Docker daemon: + +```shell +docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +42c643fea98b gcr.io/google_containers/kubernetes-dashboard-amd64:v1.0.1 "/dashboard --port=90" 3 minutes ago Up 3 minutes k8s_kubernetes-dashboard.1d0d880_kubernetes-dashboard-9brhv_kube-system_5062dd0b-370b-11e6-84b6-5eab1f51187f_134cba4c +475db7659edf gcr.io/google_containers/pause-amd64:3.0 "/pause" 3 minutes ago Up 3 minutes k8s_POD.2225036b_kubernetes-dashboard-9brhv_kube-system_5062dd0b-370b-11e6-84b6-5eab1f51187f_e76d8136 +e9096501addf gcr.io/google-containers/kube-addon-manager-amd64:v2 "/opt/kube-addons.sh" 3 minutes ago Up 3 minutes k8s_kube-addon-manager.a1c58ca2_kube-addon-manager-127.0.0.1_kube-system_48abed82af93bb0b941173334110923f_82655b7d +64748893cf7c gcr.io/google_containers/pause-amd64:3.0 "/pause" 4 minutes ago Up 4 minutes k8s_POD.d8dbe16c_kube-addon-manager-127.0.0.1_kube-system_48abed82af93bb0b941173334110923f_c67701c3 +``` \ No newline at end of file diff --git a/docs/getting-started-guides/vagrant.md b/docs/getting-started-guides/vagrant.md index 99127f5233..12f02b593f 100644 --- a/docs/getting-started-guides/vagrant.md +++ b/docs/getting-started-guides/vagrant.md @@ -1,6 +1,8 @@ --- --- +**Stop. This guide has been superseded by [Minikube](../minikube/) which is the recommended method of running Kubernetes on your local machine.** + Running Kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X). * TOC