Switch to etcd 2

This commit is contained in:
Lénaïc Huard
2015-04-23 18:22:00 +02:00
parent d2284fee88
commit 35452538f4
4 changed files with 15 additions and 15 deletions

View File

@@ -14,13 +14,12 @@ write_files:
RuntimeMaxUse=50M RuntimeMaxUse=50M
coreos: coreos:
etcd: etcd2:
name: ${name}
addr: ${public_ip}:4001
bind-addr: 0.0.0.0
peer-addr: ${public_ip}:7001
# peers: {etcd_peers}
discovery: ${discovery} discovery: ${discovery}
advertise-client-urls: http://${public_ip}:2379
initial-advertise-peer-urls: http://${public_ip}:2380
listen-client-urls: http://0.0.0.0:2379
listen-peer-urls: http://${public_ip}:2380
units: units:
- name: static.network - name: static.network
command: start command: start
@@ -69,7 +68,7 @@ coreos:
ExecStart=/usr/sbin/iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE ! -d ${CONTAINER_SUBNET} ExecStart=/usr/sbin/iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE ! -d ${CONTAINER_SUBNET}
RemainAfterExit=yes RemainAfterExit=yes
Type=oneshot Type=oneshot
- name: etcd.service - name: etcd2.service
command: start command: start
- name: docker.service - name: docker.service
command: start command: start

View File

@@ -6,17 +6,17 @@ coreos:
command: start command: start
content: | content: |
[Unit] [Unit]
After=opt-kubernetes.mount etcd.service After=opt-kubernetes.mount etcd2.service
ConditionFileIsExecutable=/opt/kubernetes/bin/kube-apiserver ConditionFileIsExecutable=/opt/kubernetes/bin/kube-apiserver
Description=Kubernetes API Server Description=Kubernetes API Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=opt-kubernetes.mount etcd.service Requires=opt-kubernetes.mount etcd2.service
[Service] [Service]
ExecStart=/opt/kubernetes/bin/kube-apiserver \ ExecStart=/opt/kubernetes/bin/kube-apiserver \
--address=0.0.0.0 \ --address=0.0.0.0 \
--port=8080 \ --port=8080 \
--etcd-servers=http://127.0.0.1:4001 \ --etcd-servers=http://127.0.0.1:2379 \
--kubelet-port=10250 \ --kubelet-port=10250 \
--service-cluster-ip-range=${SERVICE_CLUSTER_IP_RANGE} --service-cluster-ip-range=${SERVICE_CLUSTER_IP_RANGE}
Restart=always Restart=always

View File

@@ -6,11 +6,11 @@ coreos:
command: start command: start
content: | content: |
[Unit] [Unit]
After=opt-kubernetes.mount etcd.service docker.socket After=opt-kubernetes.mount docker.socket
ConditionFileIsExecutable=/opt/kubernetes/bin/kubelet ConditionFileIsExecutable=/opt/kubernetes/bin/kubelet
Description=Kubernetes Kubelet Description=Kubernetes Kubelet
Documentation=https://github.com/GoogleCloudPlatform/kubernetes Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=opt-kubernetes.mount etcd.service docker.socket Requires=opt-kubernetes.mount docker.socket
[Service] [Service]
ExecStart=/opt/kubernetes/bin/kubelet \ ExecStart=/opt/kubernetes/bin/kubelet \
@@ -29,11 +29,11 @@ coreos:
command: start command: start
content: | content: |
[Unit] [Unit]
After=opt-kubernetes.mount etcd.service After=opt-kubernetes.mount
ConditionFileIsExecutable=/opt/kubernetes/bin/kube-proxy ConditionFileIsExecutable=/opt/kubernetes/bin/kube-proxy
Description=Kubernetes Proxy Description=Kubernetes Proxy
Documentation=https://github.com/GoogleCloudPlatform/kubernetes Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=opt-kubernetes.mount etcd.service Requires=opt-kubernetes.mount
[Service] [Service]
ExecStart=/opt/kubernetes/bin/kube-proxy \ ExecStart=/opt/kubernetes/bin/kube-proxy \

View File

@@ -183,12 +183,13 @@ function wait-cluster-readiness {
function kube-up { function kube-up {
detect-master detect-master
detect-minions detect-minions
get-kubeconfig-bearertoken
initialize-pool keep_base_image initialize-pool keep_base_image
initialize-network initialize-network
readonly ssh_keys="$(cat ~/.ssh/id_*.pub | sed 's/^/ - /')" readonly ssh_keys="$(cat ~/.ssh/id_*.pub | sed 's/^/ - /')"
readonly kubernetes_dir="$POOL_PATH/kubernetes" readonly kubernetes_dir="$POOL_PATH/kubernetes"
readonly discovery=$(curl -s https://discovery.etcd.io/new) readonly discovery=$(curl -s https://discovery.etcd.io/new?size=$(($NUM_MINIONS+1)))
readonly machines=$(join , "${KUBE_MINION_IP_ADDRESSES[@]}") readonly machines=$(join , "${KUBE_MINION_IP_ADDRESSES[@]}")