Skip to content

Commit

Permalink
updates to userdata for newer etcd version
Browse files Browse the repository at this point in the history
  • Loading branch information
paulczar committed Nov 8, 2015
1 parent 8dde715 commit a561b5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 67 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.vagrant
user-data
registry/images
registry/repositories
registry/docker
registry/*.tgz
7 changes: 4 additions & 3 deletions factorish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ factorish:
channel: beta
min_version: 554
flannel:
enabled: True
enabled: False
network: 10.1.0.0/16
applications:
applications:
registry:
repository: registry
repository: registry:2
docker_options:
- '-p 5000:5000'
- '-e GUNICORN_OPTS=[--preload]'
- '-e search_backend='
- '-v /home/core/share/registry:/tmp/registry'
- '-v /home/core/share/registry:/var/lib/registry'
command:
registrator:
repository: progrium/registrator
Expand Down
72 changes: 10 additions & 62 deletions user-data.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,20 @@
coreos:
update:
reboot-strategy: off
etcd:
#generate a new token for each unique cluster from https://discovery.etcd.io/new
<%= @etcd_discovery %>
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
etcd2:
#generate a new token for each unique cluster from https://discovery.etcd.io/new
<%= @etcd_discovery %>
advertise-client-urls: http://$public_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
fleet:
public-ip: $public_ipv4
units:
<% if @flannel %>
- name: etcd.service
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: flannel.service
command: start
content: |
[Unit]
After=network-online.target
Wants=network-online.target
After=etcd.service
Wants=etcd.service
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 http://storage.googleapis.com/k8s/flanneld
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "<%= @flannel_network %>" }'
ExecStart=/opt/bin/flanneld -etcd-endpoints http://127.0.0.1:4001 -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} -s=overlay -H fd:// $DOCKER_OPTS

[Install]
WantedBy=multi-user.target
- name: setup-network-environment.service
command: start
content: |
[Unit]
Description=Setup Network Environment
Documentation=https://github.com/kelseyhightower/setup-network-environment
Requires=network-online.target
After=network-online.target

[Service]
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/k8s/setup-network-environment
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
ExecStart=/opt/bin/setup-network-environment
RemainAfterExit=yes
Type=oneshot
<% else %>
- name: etcd.service
command: start
- name: fleet.service
command: start
<% end %>
<% @applications.each do |name,app| %>
- name: factorish-<%= name %>.service
command: start
Expand Down

0 comments on commit a561b5b

Please sign in to comment.