mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-08 01:47:37 -02:30
allow non existing etcd group (#6797)
When using kubeadm managed etcd, configuring an etcd group can now be skipped.
This commit is contained in:
@@ -472,6 +472,9 @@ kube_apiserver_client_key: "{{ kube_cert_dir }}/ca.key"
|
||||
# Set to true to deploy etcd-events cluster
|
||||
etcd_events_cluster_enabled: false
|
||||
|
||||
# etcd group can be empty when kubeadm manages etcd
|
||||
etcd_hosts: "{{ groups['etcd'] | default(groups['kube-master']) }}"
|
||||
|
||||
# Vars for pointing to etcd endpoints
|
||||
is_etcd_master: "{{ inventory_hostname in groups['etcd'] }}"
|
||||
etcd_address: "{{ ip | default(fallback_ips[inventory_hostname]) }}"
|
||||
@@ -482,12 +485,12 @@ etcd_client_url: "https://{{ etcd_access_address }}:2379"
|
||||
etcd_events_peer_url: "https://{{ etcd_events_access_address }}:2382"
|
||||
etcd_events_client_url: "https://{{ etcd_events_access_address }}:2381"
|
||||
etcd_access_addresses: |-
|
||||
{% for item in groups['etcd'] -%}
|
||||
{% for item in etcd_hosts -%}
|
||||
https://{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:2379{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
etcd_events_access_addresses_list: |-
|
||||
[
|
||||
{% for item in groups['etcd'] -%}
|
||||
{% for item in etcd_hosts -%}
|
||||
'https://{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:2381'{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
]
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% else %}
|
||||
{% set cluster_or_master = 'k8s-cluster' %}
|
||||
{% endif %}
|
||||
{%- for item in (groups[cluster_or_master] + groups['etcd'] + groups['calico-rr']|default([]))|unique -%}
|
||||
{%- for item in (groups[cluster_or_master] + groups['etcd']|default([]) + groups['calico-rr']|default([]))|unique -%}
|
||||
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }},
|
||||
{%- if item != hostvars[item].get('ansible_hostname', '') -%}
|
||||
{{ hostvars[item]['ansible_hostname'] }},
|
||||
|
||||
Reference in New Issue
Block a user