Merge pull request #5455 from AntonioMeireles/use_native_coreos_flannel

use natively packaged flannel in CoreOS' cloud-configs
This commit is contained in:
Brendan Burns 2015-03-17 07:31:09 -07:00
commit 3462f68d49
5 changed files with 98 additions and 89 deletions

View File

@ -60,32 +60,28 @@ coreos:
Wants=etcd.service Wants=etcd.service
After=etcd.service After=etcd.service
After=network-online.target After=network-online.target
Before=flannel.service Before=flanneld.service
[Service] [Service]
ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh
ExecStart=/usr/bin/bash /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh
RemainAfterExit=true RemainAfterExit=true
Type=oneshot Type=oneshot
- name: flannel.service - name: flanneld.service
command: start command: start
content: | drop-ins:
[Unit] - name: 50-network-config.conf
Wants=etcd-waiter.service content: |
After=etcd-waiter.service [Service]
Requires=etcd.service ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
After=etcd.service ExecStart=
After=network-online.target ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \
Wants=network-online.target /usr/bin/docker run --net=host --privileged=true --rm \
Description=flannel is an etcd backed overlay network for containers --volume=/run/flannel:/run/flannel \
--env=NOTIFY_SOCKET=/run/flannel/sd.sock \
[Service] --env-file=/run/flannel/options.env \
Type=notify --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \
ExecStartPre=-/usr/bin/mkdir -p /opt/bin quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
ExecStart=/opt/bin/flanneld
- name: docker-cache.service - name: docker-cache.service
command: start command: start
content: | content: |
@ -115,8 +111,10 @@ coreos:
- name: 51-docker-mirror.conf - name: 51-docker-mirror.conf
content: | content: |
[Unit] [Unit]
Requires=docker-cache.service # making sure that docker-cache is up and that flanneld finished
After=docker-cache.service # startup, otherwise containers won't land in flannel's network...
Requires=docker-cache.service flanneld.service
After=docker-cache.service flanneld.service
[Service] [Service]
Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000'
- name: kube-apiserver.service - name: kube-apiserver.service

View File

@ -9,25 +9,34 @@ coreos:
mask: true mask: true
- name: fleet.service - name: fleet.service
command: start command: start
- name: flannel.service - name: flanneld.service
command: start command: start
content: | drop-ins:
[Unit] - name: 50-network-config.conf
After=network-online.target content: |
Wants=network-online.target [Service]
Description=flannel is an etcd backed overlay network for containers ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
# as we need to turn eth1 as the default interface
[Service] # https://github.com/coreos/bugs/issues/228 is sorted
Type=notify # see notes in https://github.com/coreos/flannel/pull/137
ExecStartPre=-/usr/bin/mkdir -p /opt/bin ExecStart=
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld /usr/bin/docker run --net=host --privileged=true --rm \
ExecStart=/opt/bin/flanneld -etcd-endpoints http://<master-private-ip>:4001 --volume=/run/flannel:/run/flannel \
--env=NOTIFY_SOCKET=/run/flannel/sd.sock \
--env-file=/run/flannel/options.env \
--volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \
quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld -etcd-endpoints http://<master-private-ip>:4001 --ip-masq=true --iface=eth1
- name: docker.service - name: docker.service
command: start command: start
drop-ins: drop-ins:
- name: 51-docker-mirror.conf - name: 51-docker-mirror.conf
content: | content: |
[Unit]
# making sure that flanneld finished startup, otherwise containers
# won't land in flannel's network...
Requires=flanneld.service
After=flanneld.service
[Service] [Service]
Environment=DOCKER_OPTS='--registry-mirror=http://<master-private-ip>:5000' Environment=DOCKER_OPTS='--registry-mirror=http://<master-private-ip>:5000'
- name: setup-network-environment.service - name: setup-network-environment.service

View File

@ -62,32 +62,28 @@ coreos:
Wants=etcd.service Wants=etcd.service
After=etcd.service After=etcd.service
After=network-online.target After=network-online.target
Before=flannel.service Before=flanneld.service
[Service] [Service]
ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh
ExecStart=/usr/bin/bash /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh
RemainAfterExit=true RemainAfterExit=true
Type=oneshot Type=oneshot
- name: flannel.service - name: flanneld.service
command: start command: start
content: | drop-ins:
[Unit] - name: 50-network-config.conf
Wants=etcd-waiter.service content: |
After=etcd-waiter.service [Service]
Requires=etcd.service ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
After=etcd.service ExecStart=
After=network-online.target ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \
Wants=network-online.target /usr/bin/docker run --net=host --privileged=true --rm \
Description=flannel is an etcd backed overlay network for containers --volume=/run/flannel:/run/flannel \
--env=NOTIFY_SOCKET=/run/flannel/sd.sock \
[Service] --env-file=/run/flannel/options.env \
Type=notify --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \
ExecStartPre=-/usr/bin/mkdir -p /opt/bin quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
ExecStart=/opt/bin/flanneld
- name: docker-cache.service - name: docker-cache.service
command: start command: start
content: | content: |
@ -117,8 +113,10 @@ coreos:
- name: 51-docker-mirror.conf - name: 51-docker-mirror.conf
content: | content: |
[Unit] [Unit]
Requires=docker-cache.service # making sure that docker-cache is up and that flanneld finished
After=docker-cache.service # startup, otherwise containers won't land in flannel's network...
Requires=docker-cache.service flanneld.service
After=docker-cache.service flanneld.service
[Service] [Service]
Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000'
- name: kube-apiserver.service - name: kube-apiserver.service

View File

@ -9,25 +9,31 @@ coreos:
mask: true mask: true
- name: fleet.service - name: fleet.service
command: start command: start
- name: flannel.service - name: flanneld.service
command: start command: start
content: | drop-ins:
[Unit] - name: 50-network-config.conf
After=network-online.target content: |
Wants=network-online.target [Service]
Description=flannel is an etcd backed overlay network for containers ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
ExecStart=
[Service] ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \
Type=notify /usr/bin/docker run --net=host --privileged=true --rm \
ExecStartPre=-/usr/bin/mkdir -p /opt/bin --volume=/run/flannel:/run/flannel \
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld --env=NOTIFY_SOCKET=/run/flannel/sd.sock \
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld --env-file=/run/flannel/options.env \
ExecStart=/opt/bin/flanneld -etcd-endpoints http://<master-private-ip>:4001 --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \
quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld -etcd-endpoints http://<master-private-ip>:4001 --ip-masq=true --iface=eth1
- name: docker.service - name: docker.service
command: start command: start
drop-ins: drop-ins:
- name: 51-docker-mirror.conf - name: 51-docker-mirror.conf
content: | content: |
[Unit]
# making sure that flanneld finished startup, otherwise containers
# won't land in flannel's network...
Requires=flanneld.service
After=flanneld.service
[Service] [Service]
Environment=DOCKER_OPTS='--registry-mirror=http://<master-private-ip>:5000' Environment=DOCKER_OPTS='--registry-mirror=http://<master-private-ip>:5000'
- name: setup-network-environment.service - name: setup-network-environment.service

View File

@ -23,32 +23,28 @@ coreos:
Wants=etcd.service Wants=etcd.service
After=etcd.service After=etcd.service
After=network-online.target After=network-online.target
Before=flannel.service Before=flanneld.service
[Service] [Service]
ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh
ExecStart=/usr/bin/bash /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh
RemainAfterExit=true RemainAfterExit=true
Type=oneshot Type=oneshot
- name: flannel.service - name: flanneld.service
command: start command: start
content: | drop-ins:
[Unit] - name: 50-network-config.conf
Wants=etcd-waiter.service content: |
After=etcd-waiter.service [Service]
Requires=etcd.service ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
After=etcd.service ExecStart=
After=network-online.target ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \
Wants=network-online.target /usr/bin/docker run --net=host --privileged=true --rm \
Description=flannel is an etcd backed overlay network for containers --volume=/run/flannel:/run/flannel \
--env=NOTIFY_SOCKET=/run/flannel/sd.sock \
[Service] --env-file=/run/flannel/options.env \
Type=notify --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \
ExecStartPre=-/usr/bin/mkdir -p /opt/bin quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
ExecStart=/opt/bin/flanneld
- name: docker-cache.service - name: docker-cache.service
command: start command: start
content: | content: |
@ -79,8 +75,10 @@ coreos:
- name: 51-docker-mirror.conf - name: 51-docker-mirror.conf
content: | content: |
[Unit] [Unit]
Requires=docker-cache.service # making sure that docker-cache is up and that flanneld finished
After=docker-cache.service # startup, otherwise containers won't land in flannel's network...
Requires=docker-cache.service flanneld.service
After=docker-cache.service flanneld.service
[Service] [Service]
Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000'
- name: kube-apiserver.service - name: kube-apiserver.service