Fix ipv4 forwarding on GCE

ipv4 forwarding gets broken when restarting networking, which
breaks all networking for all pods.
This commit is contained in:
Matthew Mosesohn 2016-12-05 20:14:05 +03:00
parent 383208a2a0
commit eeb3b9f7e1

View file

@ -69,6 +69,17 @@
- include: azure-credential-check.yml - include: azure-credential-check.yml
when: cloud_provider is defined and cloud_provider == 'azure' when: cloud_provider is defined and cloud_provider == 'azure'
- name: Fix ipv4 forward rule in GCE security policy
lineinfile:
dest: /etc/sysctl.d/11-gce-network-security.conf
regexp: '^net.ipv4.ip_forward='
line: 'net.ipv4.ip_forward=1'
state: present
create: yes
backup: yes
validate: 'sysctl -f %s'
when: cloud_provider is defined and cloud_provider == 'gce'
- name: Create cni directories - name: Create cni directories
file: file:
path: "{{ item }}" path: "{{ item }}"