2016-12-13 17:20:22 +00:00
|
|
|
[Unit]
|
|
|
|
Description=etcd rkt wrapper
|
|
|
|
Documentation=https://github.com/coreos/etcd
|
|
|
|
Wants=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=10s
|
|
|
|
TimeoutStartSec=0
|
|
|
|
LimitNOFILE=40000
|
2016-12-28 13:58:37 +00:00
|
|
|
User=root
|
|
|
|
Group={{ etcd_group_id }}
|
|
|
|
SupplementaryGroups={{ etcd_cert_group_id }}
|
2016-12-13 17:20:22 +00:00
|
|
|
|
2016-12-20 23:00:46 +00:00
|
|
|
ExecStart=/usr/bin/rkt run \
|
2016-12-13 17:20:22 +00:00
|
|
|
--uuid-file-save=/var/run/etcd.uuid \
|
|
|
|
--volume=etc-ssl-certs,kind=host,source=/etc/ssl/certs,readOnly=true \
|
|
|
|
--mount=volume=etc-ssl-certs,target=/etc/ssl/certs \
|
|
|
|
--volume=etcd-cert-dir,kind=host,source={{ etcd_cert_dir }},readOnly=true \
|
|
|
|
--mount=volume=etcd-cert-dir,target={{ etcd_cert_dir }} \
|
|
|
|
--volume=var-lib-etcd,kind=host,source=/var/lib/etcd,readOnly=false \
|
|
|
|
--mount=volume=var-lib-etcd,target=/var/lib/etcd \
|
|
|
|
--set-env-file=/etc/etcd.env \
|
|
|
|
--stage1-from-dir=stage1-fly.aci \
|
|
|
|
{{ etcd_image_repo }}:{{ etcd_image_tag }} \
|
2016-12-28 13:58:37 +00:00
|
|
|
{% for c in etcd_drop_cap %}
|
|
|
|
--caps-remove=CAP_{{ c.upper() }} \
|
|
|
|
{% endfor %}
|
|
|
|
--memory={{ etcd_memory_limit }} --cpu={{ etcd_cpu_limit }} \
|
|
|
|
--user={{ etcd_user_id }} --group={{ etcd_group_id }} \
|
2016-12-13 17:20:22 +00:00
|
|
|
--name={{ etcd_member_name | default("etcd") }}
|
|
|
|
|
|
|
|
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/run/etcd.uuid
|
|
|
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/etcd.uuid
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|