Remove hard dependence on facts for all nodes (#4304)

* Remove hard dependence on facts for all nodes

* Update main.yaml

* Update main.yaml
This commit is contained in:
Matthew Mosesohn
2019-03-05 14:04:39 +03:00
committed by Kubernetes Prow Robot
parent adf6a7121f
commit acbf3db233
16 changed files with 41 additions and 29 deletions

View File

@@ -3,7 +3,7 @@
kube_apiserver_insecure_bind_address: 127.0.0.1
# advertised host IP for kubelet. This affects network plugin config. Take caution
kubelet_address: "{{ ip | default(ansible_default_ipv4['address']) }}"
kubelet_address: "{{ ip | default(fallback_ips[inventory_hostname]) }}"
# bind address for kubelet. Set to 0.0.0.0 to listen on all interfaces
kubelet_bind_address: "{{ ip | default('0.0.0.0') }}"

View File

@@ -11,7 +11,7 @@ stream {
upstream kube_apiserver {
least_conn;
{% for host in groups['kube-master'] -%}
server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address'])) }}:{{ kube_apiserver_port }};
server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(fallback_ips[host])) }}:{{ kube_apiserver_port }};
{% endfor %}
}