-
Notifications
You must be signed in to change notification settings - Fork 5
/
etcd.service.j2
28 lines (26 loc) · 1.05 KB
/
etcd.service.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[Unit]
Description=etcd
Documentation=https://github.com/coreos
[Service]
ExecStart=/usr/local/bin/etcd \
--name {{ ansible_nodename }} \
--cert-file=/etc/etcd/kubernetes.pem \
--key-file=/etc/etcd/kubernetes-key.pem \
--peer-cert-file=/etc/etcd/kubernetes.pem \
--peer-key-file=/etc/etcd/kubernetes-key.pem \
--trusted-ca-file=/etc/etcd/ca.pem \
--peer-trusted-ca-file=/etc/etcd/ca.pem \
--peer-client-cert-auth \
--client-cert-auth \
--initial-advertise-peer-urls https://{{ hostvars[groups['k8s-node-1'] | join('')]['ip'] }}:2380 \
--listen-peer-urls https://{{ hostvars[groups['k8s-node-1'] | join('')]['ip'] }}:2380 \
--listen-client-urls https://0.0.0.0:2379 \
--advertise-client-urls https://{{ hostvars[groups['k8s-node-1'] | join('')]['ip'] }}:2379 \
--initial-cluster-token etcd-cluster-0 \
--initial-cluster {{ ansible_nodename }}=https://{{ hostvars[groups['k8s-node-1'] | join('')]['ip'] }}:2380 \
--initial-cluster-state new \
--data-dir=/var/lib/etcd
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target