Remove templating for etcd members

Use a etcd-initer init container to generate etcd args, it determines
etcd name by comparing its ip and etcd cluster ips. This way will
make etcd configuration independent to the ansible templating so
that could be easier on adding master nodes.
This commit is contained in:
Wei Tie
2017-12-07 23:33:29 -08:00
parent 5881ba43f8
commit dad95c873b
4 changed files with 26 additions and 28 deletions

View File

@@ -1,29 +1,19 @@
---
contiv_config_dir: "{{ kube_config_dir }}/contiv"
contiv_etcd_conf_dir: "/etc/contiv/etcd/"
contiv_etcd_conf_dir: "/etc/contiv/etcd"
contiv_etcd_data_dir: "/var/lib/etcd/contiv-data"
contiv_netmaster_port: 9999
contiv_cni_version: 0.1.0
contiv_etcd_image_repo: "{{ etcd_image_repo }}"
contiv_etcd_image_tag: "{{ etcd_image_tag }}"
contiv_etcd_listen_ip: "{{ ip | default(ansible_default_ipv4['address']) }}"
contiv_etcd_listen_port: 6666
contiv_etcd_peer_port: 6667
contiv_etcd_ad_urls: http://{{ contiv_etcd_listen_ip }}:{{ contiv_etcd_listen_port }}
contiv_etcd_peer_urls: http://{{ contiv_etcd_listen_ip }}:{{ contiv_etcd_peer_port }}
contiv_etcd_listen_urls:
- http://{{ contiv_etcd_listen_ip }}:{{ contiv_etcd_listen_port }}
- http://127.0.0.1:{{ contiv_etcd_listen_port }}
contiv_etcd_endpoints: |-
{% for host in groups['kube-master'] -%}
contiv_etcd{{ loop.index }}=http://{{ hostvars[host]['ip'] | default(hostvars[host].ansible_default_ipv4['address']) }}:{{ contiv_etcd_peer_port }}{% if not loop.last %},{% endif %}
{%- endfor %}
contiv_etcd_name: |-
{% for host in groups['kube-master'] %}
{% if host == inventory_hostname -%}contiv_etcd{{ loop.index }}{%- endif %}
{% endfor %}
# Parameters for Contiv api-proxy
contiv_enable_api_proxy: true