mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Update docker and docker-multinode docs on master to require 1.2.x and use the hyperkube-arch image
This commit is contained in:
		@@ -74,7 +74,7 @@ it is still useful to use containers for deployment and management, so we create
 | 
				
			|||||||
You can specify the version on every node before install:
 | 
					You can specify the version on every node before install:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
export K8S_VERSION=<your_k8s_version (e.g. 1.1.3)>
 | 
					export K8S_VERSION=<your_k8s_version (e.g. 1.2.0-alpha.6)>
 | 
				
			||||||
export ETCD_VERSION=<your_etcd_version (e.g. 2.2.1)>
 | 
					export ETCD_VERSION=<your_etcd_version (e.g. 2.2.1)>
 | 
				
			||||||
export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
					export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
				
			||||||
export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
					export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,13 +36,13 @@ Documentation for other releases can be found at
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
We'll begin by setting up the master node.  For the purposes of illustration, we'll assume that the IP of this machine
 | 
					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
 | 
					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.1.3".
 | 
					to run is `${K8S_VERSION}`, which should hold a released version of Kubernetes >= "1.2.0-alpha.6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Enviroinment variables used:
 | 
					Enviroinment variables used:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
export MASTER_IP=<the_master_ip_here>
 | 
					export MASTER_IP=<the_master_ip_here>
 | 
				
			||||||
export K8S_VERSION=<your_k8s_version (e.g. 1.1.3)>
 | 
					export K8S_VERSION=<your_k8s_version (e.g. 1.2.0-alpha.6)>
 | 
				
			||||||
export ETCD_VERSION=<your_etcd_version (e.g. 2.2.1)>
 | 
					export ETCD_VERSION=<your_etcd_version (e.g. 2.2.1)>
 | 
				
			||||||
export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
					export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
				
			||||||
export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
					export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
				
			||||||
@@ -204,7 +204,7 @@ sudo docker run \
 | 
				
			|||||||
    --privileged=true \
 | 
					    --privileged=true \
 | 
				
			||||||
    --pid=host \
 | 
					    --pid=host \
 | 
				
			||||||
    -d \
 | 
					    -d \
 | 
				
			||||||
    gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					    gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
 | 
				
			||||||
    /hyperkube kubelet \
 | 
					    /hyperkube kubelet \
 | 
				
			||||||
        --allow-privileged=true \
 | 
					        --allow-privileged=true \
 | 
				
			||||||
        --api-servers=http://localhost:8080 \
 | 
					        --api-servers=http://localhost:8080 \
 | 
				
			||||||
@@ -225,8 +225,11 @@ sudo docker run \
 | 
				
			|||||||
At this point, you should have a functioning 1-node cluster.  Let's test it out!
 | 
					At this point, you should have a functioning 1-node cluster.  Let's test it out!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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.
 | 
					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.1.3/bin/darwin/amd64/kubectl))
 | 
					([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/amd64/kubectl))
 | 
				
			||||||
([linux](http://storage.googleapis.com/kubernetes-release/release/v1.1.3/bin/linux/amd64/kubectl))
 | 
					([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/386/kubectl))
 | 
				
			||||||
 | 
					([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/amd64/kubectl))
 | 
				
			||||||
 | 
					([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/386/kubectl))
 | 
				
			||||||
 | 
					([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/arm/kubectl))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For example, OS X:
 | 
					For example, OS X:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,10 +26,11 @@ if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Make sure k8s version env is properly set
 | 
					# Make sure k8s version env is properly set
 | 
				
			||||||
K8S_VERSION=${K8S_VERSION:-"1.1.3"}
 | 
					K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.6"}
 | 
				
			||||||
ETCD_VERSION=${ETCD_VERSION:-"2.2.1"}
 | 
					ETCD_VERSION=${ETCD_VERSION:-"2.2.1"}
 | 
				
			||||||
FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"}
 | 
					FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"}
 | 
				
			||||||
FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"}
 | 
					FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"}
 | 
				
			||||||
 | 
					ARCH=${ARCH:-"amd64"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Run as root
 | 
					# Run as root
 | 
				
			||||||
if [ "$(id -u)" != "0" ]; then
 | 
					if [ "$(id -u)" != "0" ]; then
 | 
				
			||||||
@@ -47,6 +48,7 @@ echo "ETCD_VERSION is set to: ${ETCD_VERSION}"
 | 
				
			|||||||
echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}"
 | 
					echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}"
 | 
				
			||||||
echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}"
 | 
					echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}"
 | 
				
			||||||
echo "MASTER_IP is set to: ${MASTER_IP}"
 | 
					echo "MASTER_IP is set to: ${MASTER_IP}"
 | 
				
			||||||
 | 
					echo "ARCH is set to: ${ARCH}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check if a command is valid
 | 
					# Check if a command is valid
 | 
				
			||||||
command_exists() {
 | 
					command_exists() {
 | 
				
			||||||
@@ -57,6 +59,7 @@ lsb_dist=""
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Detect the OS distro, we support ubuntu, debian, mint, centos, fedora dist
 | 
					# Detect the OS distro, we support ubuntu, debian, mint, centos, fedora dist
 | 
				
			||||||
detect_lsb() {
 | 
					detect_lsb() {
 | 
				
			||||||
 | 
					    # TODO: remove this when ARM support is fully merged
 | 
				
			||||||
    case "$(uname -m)" in
 | 
					    case "$(uname -m)" in
 | 
				
			||||||
        *64)
 | 
					        *64)
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
@@ -205,7 +208,7 @@ start_k8s(){
 | 
				
			|||||||
        -v /dev:/dev \
 | 
					        -v /dev:/dev \
 | 
				
			||||||
        -v /var/lib/docker/:/var/lib/docker:rw \
 | 
					        -v /var/lib/docker/:/var/lib/docker:rw \
 | 
				
			||||||
        -v /var/lib/kubelet/:/var/lib/kubelet:rw \
 | 
					        -v /var/lib/kubelet/:/var/lib/kubelet:rw \
 | 
				
			||||||
        gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					        gcr.io/google_containers/hyperkube-${ARCH}:v${K8S_VERSION} \
 | 
				
			||||||
        /hyperkube kubelet \
 | 
					        /hyperkube kubelet \
 | 
				
			||||||
            --address=0.0.0.0 \
 | 
					            --address=0.0.0.0 \
 | 
				
			||||||
            --allow-privileged=true \
 | 
					            --allow-privileged=true \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,13 +38,13 @@ 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.
 | 
					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.
 | 
					You need to repeat these instructions for each node you want to join the cluster.
 | 
				
			||||||
We will assume that 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
 | 
					We will assume that 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.1.3".
 | 
					to run is `${K8S_VERSION}`, which should hold a released version of Kubernetes >= "1.2.0-alpha.6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Enviroinment variables used:
 | 
					Enviroinment variables used:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
export MASTER_IP=<the_master_ip_here>
 | 
					export MASTER_IP=<the_master_ip_here>
 | 
				
			||||||
export K8S_VERSION=<your_k8s_version (e.g. 1.1.3)>
 | 
					export K8S_VERSION=<your_k8s_version (e.g. 1.2.0-alpha.6)>
 | 
				
			||||||
export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
					export FLANNEL_VERSION=<your_flannel_version (e.g. 0.5.5)>
 | 
				
			||||||
export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
					export FLANNEL_IFACE=<flannel_interface (defaults to eth0)>
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
@@ -174,7 +174,7 @@ sudo docker run \
 | 
				
			|||||||
    --privileged=true \
 | 
					    --privileged=true \
 | 
				
			||||||
    --pid=host \ 
 | 
					    --pid=host \ 
 | 
				
			||||||
    -d \
 | 
					    -d \
 | 
				
			||||||
    gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					    gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
 | 
				
			||||||
    /hyperkube kubelet \
 | 
					    /hyperkube kubelet \
 | 
				
			||||||
        --allow-privileged=true \
 | 
					        --allow-privileged=true \
 | 
				
			||||||
        --api-servers=http://${MASTER_IP}:8080 \
 | 
					        --api-servers=http://${MASTER_IP}:8080 \
 | 
				
			||||||
@@ -194,7 +194,7 @@ The service proxy provides load-balancing between groups of containers defined b
 | 
				
			|||||||
sudo docker run -d \
 | 
					sudo docker run -d \
 | 
				
			||||||
    --net=host \
 | 
					    --net=host \
 | 
				
			||||||
    --privileged \
 | 
					    --privileged \
 | 
				
			||||||
    gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					    gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
 | 
				
			||||||
    /hyperkube proxy \
 | 
					    /hyperkube proxy \
 | 
				
			||||||
        --master=http://${MASTER_IP}:8080 \
 | 
					        --master=http://${MASTER_IP}:8080 \
 | 
				
			||||||
        --v=2
 | 
					        --v=2
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,9 +26,10 @@ if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null  ); then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Make sure k8s version env is properly set
 | 
					# Make sure k8s version env is properly set
 | 
				
			||||||
K8S_VERSION=${K8S_VERSION:-"1.1.3"}
 | 
					K8S_VERSION=${K8S_VERSION:-"1.2.0-alpha.6"}
 | 
				
			||||||
FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"}
 | 
					FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"}
 | 
				
			||||||
FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"}
 | 
					FLANNEL_IFACE=${FLANNEL_IFACE:-"eth0"}
 | 
				
			||||||
 | 
					ARCH=${ARCH:-"amd64"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Run as root
 | 
					# Run as root
 | 
				
			||||||
if [ "$(id -u)" != "0" ]; then
 | 
					if [ "$(id -u)" != "0" ]; then
 | 
				
			||||||
@@ -46,6 +47,7 @@ echo "K8S_VERSION is set to: ${K8S_VERSION}"
 | 
				
			|||||||
echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}"
 | 
					echo "FLANNEL_VERSION is set to: ${FLANNEL_VERSION}"
 | 
				
			||||||
echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}"
 | 
					echo "FLANNEL_IFACE is set to: ${FLANNEL_IFACE}"
 | 
				
			||||||
echo "MASTER_IP is set to: ${MASTER_IP}"
 | 
					echo "MASTER_IP is set to: ${MASTER_IP}"
 | 
				
			||||||
 | 
					echo "ARCH is set to: ${ARCH}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check if a command is valid
 | 
					# Check if a command is valid
 | 
				
			||||||
command_exists() {
 | 
					command_exists() {
 | 
				
			||||||
@@ -126,7 +128,7 @@ start_k8s() {
 | 
				
			|||||||
            --etcd-endpoints=http://${MASTER_IP}:4001 \
 | 
					            --etcd-endpoints=http://${MASTER_IP}:4001 \
 | 
				
			||||||
            --iface="${FLANNEL_IFACE}")
 | 
					            --iface="${FLANNEL_IFACE}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sleep 8
 | 
					    sleep 10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Copy flannel env out and source it on the host
 | 
					    # Copy flannel env out and source it on the host
 | 
				
			||||||
    docker -H unix:///var/run/docker-bootstrap.sock \
 | 
					    docker -H unix:///var/run/docker-bootstrap.sock \
 | 
				
			||||||
@@ -150,7 +152,7 @@ start_k8s() {
 | 
				
			|||||||
            ifconfig docker0 down
 | 
					            ifconfig docker0 down
 | 
				
			||||||
            yum -y -q install bridge-utils && brctl delbr docker0 && service docker restart
 | 
					            yum -y -q install bridge-utils && brctl delbr docker0 && service docker restart
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        ubuntu|debian)
 | 
					        ubuntu|debian) # TODO: today ubuntu uses systemd. Handle that too
 | 
				
			||||||
            DOCKER_CONF="/etc/default/docker"
 | 
					            DOCKER_CONF="/etc/default/docker"
 | 
				
			||||||
            echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | tee -a ${DOCKER_CONF}
 | 
					            echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | tee -a ${DOCKER_CONF}
 | 
				
			||||||
            ifconfig docker0 down
 | 
					            ifconfig docker0 down
 | 
				
			||||||
@@ -186,7 +188,7 @@ start_k8s() {
 | 
				
			|||||||
        -v /dev:/dev \
 | 
					        -v /dev:/dev \
 | 
				
			||||||
        -v /var/lib/docker/:/var/lib/docker:rw \
 | 
					        -v /var/lib/docker/:/var/lib/docker:rw \
 | 
				
			||||||
        -v /var/lib/kubelet/:/var/lib/kubelet:rw \
 | 
					        -v /var/lib/kubelet/:/var/lib/kubelet:rw \
 | 
				
			||||||
        gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					        gcr.io/google_containers/hyperkube-${ARCH}:v${K8S_VERSION} \
 | 
				
			||||||
        /hyperkube kubelet \
 | 
					        /hyperkube kubelet \
 | 
				
			||||||
            --allow-privileged=true \
 | 
					            --allow-privileged=true \
 | 
				
			||||||
            --api-servers=http://${MASTER_IP}:8080 \
 | 
					            --api-servers=http://${MASTER_IP}:8080 \
 | 
				
			||||||
@@ -202,7 +204,7 @@ start_k8s() {
 | 
				
			|||||||
        --net=host \
 | 
					        --net=host \
 | 
				
			||||||
        --privileged \
 | 
					        --privileged \
 | 
				
			||||||
        --restart=always \
 | 
					        --restart=always \
 | 
				
			||||||
        gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					        gcr.io/google_containers/hyperkube-${ARCH}:v${K8S_VERSION} \
 | 
				
			||||||
        /hyperkube proxy \
 | 
					        /hyperkube proxy \
 | 
				
			||||||
            --master=http://${MASTER_IP}:8080 \
 | 
					            --master=http://${MASTER_IP}:8080 \
 | 
				
			||||||
            --v=2
 | 
					            --v=2
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ Here's a diagram of what the final result will look like:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
1. You need to have docker installed on one machine.
 | 
					1. You need to have docker installed on one machine.
 | 
				
			||||||
2. Decide what Kubernetes version to use.  Set the `${K8S_VERSION}` variable to
 | 
					2. Decide what Kubernetes version to use.  Set the `${K8S_VERSION}` variable to
 | 
				
			||||||
   a value such as "1.1.1".
 | 
					   a released version of Kubernetes >= "1.2.0-alpha.6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Run it
 | 
					### Run it
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -74,7 +74,7 @@ docker run \
 | 
				
			|||||||
    --pid=host \
 | 
					    --pid=host \
 | 
				
			||||||
    --privileged=true \
 | 
					    --privileged=true \
 | 
				
			||||||
    -d \
 | 
					    -d \
 | 
				
			||||||
    gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
 | 
					    gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
 | 
				
			||||||
    /hyperkube kubelet \
 | 
					    /hyperkube kubelet \
 | 
				
			||||||
        --containerized \
 | 
					        --containerized \
 | 
				
			||||||
        --hostname-override="127.0.0.1" \
 | 
					        --hostname-override="127.0.0.1" \
 | 
				
			||||||
@@ -96,8 +96,11 @@ 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
 | 
					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
 | 
					following links) and make it available by editing your PATH environment
 | 
				
			||||||
variable.
 | 
					variable.
 | 
				
			||||||
([OS X](http://storage.googleapis.com/kubernetes-release/release/v1.1.1/bin/darwin/amd64/kubectl))
 | 
					([OS X/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/amd64/kubectl))
 | 
				
			||||||
([linux](http://storage.googleapis.com/kubernetes-release/release/v1.1.1/bin/linux/amd64/kubectl))
 | 
					([OS X/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/darwin/386/kubectl))
 | 
				
			||||||
 | 
					([linux/amd64](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/amd64/kubectl))
 | 
				
			||||||
 | 
					([linux/386](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/386/kubectl))
 | 
				
			||||||
 | 
					([linux/arm](http://storage.googleapis.com/kubernetes-release/release/v1.2.0-alpha.6/bin/linux/arm/kubectl))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For example, OS X:
 | 
					For example, OS X:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user