[
  {
    "id": "etcd",
    "image": "$image_url_prefix/etcd?id=$image_id[etcd]",
    "args": [
      "-data-dir={{ .Volume \"/data\" }}",
      "-advertise-client-urls=http://{{ .ExternalIP }}:{{ .TCPPort 0 }}",
      "-listen-client-urls=http://0.0.0.0:{{ .TCPPort 0 }}",
      "-initial-advertise-peer-urls=http://{{ .ExternalIP }}:{{ .TCPPort 1 }}",
      "-listen-peer-urls=http://0.0.0.0:{{ .TCPPort 1 }}",
      "-name={{ .Env.ETCD_NAME }}",
      "-initial-cluster-state=new",
      "-initial-cluster={{ .Env.ETCD_NAME }}=http://{{ .ExternalIP }}:{{ .TCPPort 1 }},{{ if .Env.ETCD_PEERS }},{{ .Env.ETCD_PEERS }}{{ end }}",
      "{{ if .Env.ETCD_DISCOVERY }}-discovery={{ .Env.ETCD_DISCOVERY }}{{ end }}"
    ],
    "tcp_ports": ["2379", "2380"]
  },
  {
    "id": "discoverd",
    "image": "$image_url_prefix/discoverd?id=$image_id[discoverd]",
    "args": ["-bind=:{{ .TCPPort 0 }}", "-etcd=http://{{ .Services.etcd.ExternalIP }}:{{ index .Services.etcd.TCPPorts 0 }}"],
    "tcp_ports": ["1111"]
  }
]

[
  {
    "id": "etcd",
    "image": "$image_url_prefix/etcd?id=$image_id[etcd]",
    "expose_env": ["ETCD_INITIAL_CLUSTER", "ETCD_INITIAL_CLUSTER_STATE", "ETCD_NAME", "ETCD_DISCOVERY", "ETCD_PROXY"],
    "args": [
      "-data-dir={{ .Volume \"/data\" }}",
      "-advertise-client-urls=http://{{ .ExternalIP }}:{{ .TCPPort 0 }}",
      "-listen-client-urls=http://0.0.0.0:{{ .TCPPort 0 }}",
      "-initial-advertise-peer-urls=http://{{ .ExternalIP }}:{{ .TCPPort 1 }}",
      "-listen-peer-urls=http://0.0.0.0:{{ .TCPPort 1 }}"
    ],
    "tcp_ports": ["2379", "2380"]
  },
  {
    "id": "discoverd",
    "image": "$image_url_prefix/discoverd?id=$image_id[discoverd]",
    "args": ["-bind=:{{ .TCPPort 0 }}", "-etcd=http://{{ .Services.etcd.ExternalIP }}:{{ index .Services.etcd.TCPPorts 0 }}"],
    "tcp_ports": ["1111"]
  }
]

Configure etcd clustering via environment variables directly
host: Configure etcd clustering via environment variables directly

Signed-off-by: Jonathan Rudenberg <3692bfa45759a67d83aedf0045f6cb635a966abf@titanous.com>
