mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Update etcd to 2.2.1
This commit is contained in:
parent
f64780d6eb
commit
993c1ee222
@ -35,8 +35,8 @@ RUN rm -rf /var/lib/apt/lists/
|
||||
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y rsync
|
||||
|
||||
# Download and symlink etcd. We need this for our integration tests.
|
||||
ENV ETCD_VERSION v2.0.12
|
||||
RUN mkdir -p /usr/local/src/etcd &&\
|
||||
RUN export ETCD_VERSION=v2.2.1; \
|
||||
mkdir -p /usr/local/src/etcd &&\
|
||||
cd /usr/local/src/etcd &&\
|
||||
curl -fsSLO https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz &&\
|
||||
tar xzf etcd-$ETCD_VERSION-linux-amd64.tar.gz &&\
|
||||
|
@ -23,7 +23,7 @@ RELEASES_DIR=${RELEASES_DIR:-/tmp/downloads}
|
||||
FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.3"}
|
||||
|
||||
# Define etcd version to use.
|
||||
ETCD_VERSION=${ETCD_VERSION:-"2.0.12"}
|
||||
ETCD_VERSION=${ETCD_VERSION:-"2.2.1"}
|
||||
|
||||
# Define k8s version to use.
|
||||
K8S_VERSION=${K8S_VERSION:-"1.0.4"}
|
||||
|
4
cluster/images/etcd/.gitignore
vendored
Normal file
4
cluster/images/etcd/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
etcd
|
||||
etcdctl
|
||||
etcd-*-linux-amd64.tar.gz
|
||||
etcd-*-linux-amd64/
|
@ -5,7 +5,7 @@ ambassador:
|
||||
command: "-name docker_apiserver_1"
|
||||
etcd:
|
||||
hostname: etcd
|
||||
image: quay.io/coreos/etcd:v2.0.12
|
||||
image: quay.io/coreos/etcd:v2.2.1
|
||||
ports: [ "4001:4001" ]
|
||||
command: >
|
||||
--listen-client-urls 'http://etcd:4001'
|
||||
|
@ -20,7 +20,7 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
ETCD_VERSION=${ETCD_VERSION:-v2.0.12}
|
||||
ETCD_VERSION=${ETCD_VERSION:-v2.2.1}
|
||||
|
||||
full_name=etcd-${ETCD_VERSION}-linux-amd64
|
||||
archive_url=https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/${full_name}.tar.gz
|
||||
|
@ -10,7 +10,7 @@
|
||||
"containers":[
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"image": "gcr.io/google_containers/etcd:2.0.12",
|
||||
"image": "gcr.io/google_containers/etcd:2.2.1",
|
||||
"resources": {
|
||||
"limits": {
|
||||
"cpu": {{ cpulimit }}
|
||||
|
@ -43,7 +43,7 @@ cp flannel-${FLANNEL_VERSION}/flanneld binaries/master
|
||||
cp flannel-${FLANNEL_VERSION}/flanneld binaries/minion
|
||||
|
||||
# ectd
|
||||
ETCD_VERSION=${ETCD_VERSION:-"2.0.12"}
|
||||
ETCD_VERSION=${ETCD_VERSION:-"2.2.1"}
|
||||
ETCD="etcd-v${ETCD_VERSION}-linux-amd64"
|
||||
echo "Prepare etcd ${ETCD_VERSION} release ..."
|
||||
if [ ! -f etcd.tar.gz ] ; then
|
||||
|
@ -33,7 +33,7 @@ Documentation for other releases can be found at
|
||||
|
||||
# etcd
|
||||
|
||||
[etcd](https://coreos.com/etcd/docs/2.0.12/) is a highly-available key value
|
||||
[etcd](https://coreos.com/etcd/docs/2.2.1/) is a highly-available key value
|
||||
store which Kubernetes uses for persistent storage of all of its REST API
|
||||
objects.
|
||||
|
||||
@ -49,7 +49,7 @@ Data Reliability: for reasonable safety, either etcd needs to be run as a
|
||||
etcd) or etcd's data directory should be located on durable storage (e.g., GCE's
|
||||
persistent disk). In either case, if high availability is required--as it might
|
||||
be in a production cluster--the data directory ought to be [backed up
|
||||
periodically](https://coreos.com/etcd/docs/2.0.12/admin_guide.html#disaster-recovery),
|
||||
periodically](https://coreos.com/etcd/docs/2.2.1/admin_guide.html#disaster-recovery),
|
||||
to reduce downtime in case of corruption.
|
||||
|
||||
## Default configuration
|
||||
|
@ -68,13 +68,13 @@ across reboots and failures.
|
||||
Run:
|
||||
|
||||
```sh
|
||||
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.0.12 /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 --addr=127.0.0.1:4001 --bind-addr=0.0.0.0: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:
|
||||
|
||||
```sh
|
||||
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.0.12 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'
|
||||
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.2.1 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'
|
||||
```
|
||||
|
||||
|
||||
|
@ -98,11 +98,11 @@ DOCKER_CONF=""
|
||||
|
||||
start_k8s(){
|
||||
# Start etcd
|
||||
docker -H unix:///var/run/docker-bootstrap.sock run --restart=always --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
|
||||
docker -H unix:///var/run/docker-bootstrap.sock run --restart=always --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
|
||||
|
||||
sleep 5
|
||||
# Set flannel net config
|
||||
docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.0.12 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16", "Backend": {"Type": "vxlan"}}'
|
||||
docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.2.1 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16", "Backend": {"Type": "vxlan"}}'
|
||||
|
||||
# iface may change to a private network interface, eth0 is for default
|
||||
flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run --restart=always -d --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.3 /opt/bin/flanneld -iface="eth0")
|
||||
|
@ -86,7 +86,7 @@ parameters as follows:
|
||||
### Step One: Run etcd
|
||||
|
||||
```sh
|
||||
docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /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 --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
|
||||
```
|
||||
|
||||
### Step Two: Run the master
|
||||
|
@ -107,7 +107,7 @@ Start etcd and verify that it is running:
|
||||
|
||||
```bash
|
||||
sudo docker run -d --hostname $(uname -n) --name etcd \
|
||||
-p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.0.12 \
|
||||
-p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.2.1 \
|
||||
--listen-client-urls http://0.0.0.0:4001 \
|
||||
--advertise-client-urls http://${KUBERNETES_MASTER_IP}:4001
|
||||
```
|
||||
@ -115,7 +115,7 @@ sudo docker run -d --hostname $(uname -n) --name etcd \
|
||||
```console
|
||||
$ sudo docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
fd7bac9e2301 quay.io/coreos/etcd:v2.0.12 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd
|
||||
fd7bac9e2301 quay.io/coreos/etcd:v2.2.1 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd
|
||||
```
|
||||
|
||||
It's also a good idea to ensure your etcd instance is reachable by testing it
|
||||
|
@ -237,8 +237,8 @@ You have several choices for Kubernetes images:
|
||||
command like `docker images`
|
||||
|
||||
For etcd, you can:
|
||||
- Use images hosted on Google Container Registry (GCR), such as `gcr.io/google_containers/etcd:2.0.12`
|
||||
- Use images hosted on [Docker Hub](https://hub.docker.com/search/?q=etcd) or [Quay.io](https://quay.io/repository/coreos/etcd), such as `quay.io/coreos/etcd:v2.2.0`
|
||||
- Use images hosted on Google Container Registry (GCR), such as `gcr.io/google_containers/etcd:2.2.1`
|
||||
- Use images hosted on [Docker Hub](https://hub.docker.com/search/?q=etcd) or [Quay.io](https://quay.io/repository/coreos/etcd), such as `quay.io/coreos/etcd:v2.2.1`
|
||||
- Use etcd binary included in your OS distro.
|
||||
- Build your own image
|
||||
- You can do: `cd kubernetes/cluster/images/etcd; make`
|
||||
|
@ -60,7 +60,7 @@ work, which has been merge into this document.
|
||||
Internet to download the necessary files, while worker nodes do not.
|
||||
3. These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it can not work with
|
||||
Ubuntu 15 which uses systemd instead of upstart.
|
||||
4. Dependencies of this guide: etcd-2.0.12, flannel-0.5.3, k8s-1.0.6, may work with higher versions.
|
||||
4. Dependencies of this guide: etcd-2.2.1, flannel-0.5.3, k8s-1.0.6, may work with higher versions.
|
||||
5. All the remote servers can be ssh logged in without a password by using key authentication.
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ $ git clone https://github.com/kubernetes/kubernetes.git
|
||||
#### Configure and start the Kubernetes cluster
|
||||
|
||||
The startup process will first download all the required binaries automatically.
|
||||
By default etcd version is 2.0.12, flannel version is 0.5.3 and k8s version is 1.0.6.
|
||||
By default etcd version is 2.2.1, flannel version is 0.5.3 and k8s version is 1.0.6.
|
||||
You can customize your etcd version, flannel version, k8s version by changing corresponding variables
|
||||
`ETCD_VERSION` , `FLANNEL_VERSION` and `KUBE_VERSION` like following.
|
||||
|
||||
|
@ -20,7 +20,7 @@ set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
ETCD_VERSION=${ETCD_VERSION:-v2.0.12}
|
||||
ETCD_VERSION=${ETCD_VERSION:-v2.2.1}
|
||||
|
||||
cd "${KUBE_ROOT}/third_party"
|
||||
curl -fsSL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \
|
||||
|
@ -19,14 +19,14 @@
|
||||
EVENT_STORE_IP=$1
|
||||
EVENT_STORE_URL="http://${EVENT_STORE_IP}:4002"
|
||||
if [ "${EVENT_STORE_IP}" == "127.0.0.1" ]; then
|
||||
sudo docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd \
|
||||
sudo docker run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd \
|
||||
--listen-peer-urls http://127.0.0.1:2381 \
|
||||
--addr=127.0.0.1:4002 \
|
||||
--bind-addr=0.0.0.0:4002 \
|
||||
--data-dir=/var/etcd/data
|
||||
fi
|
||||
|
||||
sudo docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd \
|
||||
sudo docker run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd \
|
||||
--listen-peer-urls http://127.0.0.1:2380 \
|
||||
--addr=127.0.0.1:4001 \
|
||||
--bind-addr=0.0.0.0:4001 \
|
||||
|
Loading…
Reference in New Issue
Block a user