Make etcd data dir configurable.

Closes: #1073
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
This commit is contained in:
Sergii Golovatiuk 2017-02-24 15:58:54 +01:00
parent 27b4e61c9f
commit f9ff93c606
9 changed files with 12 additions and 7 deletions

View file

@ -1,6 +1,9 @@
# Valid bootstrap options (required): ubuntu, coreos, centos, none
bootstrap_os: none
#Directory where etcd data stored
etcd_data_dir: /var/lib/etcd
# Directory where the binaries will be installed
bin_dir: /usr/local/bin

View file

@ -1,12 +1,13 @@
---
kube_cert_group: kube-cert
etcd_data_dir: "/var/lib/etcd"
addusers:
etcd:
name: etcd
comment: "Etcd user"
createhome: yes
home: "/var/lib/etcd"
home: "{{ etcd_data_dir }}"
system: yes
shell: /bin/nologin
kube:

View file

@ -3,7 +3,7 @@ addusers:
- name: etcd
comment: "Etcd user"
createhome: yes
home: "/var/lib/etcd"
home: "{{ etcd_data_dir }}"
system: yes
shell: /bin/nologin

View file

@ -3,7 +3,7 @@ addusers:
- name: etcd
comment: "Etcd user"
createhome: yes
home: "/var/lib/etcd"
home: "{{ etcd_data_dir }}"
system: yes
shell: /bin/nologin

View file

@ -1,5 +1,6 @@
---
etcd_bin_dir: "{{ local_release_dir }}/etcd/etcd-{{ etcd_version }}-linux-amd64/"
etcd_data_dir: "/var/lib/etcd"
etcd_config_dir: /etc/ssl/etcd
etcd_cert_dir: "{{ etcd_config_dir }}/ssl"

View file

@ -13,7 +13,7 @@ ExecStart={{ docker_bin_dir }}/docker run --restart=on-failure:5 \
--net=host \
-v /etc/ssl/certs:/etc/ssl/certs:ro \
-v {{ etcd_cert_dir }}:{{ etcd_cert_dir }}:ro \
-v /var/lib/etcd:/var/lib/etcd:rw \
-v {{ etcd_data_dir }}:/var/lib/etcd:rw \
{% if etcd_memory_limit is defined %}
--memory={{ etcd_memory_limit|regex_replace('Mi', 'M') }} \
{% endif %}

View file

@ -15,7 +15,7 @@ ExecStart=/usr/bin/rkt run \
--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 \
--volume=var-lib-etcd,kind=host,source={{ etcd_data_dir }},readOnly=false \
--mount=volume=var-lib-etcd,target=/var/lib/etcd \
--set-env-file=/etc/etcd.env \
--stage1-from-dir=stage1-fly.aci \

View file

@ -1,4 +1,4 @@
ETCD_DATA_DIR=/var/lib/etcd
ETCD_DATA_DIR={{ etcd_data_dir }}
ETCD_ADVERTISE_CLIENT_URLS={{ etcd_client_url }}
ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_peer_url }}
ETCD_INITIAL_CLUSTER_STATE={% if etcd_cluster_is_healthy.rc != 0 | bool %}new{% else %}existing{% endif %}

View file

@ -56,7 +56,7 @@
with_items:
- "{{kube_config_dir}}"
- /var/lib/kubelet
- /var/lib/etcd
- "{{ etcd_data_dir }}"
- /etc/ssl/etcd
- /var/log/calico
- /etc/cni