-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
runsc
aware of host kernel settings and offer to tweak them.
This adds a `hostsettings` package which can be used to check and optionally automatically adjust host kernel settings. This currently covers six kernel settings: - `/proc/sys/kernel/yama/ptrace_scope`: must set to 0 or 1 when using `ptrace`. - `/proc/sys/user/max_user_namespaces`: must be >= 2, but also suggest increasing it further if low. - `/proc/sys/kernel/unprivileged_userns_clone`: Must be enabled in rootless mode. - `/proc/sys/kernel/unprivileged_userns_apparmor_policy`: Same. - `/proc/sys/vm/max_map_count`: suggest increasing max host VMAs. - `/sys/kernel/mm/transparent_hugepage/shmem_enabled`: suggest turning on transparent hugepages. This is flag-gated; by default `runsc` only checks that these settings are optimal, but only warns if they are not optimal (unless marked as mandatory). Other flag settings can be used to either bypass this process entirely (to avoid the small startup overhead this adds), or to make it auto-adjust any suboptiomal kernel settings, either on a best-effort or mandatory basis. Updates issue #5964 Updates issue #9006 PiperOrigin-RevId: 683375555
- Loading branch information
1 parent
cbbd0b4
commit 8e60158
Showing
7 changed files
with
419 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("//tools:defs.bzl", "go_library") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
licenses = ["notice"], | ||
) | ||
|
||
go_library( | ||
name = "hostsettings", | ||
srcs = [ | ||
"hostsettings.go", | ||
], | ||
visibility = ["//:sandbox"], | ||
deps = [ | ||
"//pkg/log", | ||
"//runsc/config", | ||
], | ||
) |
Oops, something went wrong.