use natively packaged flannel in CoreOS' cloud-configs

in the footsteps of #5254 merge earlier today and per @brendandburns comments
in the PR review thread...

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
This commit is contained in:
António Meireles 2015-03-13 19:40:25 +00:00
parent c04ceec27f
commit 07461f9a46
5 changed files with 76 additions and 83 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: |

View File

@ -9,20 +9,24 @@ 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:

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: |

View File

@ -9,20 +9,21 @@ 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:

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: |