Browse Source

Push to the registry via dns

Configures OPENSHIFT_DEFAULT_REGISTRY=docker-registry.default.svc
Adds 'cluster.local' to dns search on nodes via dispatcher script
Adds '.svc' to NO_PROXY defaults
Scott Dodson 7 years ago
parent
commit
48cb038635

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

@@ -1654,6 +1654,7 @@ def set_proxy_facts(facts):
                     common['no_proxy'].extend(common['no_proxy_internal_hostnames'].split(','))
             # We always add local dns domain and ourselves no matter what
             common['no_proxy'].append('.' + common['dns_domain'])
+            common['no_proxy'].append('.svc')
             common['no_proxy'].append(common['hostname'])
             common['no_proxy'] = ','.join(sort_unique(common['no_proxy']))
         facts['common'] = common

+ 3 - 0
roles/openshift_master/templates/atomic-openshift-master.j2

@@ -1,5 +1,8 @@
 OPTIONS=--loglevel={{ openshift.master.debug_level | default(2) }}
 CONFIG_FILE={{ openshift_master_config_file }}
+{% if openshift_use_dnsmasq | default(true) %}
+OPENSHIFT_DEFAULT_REGISTRY=docker-registry.default.svc:5000
+{% endif %}
 {% if openshift.common.is_containerized | bool %}
 IMAGE_VERSION={{ openshift_image_tag }}
 {% endif %}

+ 3 - 0
roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh

@@ -96,6 +96,9 @@ EOF
       if ! grep -q '99-origin-dns.sh' ${NEW_RESOLV_CONF}; then
           echo "# nameserver updated by /etc/NetworkManager/dispatcher.d/99-origin-dns.sh" >> ${NEW_RESOLV_CONF}
       fi
+      if ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
+        sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
+      fi
       cp -Z ${NEW_RESOLV_CONF} /etc/resolv.conf
     fi
   fi