Skip to content

Commit

Permalink
kubeadm: use /etc/modules-load.d to load br_netfilter upon reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Jan 7, 2025
1 parent 2a1e30b commit a69dfb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions kvirt/cluster/kubeadm/pre_el.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/$VERSION/rpm/repodata/repomd.xml.key""" >/etc/yum.repos.d/kubernetes.repo
echo net.bridge.bridge-nf-call-iptables=1 >> /etc/sysctl.d/99-sysctl.conf
modprobe overlay
modprobe br_netfilter
echo -e 'overlay\nbr_netfilter' > /etc/modules-load.d/kubeadm.conf
sysctl -p
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
Expand All @@ -28,8 +30,7 @@ systemctl enable --now docker
{% else %}
modprobe overlay
modprobe br_netfilter
echo overlay >> /etc/modules
echo br_netfilter >> /etc/modules
echo -e 'overlay\nbr_netfilter' > /etc/modules-load.d/kubeadm.conf
cat <<EOF | tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
Expand Down
3 changes: 1 addition & 2 deletions kvirt/cluster/kubeadm/pre_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ systemctl enable --now docker
{% else %}
modprobe overlay
modprobe br_netfilter
echo overlay >> /etc/modules
echo br_netfilter >> /etc/modules
echo -e 'overlay\nbr_netfilter' > /etc/modules-load.d/kubeadm.conf
cat <<EOF | tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
Expand Down

0 comments on commit a69dfb5

Please sign in to comment.