Browse Source

Add master IPs to no proxy list so that liveness checks would pass

Vadim Rutkovsky 6 years ago
parent
commit
0b01cfa683

+ 5 - 0
playbooks/init/cluster_facts.yml

@@ -47,6 +47,11 @@
                                              | union(groups['oo_etcd_to_config'] | default([])))
                                          | lib_utils_oo_collect('openshift.common.hostname') | default([]) | join (',')
                                          }}"
+        no_proxy_master_ips: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_masters_to_config']
+                                          | default([]))
+                                          | lib_utils_oo_collect('openshift.common.ip')
+                                          | default([]) | join (',')
+                              }}"
     when:
     - openshift_http_proxy is defined or openshift_https_proxy is defined
     - openshift_generate_no_proxy_hosts | default(True) | bool

+ 5 - 0
roles/openshift_facts/library/openshift_facts.py

@@ -816,6 +816,11 @@ def set_proxy_facts(facts):
                 if isinstance(common['no_proxy_etcd_host_ips'], string_types):
                     common['no_proxy'].extend(common['no_proxy_etcd_host_ips'].split(','))
 
+            # Master IPs should be added to no proxy lists to make liveness probes to pass
+            if 'no_proxy_master_ips' in common:
+                if isinstance(common['no_proxy_master_ips'], string_types):
+                    common['no_proxy'].extend(common['no_proxy_master_ips'].split(','))
+
             if 'generate_no_proxy_hosts' in common and safe_get_bool(common['generate_no_proxy_hosts']):
                 if 'no_proxy_internal_hostnames' in common:
                     common['no_proxy'].extend(common['no_proxy_internal_hostnames'].split(','))