Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #58 from gianrubio/etcdctl
Browse files Browse the repository at this point in the history
Easily manage etcd cluster with env vars
  • Loading branch information
mumoshu authored Nov 17, 2016
2 parents 7237203 + a47d7d6 commit 7ea5f6b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions config/templates/cloud-config-etcd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ coreos:
Environment=ETCD_LISTEN_PEER_URLS=https://%H:2380
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=https://%H:2380
PermissionsStartOnly=true
ExecStartPre=/usr/bin/bash -c "sed -i \"s/^ETCDCTL_ENDPOINT.*$/ETCDCTL_ENDPOINT=https:\/\/$(hostname):2379/\" /etc/environment"
ExecStartPre=/usr/bin/chown -R etcd:etcd /var/lib/etcd2
enable: true
command: start
Expand Down Expand Up @@ -86,6 +87,17 @@ coreos:


write_files:

- path: /etc/environment
permissions: 0644
content: |
COREOS_PUBLIC_IPV4=$public_ipv4
COREOS_PRIVATE_IPV4=$private_ipv4
ETCDCTL_CA_FILE=/etc/etcd2/ssl/ca.pem
ETCDCTL_CERT_FILE=/etc/etcd2/ssl/etcd-client.pem
ETCDCTL_KEY_FILE=/etc/etcd2/ssl/etcd-client-key.pem
ETCDCTL_ENDPOINT=

- path: /opt/bin/ext4-format-volume-once
permissions: 0700
owner: root:root
Expand Down Expand Up @@ -120,3 +132,11 @@ write_files:
- path: /etc/etcd2/ssl/etcd.pem.enc
encoding: gzip+base64
content: {{.TLSConfig.EtcdCert}}

- path: /etc/etcd2/ssl/etcd-client.pem.enc
encoding: gzip+base64
content: {{.TLSConfig.EtcdClientCert}}

- path: /etc/etcd2/ssl/etcd-client-key.pem.enc
encoding: gzip+base64
content: {{.TLSConfig.EtcdClientKey}}

0 comments on commit 7ea5f6b

Please sign in to comment.