From faa5c5885a3a88db91caf69ce7507a2a5818b78c Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 28 Oct 2015 10:03:55 -0700 Subject: [PATCH] Update docs for running under docker Make them a bit more version safe. --- .../docker-multinode/master.md | 36 ++++++++++++++----- .../docker-multinode/master.sh | 2 +- .../docker-multinode/worker.md | 9 ++--- .../docker-multinode/worker.sh | 2 +- docs/getting-started-guides/docker.md | 33 +++++++++++++---- 5 files changed, 61 insertions(+), 21 deletions(-) diff --git a/docs/getting-started-guides/docker-multinode/master.md b/docs/getting-started-guides/docker-multinode/master.md index be4b186e1cb..59c0a2b7101 100644 --- a/docs/getting-started-guides/docker-multinode/master.md +++ b/docs/getting-started-guides/docker-multinode/master.md @@ -33,7 +33,9 @@ Documentation for other releases can be found at ## Installing a Kubernetes Master Node via Docker -We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine is `${MASTER_IP}` +We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine +is `${MASTER_IP}`. We'll need to run several versioned Kubernetes components, so we'll assume that the version we want +to run is `${K8S_VERSION}`, which should hold a value such as "1.0.7". There are two main phases to installing the master: * [Setting up `flanneld` and `etcd`](#setting-up-flanneld-and-etcd) @@ -44,7 +46,7 @@ There are two main phases to installing the master: _Note_: There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. -Please install Docker 1.6.2 or Docker 1.7.1. +Please install Docker 1.6.2 or Docker 1.7.1 or Docker 1.8.3. ### Setup Docker-Bootstrap @@ -171,7 +173,7 @@ sudo docker run \ --privileged=true \ --pid=host \ -d \ - gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi --cluster-dns=10.0.0.10 --cluster-domain=cluster.local + gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi --cluster-dns=10.0.0.10 --cluster-domain=cluster.local ``` > Note that `--cluster-dns` and `--cluster-domain` is used to deploy dns, feel free to discard them if dns is not needed. @@ -179,24 +181,40 @@ sudo docker run \ ### Also run the service proxy ```sh -sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 +sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 ``` ### Test it out At this point, you should have a functioning 1-node cluster. Let's test it out! -Download the kubectl binary and make it available by editing your PATH ENV. -([OS X](http://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/darwin/amd64/kubectl)) -([linux](http://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kubectl)) +Download 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](http://storage.googleapis.com/kubernetes-release/release/v1.0.7/bin/darwin/amd64/kubectl)) +([linux](http://storage.googleapis.com/kubernetes-release/release/v1.0.7/bin/linux/amd64/kubectl)) -List the nodes +For example, OS X: + +```console +$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl +$ chmod 755 kubectl +$ PATH=$PATH:`pwd` +``` + +Linux: + +```console +$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl +$ chmod 755 kubectl +$ PATH=$PATH:`pwd` +``` + +Now you can list the nodes: ```sh kubectl get nodes ``` -This should print: +This should print something like: ```console NAME LABELS STATUS diff --git a/docs/getting-started-guides/docker-multinode/master.sh b/docs/getting-started-guides/docker-multinode/master.sh index d23a17b4b2d..af97bf30746 100755 --- a/docs/getting-started-guides/docker-multinode/master.sh +++ b/docs/getting-started-guides/docker-multinode/master.sh @@ -27,7 +27,7 @@ fi # Make sure k8s version env is properly set if [ -z ${K8S_VERSION} ]; then - K8S_VERSION="1.0.3" + K8S_VERSION="1.0.7" echo "K8S_VERSION is not set, using default: ${K8S_VERSION}" else echo "k8s version is set to: ${K8S_VERSION}" diff --git a/docs/getting-started-guides/docker-multinode/worker.md b/docs/getting-started-guides/docker-multinode/worker.md index d6cfed3c4f5..cec32e49581 100644 --- a/docs/getting-started-guides/docker-multinode/worker.md +++ b/docs/getting-started-guides/docker-multinode/worker.md @@ -37,7 +37,8 @@ Documentation for other releases can be found at These instructions are very similar to the master set-up above, but they are duplicated for clarity. You need to repeat these instructions for each node you want to join the cluster. -We will assume that the IP address of this node is `${NODE_IP}` and you have the IP address of the master in `${MASTER_IP}` that you created in the [master instructions](master.md). +We will assume that the IP address of this node is `${NODE_IP}` and you have the IP address of the master in `${MASTER_IP}` that you created in the [master instructions](master.md). We'll need to run several versioned Kubernetes components, so we'll assume that the version we want +to run is `${K8S_VERSION}`, which should hold a value such as "1.0.7". For each worker node, there are three steps: * [Set up `flanneld` on the worker node](#set-up-flanneld-on-the-worker-node) @@ -50,7 +51,7 @@ As before, the Flannel daemon is going to provide network connectivity. _Note_: There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. -Please install Docker 1.6.2 or wait for Docker 1.7.1. +Please install Docker 1.6.2 or Docker 1.7.1 or Docker 1.8.3. #### Set up a bootstrap docker @@ -157,7 +158,7 @@ sudo docker run \ --privileged=true \ --pid=host \ -d \ - gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://${MASTER_IP}:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=$(hostname -i) --cluster-dns=10.0.0.10 --cluster-domain=cluster.local + gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube kubelet --api-servers=http://${MASTER_IP}:8080 --v=2 --address=0.0.0.0 --enable-server --hostname-override=$(hostname -i) --cluster-dns=10.0.0.10 --cluster-domain=cluster.local ``` #### Run the service proxy @@ -165,7 +166,7 @@ sudo docker run \ The service proxy provides load-balancing between groups of containers defined by Kubernetes `Services` ```sh -sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2 +sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2 ``` ### Next steps diff --git a/docs/getting-started-guides/docker-multinode/worker.sh b/docs/getting-started-guides/docker-multinode/worker.sh index 3b227c1a05a..1448e348203 100755 --- a/docs/getting-started-guides/docker-multinode/worker.sh +++ b/docs/getting-started-guides/docker-multinode/worker.sh @@ -27,7 +27,7 @@ fi # Make sure k8s version env is properly set if [ -z ${K8S_VERSION} ]; then - K8S_VERSION="1.0.3" + K8S_VERSION="1.0.7" echo "K8S_VERSION is not set, using default: ${K8S_VERSION}" else echo "k8s version is set to: ${K8S_VERSION}" diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 379e522395f..b320925de6a 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -83,6 +83,9 @@ parameters as follows: swapaccount=1 ``` +4. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to + a value such as "1.0.7". + ### Step One: Run etcd ```sh @@ -103,7 +106,7 @@ docker run \ --pid=host \ --privileged=true \ -d \ - gcr.io/google_containers/hyperkube:v1.0.6 \ + gcr.io/google_containers/hyperkube:v${K8S_VERSION} \ /hyperkube kubelet --containerized --hostname-override="127.0.0.1" --address="0.0.0.0" --api-servers=http://localhost:8080 --config=/etc/kubernetes/manifests ``` @@ -112,15 +115,33 @@ This actually runs the kubelet, which in turn runs a [pod](../user-guide/pods.md ### Step Three: Run the service proxy ```sh -docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.6 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 +docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 ``` ### Test it out -At this point you should have a running Kubernetes cluster. You can test this by downloading the kubectl -binary -([OS X](https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/darwin/amd64/kubectl)) -([linux](https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kubectl)) +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](http://storage.googleapis.com/kubernetes-release/release/v1.0.7/bin/darwin/amd64/kubectl)) +([linux](http://storage.googleapis.com/kubernetes-release/release/v1.0.7/bin/linux/amd64/kubectl)) + +For example, OS X: + +```console +$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/darwin/amd64/kubectl +$ chmod 755 kubectl +$ PATH=$PATH:`pwd` +``` + +Linux: + +```console +$ wget http://storage.googleapis.com/kubernetes-release/release/v${K8S_VERSION}/bin/linux/amd64/kubectl +$ chmod 755 kubectl +$ PATH=$PATH:`pwd` +```