summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-11-24 14:06:12 -0500
committerJason DeTiberus <jdetiber@redhat.com>2015-11-24 14:06:12 -0500
commit42232eb59cc3c6ae5d4733b6655add0aff23217b (patch)
tree0d3de9588c0fa5c4ea764b2b3ae93d13dea19b8f
parentcb3da200563684c15d3a65cb2bf3958b9a34b249 (diff)
downloadopenshift-42232eb59cc3c6ae5d4733b6655add0aff23217b.tar.gz
openshift-42232eb59cc3c6ae5d4733b6655add0aff23217b.tar.bz2
openshift-42232eb59cc3c6ae5d4733b6655add0aff23217b.tar.xz
openshift-42232eb59cc3c6ae5d4733b6655add0aff23217b.zip
Conditionally set the nodeIP
-rw-r--r--inventory/byo/hosts.example5
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py2
-rw-r--r--roles/openshift_node/tasks/main.yml1
-rw-r--r--roles/openshift_node/templates/node.yaml.v1.j22
4 files changed, 9 insertions, 1 deletions
diff --git a/inventory/byo/hosts.example b/inventory/byo/hosts.example
index 423581281..50a683cfc 100644
--- a/inventory/byo/hosts.example
+++ b/inventory/byo/hosts.example
@@ -144,6 +144,11 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# configure how often node iptables rules are refreshed
#openshift_node_iptables_sync_period=5s
+# Configure nodeIP in the node config
+# This is needed in cases where node traffic is desired to go over an
+# interface other than the default network interface.
+#openshift_node_set_node_ip=True
+
# host group for masters
[masters]
ose3-master[1:3]-ansible.test.example.com
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 6006bfa9d..b60e42c71 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1074,7 +1074,7 @@ class OpenShiftFacts(object):
if 'node' in roles:
node = dict(labels={}, annotations={}, portal_net='172.30.0.0/16',
- iptables_sync_period='5s')
+ iptables_sync_period='5s', set_node_ip=False)
defaults['node'] = node
return defaults
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index d11bc5123..42d984a09 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -34,6 +34,7 @@
schedulable: "{{ openshift_schedulable | default(openshift_scheduleable) | default(None) }}"
sdn_mtu: "{{ openshift_node_sdn_mtu | default(None) }}"
storage_plugin_deps: "{{ osn_storage_plugin_deps | default(None) }}"
+ set_node_ip: "{{ openshift_set_node_ip | default(None) }}"
# We have to add tuned-profiles in the same transaction otherwise we run into depsolving
# problems because the rpms don't pin the version properly.
diff --git a/roles/openshift_node/templates/node.yaml.v1.j2 b/roles/openshift_node/templates/node.yaml.v1.j2
index 7d2f506e3..41a303dee 100644
--- a/roles/openshift_node/templates/node.yaml.v1.j2
+++ b/roles/openshift_node/templates/node.yaml.v1.j2
@@ -23,7 +23,9 @@ networkConfig:
{% if openshift.common.use_openshift_sdn %}
networkPluginName: {{ openshift.common.sdn_network_plugin_name }}
{% endif %}
+{% if openshift.node.set_node_ip | bool %}
nodeIP: {{ openshift.common.ip }}
+{% endif %}
nodeName: {{ openshift.common.hostname | lower }}
podManifestConfig:
servingInfo: