Make etcd data dir configurable.

Closes: #1073
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
pull/1077/head
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 # Valid bootstrap options (required): ubuntu, coreos, centos, none
bootstrap_os: none bootstrap_os: none
#Directory where etcd data stored
etcd_data_dir: /var/lib/etcd
# Directory where the binaries will be installed # Directory where the binaries will be installed
bin_dir: /usr/local/bin bin_dir: /usr/local/bin

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
--- ---
etcd_bin_dir: "{{ local_release_dir }}/etcd/etcd-{{ etcd_version }}-linux-amd64/" 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_config_dir: /etc/ssl/etcd
etcd_cert_dir: "{{ etcd_config_dir }}/ssl" 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 \ --net=host \
-v /etc/ssl/certs:/etc/ssl/certs:ro \ -v /etc/ssl/certs:/etc/ssl/certs:ro \
-v {{ etcd_cert_dir }}:{{ etcd_cert_dir }}: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 %} {% if etcd_memory_limit is defined %}
--memory={{ etcd_memory_limit|regex_replace('Mi', 'M') }} \ --memory={{ etcd_memory_limit|regex_replace('Mi', 'M') }} \
{% endif %} {% endif %}

View File

@ -15,7 +15,7 @@ ExecStart=/usr/bin/rkt run \
--mount=volume=etc-ssl-certs,target=/etc/ssl/certs \ --mount=volume=etc-ssl-certs,target=/etc/ssl/certs \
--volume=etcd-cert-dir,kind=host,source={{ etcd_cert_dir }},readOnly=true \ --volume=etcd-cert-dir,kind=host,source={{ etcd_cert_dir }},readOnly=true \
--mount=volume=etcd-cert-dir,target={{ etcd_cert_dir }} \ --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 \ --mount=volume=var-lib-etcd,target=/var/lib/etcd \
--set-env-file=/etc/etcd.env \ --set-env-file=/etc/etcd.env \
--stage1-from-dir=stage1-fly.aci \ --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_ADVERTISE_CLIENT_URLS={{ etcd_client_url }}
ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_peer_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 %} ETCD_INITIAL_CLUSTER_STATE={% if etcd_cluster_is_healthy.rc != 0 | bool %}new{% else %}existing{% endif %}

View File

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