Skip to content

Instantly share code, notes, and snippets.

Last active Jul 28, 2016
What would you like to do?
Vagrant provision script and Upstart service files to install and run flanneld
description "flanneld Service"
author "Matthew Mihok"
env FLANNELD_HOME=/opt/flanneld-0.5.5
env LOG_HOME=/var/log/flannel
# Make sure network and fs is up, and start in runlevels 2-5
start on (net-device-up
and local-filesystems
and runlevel [2345])
# Stop in runlevels 0,1 and 6
stop on runlevel [016]
# automatically respawn, but if its respwaning too fast (5 times in 60 seconds, don't do that)
respawn limit 5 60
# make sure node is there, the code directory is there
pre-start script
test -x $FLANNELD_HOME/flanneld || { stop; exit 0; }
end script
# cd to code path and run node, with the right switches
export FLANNELD_IFACE="eth1"
export FLANNELD_ETCD_PREFIX="/network"
exec flanneld >> $LOG_HOME/flanneld.log 2>&1
end script
"Network": "",
"SubnetLen": 24,
"SubnetMin": "",
"SubnetMax": "",
"Backend": {
"Type": "udp"
set -x;
# Flannel
cd /opt/
# Download the release
curl -L -o flanneld-0.5.5.tar.gz
# Create the directory the binaries will live in
mkdir /opt/flanneld-0.5.5
# Extract the contents of the release
tar -zxvf flanneld-0.5.5.tar.gz -C flanneld-0.5.5 --strip-components=1
# Make symlinks so we can access the binaries
ln -s /opt/flanneld-0.5.5/flanneld /usr/local/bin/flanneld
# Copy our Upstart script
cp /vagrant/flanneld.conf /etc/init/flanneld.conf
# Create flannel's logging directory
mkdir /var/log/flannel
chown vagrant:vagrant /var/log/flannel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment