Skip to content

Commit e996e7e

Browse files
committed
Enable nf_conntrack kernel module on Rocky 9
1 parent 44d395a commit e996e7e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

upup/pkg/fi/nodeup/command.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
290290
}
291291
}
292292

293-
if err := loadKernelModules(modelContext); err != nil {
293+
if err := loadKernelModules(modelContext, distribution); err != nil {
294294
return err
295295
}
296296

@@ -551,7 +551,7 @@ func modprobe(module string) error {
551551
// loadKernelModules is a hack to force br_netfilter to be loaded
552552
// and used by some components to load its recommended modules.
553553
// TODO: Move to tasks architecture
554-
func loadKernelModules(context *model.NodeupModelContext) error {
554+
func loadKernelModules(context *model.NodeupModelContext, distribution distributions.Distribution) error {
555555
if context.NodeupConfig.Networking.Kindnet != nil {
556556
err := modprobe("nfnetlink_queue")
557557
if err != nil {
@@ -564,6 +564,16 @@ func loadKernelModules(context *model.NodeupModelContext) error {
564564
klog.Warningf("error loading br_netfilter module: %v", err)
565565
}
566566
}
567+
switch distribution {
568+
case distributions.DistributionRocky9:
569+
// Rocky 9 doesn't load nf_conntrack by default, and it's required for kube-proxy:
570+
// "Error running ProxyServer" err="open /proc/sys/net/netfilter/nf_conntrack_max: no such file or directory"
571+
// "command failed" err="open /proc/sys/net/netfilter/nf_conntrack_max: no such file or directory"
572+
err := modprobe("nf_conntrack")
573+
if err != nil {
574+
klog.Warningf("error loading nf_conntrack module: %v", err)
575+
}
576+
}
567577
// TODO: Add to /etc/modules-load.d/ ?
568578
return nil
569579
}

0 commit comments

Comments
 (0)