41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: etcd-cluster
|
|
|
|
x-etcd: &etcd
|
|
image: quay.io/coreos/etcd:v3.5.4
|
|
command: ["etcd"]
|
|
healthcheck:
|
|
test: ["CMD", "etcdctl", "--endpoints=http://127.0.0.1:2379", "endpoint", "health"]
|
|
interval: 2s
|
|
timeout: 3s
|
|
retries: 15
|
|
|
|
x-cluster: &cluster
|
|
ETCD_INITIAL_CLUSTER: etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
|
|
ETCD_INITIAL_CLUSTER_TOKEN: seminar-etcd-cluster
|
|
ETCD_DATA_DIR: /var/lib/etcd
|
|
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
|
|
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
|
|
|
|
services:
|
|
etcd1:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *cluster
|
|
ETCD_NAME: etcd1
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd1:2380
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd1:2379
|
|
etcd2:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *cluster
|
|
ETCD_NAME: etcd2
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd2:2380
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd2:2379
|
|
etcd3:
|
|
<<: *etcd
|
|
environment:
|
|
<<: *cluster
|
|
ETCD_NAME: etcd3
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd3:2380
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://etcd3:2379
|