Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
3a691dd8
Commit
3a691dd8
authored
2 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
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
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/hepto/service.go
+21
-0
21 additions, 0 deletions
cmd/hepto/service.go
with
21 additions
and
0 deletions
cmd/hepto/service.go
+
21
−
0
View file @
3a691dd8
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment