mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Don't enable unprivileged ports and icmp on old kernels
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
90016c208d
commit
db2ba7b61d
@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/docker/docker/pkg/parsers/kernel"
|
||||
"github.com/k3s-io/k3s/pkg/agent/templates"
|
||||
util2 "github.com/k3s-io/k3s/pkg/agent/util"
|
||||
"github.com/k3s-io/k3s/pkg/cgroups"
|
||||
@ -64,6 +65,7 @@ func setupContainerdConfig(ctx context.Context, cfg *config.Node) error {
|
||||
DisableCgroup: disableCgroup,
|
||||
SystemdCgroup: cfg.AgentConfig.Systemd,
|
||||
IsRunningInUserNS: isRunningInUserNS,
|
||||
EnableUnprivileged: kernel.CheckKernelVersion(4, 11, 0),
|
||||
PrivateRegistryConfig: privRegistries.Registry,
|
||||
ExtraRuntimes: findNvidiaContainerRuntimes(os.DirFS(string(os.PathSeparator))),
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ type ContainerdConfig struct {
|
||||
DisableCgroup bool
|
||||
SystemdCgroup bool
|
||||
IsRunningInUserNS bool
|
||||
EnableUnprivileged bool
|
||||
PrivateRegistryConfig *registries.Registry
|
||||
ExtraRuntimes map[string]ContainerdRuntimeConfig
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ const ContainerdConfigTemplate = `
|
||||
stream_server_address = "127.0.0.1"
|
||||
stream_server_port = "10010"
|
||||
enable_selinux = {{ .NodeConfig.SELinux }}
|
||||
enable_unprivileged_ports = true
|
||||
enable_unprivileged_icmp = true
|
||||
enable_unprivileged_ports = {{ .EnableUnprivileged }}
|
||||
enable_unprivileged_icmp = {{ .EnableUnprivileged }}
|
||||
|
||||
{{- if .DisableCgroup}}
|
||||
disable_cgroup = true
|
||||
|
Loading…
Reference in New Issue
Block a user