From b8dd9ad381d8370060150426cdc074560d411829 Mon Sep 17 00:00:00 2001 From: Vishnu Kannan Date: Thu, 24 Mar 2016 17:49:40 -0700 Subject: [PATCH] Fix docker based localhost setup documentation. --- docs/getting-started-guides/docker.md | 42 +++++++++++++++------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 37ee84c821..8140c72e92 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -14,7 +14,7 @@ Here's a diagram of what the final result will look like: 1. You need to have docker installed on one machine. 2. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to - a released version of Kubernetes >= "1.2.0-alpha.7" + a released version of Kubernetes >= "1.2.0" ### Run it @@ -53,39 +53,43 @@ At this point you should have a running Kubernetes cluster. You can test this by downloading the kubectl binary for `${K8S_VERSION}` (look at the URL in the following links) and make it available by editing your PATH environment variable. -([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/darwin/amd64/kubectl)) -([OS X/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/darwin/386/kubectl)) -([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/amd64/kubectl)) -([linux/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/386/kubectl)) -([linux/arm](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0-alpha.7/bin/linux/arm/kubectl)) +([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/darwin/amd64/kubectl)) +([OS X/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/darwin/386/kubectl)) +([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/amd64/kubectl)) +([linux/386](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/386/kubectl)) +([linux/arm](http://storage.googleapis.com/kubernetes-release/release/{{page.version}}.0/bin/linux/arm/kubectl)) For example, OS X: ```shell -$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl -$ chmod 755 kubectl -$ PATH=$PATH:`pwd` +wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl +chmod 755 kubectl +PATH=$PATH:`pwd` ``` Linux: ```shell -$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl -$ chmod 755 kubectl -$ PATH=$PATH:`pwd` +wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl +chmod 755 kubectl +PATH=$PATH:`pwd` ``` -Create configuration: +On OS X, to make the API server accessible locally, setup a ssh tunnel. ```shell -$ kubectl config set-cluster test-doc --server=http://localhost:8080 -$ kubectl config set-context test-doc --cluster=test-doc -$ kubectl config use-context test-doc +docker-machine ssh `docker-machine active` -N -L 8080:localhost:8080 ``` -For Max OS X users instead of `localhost` you will have to use IP address of your docker machine, -which you can find by running `docker-machine env ` (see [documentation](https://docs.docker.com/machine/reference/env/) -for details). +Setting up a ssh tunnel is applicable to remote docker hosts as well. + +(Optional) Create kubernetes cluster configuration: + +```shell +kubectl config set-cluster test-doc --server=http://localhost:8080 +kubectl config set-context test-doc --cluster=test-doc +kubectl config use-context test-doc +``` ### Test it out