mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2025-04-02 01:20:57 +02:00
Ensure kernel modules are present
This commit is contained in:
parent
4a4c88b6b8
commit
f2c5df1079
@ -7,7 +7,24 @@
|
||||
ansible_distribution != 'Debian'
|
||||
or ansible_distribution_major_version | int < 10
|
||||
|
||||
# See: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic
|
||||
# See: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#forwarding-ipv4-and-letting-iptables-see-bridged-traffic
|
||||
- name: Ensure relevant kernel module is enabled
|
||||
modprobe:
|
||||
name: br_netfilter
|
||||
state: present
|
||||
loop:
|
||||
- br_netfilter
|
||||
- overlay
|
||||
|
||||
- name: Persist kernel modules after reboot
|
||||
lineinfile:
|
||||
path: /etc/sysctl.d/k8s.conf
|
||||
line: "{{ item }}"
|
||||
loop:
|
||||
- "net.bridge.bridge-nf-call-iptables = 1"
|
||||
- "net.bridge.bridge-nf-call-ip6tables = 1"
|
||||
- "net.ipv4.ip_forward = 1"
|
||||
|
||||
- name: Let iptables see bridged traffic.
|
||||
sysctl:
|
||||
name: "{{ item }}"
|
||||
|
Loading…
Reference in New Issue
Block a user