Created
September 29, 2016 16:24
-
-
Save grrywlsn/64a88b64e5a4905aa26fb0f942842c41 to your computer and use it in GitHub Desktop.
AWS user-data cloud-config for autoscaling etcd2 masters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More about this here: https://metabroadcast.com/blog/getting-etcd2-to-play-nicely