Skip to content

Instantly share code, notes, and snippets.

@grrywlsn
Created September 29, 2016 16:24
Show Gist options
  • Save grrywlsn/64a88b64e5a4905aa26fb0f942842c41 to your computer and use it in GitHub Desktop.
Save grrywlsn/64a88b64e5a4905aa26fb0f942842c41 to your computer and use it in GitHub Desktop.
AWS user-data cloud-config for autoscaling etcd2 masters
coreos:
flannel:
interface: $private_ipv4
etcd_endpoints: http://127.0.0.1:2379
etcd2:
advertise-client-urls: http://$private_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379
listen-peer-urls: http://$private_ipv4:2380
units:
- name: etcd2-peers.service
command: start
content: |
[Unit]
Description=Set etcd2 peers
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/mkdir -p /etc/sysconfig
ExecStart=/usr/bin/rkt --insecure-options=image run --dns 8.8.8.8 --net=host --volume data,kind=host,source=/etc/sysconfig/ --mount volume=data,target=/etc/sysconfig/ docker://monsantoco/etcd-aws-cluster
- name: etcd2.service
command: start
drop-ins:
- name: 30-etcd_peers.conf
content: |
[Unit]
After=etcd2-peers.service
Requires=etcd2-peers.service
[Service]
EnvironmentFile=/etc/sysconfig/etcd-peers
@grrywlsn
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment