mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #17422 from ZJU-SEL/upgrade-etcd-flag
Auto commit by PR queue bot
This commit is contained in:
		@@ -88,9 +88,10 @@ 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
 | 
					```console
 | 
				
			||||||
cd kubernetes/docs/getting-started-guides/docker-multinode/
 | 
					$ export MASTER_IP=<your_master_ip (e.g. 1.2.3.4)>
 | 
				
			||||||
./master.sh
 | 
					$ cd kubernetes/docs/getting-started-guides/docker-multinode/
 | 
				
			||||||
 | 
					$ ./master.sh
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`Master done!`
 | 
					`Master done!`
 | 
				
			||||||
@@ -103,10 +104,10 @@ Once your master is up and running you can add one or more workers on different
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Clone the Kubernetes repo, and run [worker.sh](docker-multinode/worker.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
 | 
					```console
 | 
				
			||||||
export MASTER_IP=<your_master_ip (e.g. 1.2.3.4)>
 | 
					$ export MASTER_IP=<your_master_ip (e.g. 1.2.3.4)>
 | 
				
			||||||
cd kubernetes/docs/getting-started-guides/docker-multinode/
 | 
					$ cd kubernetes/docs/getting-started-guides/docker-multinode/
 | 
				
			||||||
./worker.sh
 | 
					$ ./worker.sh
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`Worker done!`
 | 
					`Worker done!`
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ across reboots and failures.
 | 
				
			|||||||
Run:
 | 
					Run:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
 | 
					sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 --advertise-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 --data-dir=/var/etcd/data
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Next, you need to set a CIDR range for flannel.  This CIDR should be chosen to be non-overlapping with any existing network you are using:
 | 
					Next, you need to set a CIDR range for flannel.  This CIDR should be chosen to be non-overlapping with any existing network you are using:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,6 +39,14 @@ if [ "$(id -u)" != "0" ]; then
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Make sure master ip is properly set
 | 
				
			||||||
 | 
					if [ -z ${MASTER_IP} ]; then
 | 
				
			||||||
 | 
					    echo "Please export MASTER_IP in your env"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    echo "k8s master is set to: ${MASTER_IP}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check if a command is valid
 | 
					# Check if a command is valid
 | 
				
			||||||
command_exists() {
 | 
					command_exists() {
 | 
				
			||||||
    command -v "$@" > /dev/null 2>&1
 | 
					    command -v "$@" > /dev/null 2>&1
 | 
				
			||||||
@@ -112,8 +120,8 @@ start_k8s(){
 | 
				
			|||||||
    -d \
 | 
					    -d \
 | 
				
			||||||
    gcr.io/google_containers/etcd:2.2.1 \
 | 
					    gcr.io/google_containers/etcd:2.2.1 \
 | 
				
			||||||
    /usr/local/bin/etcd \
 | 
					    /usr/local/bin/etcd \
 | 
				
			||||||
    --addr=127.0.0.1:4001 \
 | 
					    --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 \
 | 
				
			||||||
    --bind-addr=0.0.0.0:4001 \
 | 
					    --advertise-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001
 | 
				
			||||||
    --data-dir=/var/etcd/data
 | 
					    --data-dir=/var/etcd/data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sleep 5
 | 
					    sleep 5
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,7 +89,7 @@ parameters as follows:
 | 
				
			|||||||
### Step One: Run etcd
 | 
					### Step One: Run etcd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```sh
 | 
					```sh
 | 
				
			||||||
docker run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
 | 
					docker run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --listen-client-urls=http://127.0.0.1:4001 --advertise-client-urls=http://127.0.0.1:4001 --data-dir=/var/etcd/data
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Step Two: Run the master
 | 
					### Step Two: Run the master
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user