Skip to content

Commit

Permalink
Update correct iptable config values in /etc/sysctl.d/k8s.conf
Browse files Browse the repository at this point in the history
The /etc/sysctl.d/k8s.conf file is missing the below iptable config
values which causes the error in kubeadm init -
"/proc/sys/net/ipv6/conf/default/forwarding was not set to 1"
during optimized BnR opearion.

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv6.conf.all.forwarding = 1

Recent changes in the below review modified the way Kubernetes is
restored. It exposes the incorrect kernel parameters in stx-puppet.
https://review.opendev.org/c/starlingx/ansible-playbooks/+/890370

This change updates the correct iptable configuration values in the
file /etc/sysctl.d/k8s.conf during bootstrap which fixes the
optimized BnR operation failure.

These settings are intended to exactly align with the settings
already being configured by the bringup-kubemaster task in the
ansible-playbooks.

Test Plan:
PASS: Fresh install ISO as AIO-SX. Verify that /etc/sysctl.d/k8s.conf
      have the correct configuration values.
PASS: Performed optimized BnR on IPv4 enabled AIO-SX.
PASS: Performed optimized BnR on IPv6 enabled AIO-SX.

Closes-Bug: 2038545

Change-Id: I585117190b2372cfd7c978eff9bd9ff6da61a88f
Signed-off-by: Ramesh Kumar Sivanandam <[email protected]>
  • Loading branch information
rsivanan committed Oct 11, 2023
1 parent e49328c commit 82ca22f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions puppet-manifests/src/modules/platform/manifests/kubernetes.pp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,14 @@
$k8s_topology_mgr_policy = $::platform::kubernetes::params::k8s_topology_mgr_policy
$k8s_pod_max_pids = $::platform::kubernetes::params::k8s_pod_max_pids

$iptables_file = "net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1"
$iptables_file = @("IPTABLE"/L)
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv6.conf.all.forwarding = 1
| IPTABLE

# Configure kubelet cpumanager options
$opts_sys_res = join(['--system-reserved=',
Expand Down

0 comments on commit 82ca22f

Please sign in to comment.