Fix intend mess in scripts

This commit is contained in:
Harry Zhang 2015-07-23 11:09:05 +08:00 committed by resouer
parent 611a41d894
commit e6a2b068cb
3 changed files with 116 additions and 116 deletions

View File

@ -54,6 +54,9 @@ Please install Docker 1.6.2 or wait for Docker 1.7.1.
1. You need a machine with docker installed. 1. You need a machine with docker installed.
There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this guide from working correctly.
Please install Docker 1.6.2 or wait for Docker 1.7.1.
## Overview ## Overview
This guide will set up a 2-node Kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work This guide will set up a 2-node Kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work
@ -78,6 +81,7 @@ it is still useful to use containers for deployment and management, so we create
The first step in the process is to initialize the master node. The first step in the process is to initialize the master node.
Clone the Kubernetes repo, and run [master.sh](docker-multinode/master.sh) on the master machine with root: Clone the Kubernetes repo, and run [master.sh](docker-multinode/master.sh) on the master machine with root:
```sh ```sh
export K8S_VERSION=<your_k8s_version> export K8S_VERSION=<your_k8s_version>
cd kubernetes/cluster/docker-multinode cd kubernetes/cluster/docker-multinode
@ -92,7 +96,8 @@ See [here](docker-multinode/master.md) for detailed instructions explaination.
Once your master is up and running you can add one or more workers on different machines. Once your master is up and running you can add one or more workers on different machines.
Clone the Kubernetes repo, and run [worker.sh](docker-multinode/work.sh) on the worker machine with root: Clone the Kubernetes repo, and run [worker.sh](docker-multinode/worker.sh) on the worker machine with root:
```sh ```sh
export K8S_VERSION=<your_k8s_version> MASTER_IP=<your_master_ip> export K8S_VERSION=<your_k8s_version> MASTER_IP=<your_master_ip>
cd kubernetes/cluster/docker-multinode cd kubernetes/cluster/docker-multinode

View File

@ -22,13 +22,13 @@ set -e
# Make sure docker daemon is running # Make sure docker daemon is running
if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then
echo "Docker is not running on this machine!" echo "Docker is not running on this machine!"
exit exit 1
fi fi
# Make sure k8s version env is properly set # Make sure k8s version env is properly set
if [ -z ${K8S_VERSION} ]; then if [ -z ${K8S_VERSION} ]; then
echo "Please export K8S_VERSION in your env" echo "Please export K8S_VERSION in your env"
exit exit 1
else else
echo "k8s version is set to: ${K8S_VERSION}" echo "k8s version is set to: ${K8S_VERSION}"
fi fi
@ -53,10 +53,7 @@ detect_lsb() {
*64) *64)
;; ;;
*) *)
cat >&2 <<-'EOF' echo "Error: We currently only support 64-bit platforms."
Error: you are not using a 64-bit platform.
We currently only support 64-bit platforms.
EOF
exit 1 exit 1
;; ;;
esac esac
@ -80,6 +77,7 @@ detect_lsb() {
lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')" lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')"
} }
# Start the bootstrap daemon # Start the bootstrap daemon
bootstrap_daemon() { bootstrap_daemon() {
sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null
@ -117,7 +115,7 @@ start_k8s(){
;; ;;
esac esac
# use insecure docker registry # Append the docker opts
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF} echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}

View File

@ -22,13 +22,13 @@ set -e
# Make sure docker daemon is running # Make sure docker daemon is running
if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then
echo "Docker is not running on this machine!" echo "Docker is not running on this machine!"
exit exit 1
fi fi
# Make sure k8s version env is properly set # Make sure k8s version env is properly set
if [ -z ${K8S_VERSION} ]; then if [ -z ${K8S_VERSION} ]; then
echo "Please export K8S_VERSION in your env" echo "Please export K8S_VERSION in your env"
exit exit 1
else else
echo "k8s version is set to: ${K8S_VERSION}" echo "k8s version is set to: ${K8S_VERSION}"
fi fi
@ -43,7 +43,7 @@ fi
# Make sure master ip is properly set # Make sure master ip is properly set
if [ -z ${MASTER_IP} ]; then if [ -z ${MASTER_IP} ]; then
echo "Please export MASTER_IP in your env" echo "Please export MASTER_IP in your env"
exit exit 1
else else
echo "k8s master is set to: ${MASTER_IP}" echo "k8s master is set to: ${MASTER_IP}"
fi fi
@ -61,10 +61,7 @@ detect_lsb() {
*64) *64)
;; ;;
*) *)
cat >&2 <<-'EOF' echo "Error: We currently only support 64-bit platforms."
Error: you are not using a 64-bit platform.
We currently only support 64-bit platforms.
EOF
exit 1 exit 1
;; ;;
esac esac