Skip to content
Snippets Groups Projects
Commit 3a691dd8 authored by kaiyou's avatar kaiyou
Browse files

Load most common kernel modules on startup

parent 8256e8da
No related branches found
No related tags found
No related merge requests found
Pipeline #24623 passed
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"net" "net"
"os" "os"
"os/exec"
"path" "path"
"time" "time"
...@@ -51,6 +52,26 @@ var Start = &cobra.Command{ ...@@ -51,6 +52,26 @@ var Start = &cobra.Command{
return err return err
} }
} }
// Load useful kernel modules for later operations
// This uses exec at the moment, which is undesireable in case hepto is used in a very
// limited environment
desiredModules := []string{
"nf_conntrack", // Required by most CNI
"ip6_tables", // Required by kube-router, kube-proxy, Calico, and even Cilium
"ip6table_filter",
"ip6table_nat",
"ip6table_mangle",
"ip_tables", // Not used since hepto is IPv6 only, but required by most CNI
"iptable_filter",
"iptable_nat",
"iptable_mangle",
}
for _, mod := range desiredModules {
err := exec.Command("modprobe", "--", mod).Run()
if err != nil {
return err
}
}
return nil return nil
}, },
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment