Skip to content

Instantly share code, notes, and snippets.

@smothiki
Created April 15, 2015 18:31
Show Gist options
  • Save smothiki/8815549b6453d427aafd to your computer and use it in GitHub Desktop.
Save smothiki/8815549b6453d427aafd to your computer and use it in GitHub Desktop.
#cloud-config
---
ssh_authorized_keys:
- <%= ssh_public_key %>
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
# uncomment the following line and replace it with your discovery URL
discovery: <%= discovery_url %>
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
# give etcd more time if it's under heavy load - prevent leader election thrashing
peer-election-timeout: 2000
# heartbeat interval should ideally be 1/4 or 1/5 of peer election timeout
peer-heartbeat-interval: 500
fleet:
# We have to set the public_ip here so this works on Vagrant -- otherwise, Vagrant VMs
# will all publish the same private IP. This is harmless for cloud providers.
public-ip: $private_ipv4
# allow etcd to slow down at times
etcd_request_timeout: 3.0
metadata: "role=minion"
units:
- command: start
content: '[Unit]
Description=Install deisctl utility
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c ''curl -sSL --retry 5 --retry-delay 2 http://deis.io/deisctl/install.sh
| sh -s 1.5.0''
'
name: install-deisctl.service
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: stop-update-engine.service
command: start
content: |
[Unit]
Description=stop update-engine
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl stop update-engine.service
ExecStartPost=/usr/bin/systemctl mask update-engine.service
- name: flannel.service
command: start
content: |
[Unit]
Requires=etcd.service
After=etcd.service
After=network-online.target
Wants=network-online.target
Description=flannel is an etcd backed overlay network for containers
[Service]
Type=notify
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
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 --iface=eth1
- name: docker.service
command: start
content: |
[Unit]
After=flannel.service
Wants=flannel.service
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
EnvironmentFile=/run/flannel/subnet.env
ExecStartPre=/bin/mount --make-rprivate /
ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} --insecure-registry 10.0.0.0/8 --insecure-registry 172.16.0.0/12 --insecure-registry 192.168.0.0/16 --insecure-registry 100.64.0.0/10 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment