Browse Source

Add iptables rules for flannel

[WIP] When using flannel there are iptables rules that need
to be added as stated here:

https://access.redhat.com/documentation/en-us/reference_architectures/2017/html-single/deploying_red_hat_openshift_container_platform_3.4_on_red_hat_openstack_platform_10/#run_ansible_installer

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1493955
Ivan Chavero 7 years ago
parent
commit
9cfd12cb49
1 changed files with 10 additions and 0 deletions
  1. 10 0
      roles/flannel/tasks/main.yml

+ 10 - 0
roles/flannel/tasks/main.yml

@@ -39,3 +39,13 @@
   notify:
     - restart docker
     - restart node
+
+- name: Enable Pod to Pod communication
+  command: /sbin/iptables --wait -I FORWARD -d {{ hostvars[groups.oo_first_master.0].openshift.master.sdn_cluster_network_cidr }} -i {{ flannel_interface }} -j ACCEPT -m comment --comment "Pod to Pod communication"
+    notify:
+        - save iptable rules
+
+- name: Allow external network access
+  command: /sbin/iptables -t nat -A POSTROUTING -o {{ flannel_interface }}  -j MASQUERADE -m comment --comment "Allow external network access"
+    notify:
+        - save iptable rules