Skip to content

[Backport 1.29] fix: ensure nf_conntrack module loaded for kubelite. - #4726

Merged
bschimke95 merged 1 commit into
canonical:1.29from
aznashwan:1.29
Oct 29, 2024
Merged

[Backport 1.29] fix: ensure nf_conntrack module loaded for kubelite.#4726
bschimke95 merged 1 commit into
canonical:1.29from
aznashwan:1.29

Conversation

@aznashwan

Copy link
Copy Markdown
Contributor

This patch ensures that the nf_conntrack kernel module is loaded before kubelite is started as the ProxyServer needs to read some conntrack module-related params from procfs.

Previously, although the it would always crashed if the module wasn't loaded, this wasn't that common of an occurrence in practice as there are quite a few ways nf_conntrack gets loaded transparently:

  • Cilium automatically loads iptable_nat after a small startup delay, whose dependency tree includes nf_conntrack
  • starting firewalld/ufw/most other firewall services
  • setting iptables/nftables rules which imply session tracking

By explicitly loading nf_conntrack before starting kubelite, it should ensure the procfs values ther ProxyServer reads are always present on startup.

Summary

Changes

Testing

Possible Regressions

Checklist

  • Read the contributions page.
  • Submitted the CLA form, if you are a first time contributor.
  • The introduced changes are covered by unit and/or integration tests.

Notes

This patch ensures that the `nf_conntrack` kernel module is loaded
before `kubelite` is started as the ProxyServer needs to read some
conntrack module-related params from procfs.

Previously, although the it would always crashed if the module wasn't
loaded, this wasn't that common of an occurrence in practice as there
are quite a few ways `nf_conntrack` gets loaded transparently:
* Cilium [automatically loads `iptable_nat`](https://github.com/cilium/cilium/blob/63cd391f93b4e2c865268241d384504348672042/pkg/datapath/iptables/iptables.go#L367-L368)
after a small startup delay, whose dependency tree includes `nf_conntrack`
* starting firewalld/ufw/most other firewall services
* setting iptables/nftables rules which imply session tracking

By explicitly loading `nf_conntrack` before starting `kubelite`,
it should ensure the procfs values ther ProxyServer reads are
always present on startup.

Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>

@bschimke95 bschimke95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bschimke95
bschimke95 merged commit 99b29b2 into canonical:1.29 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants