Commit 2250a8a3 authored by kaiyou's avatar kaiyou
Browse files

Make the containerd port configurable

parent 51988c66
Pipeline #720 passed with stage
in 2 minutes and 43 seconds
......@@ -424,6 +424,7 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
nodeConfig.AgentConfig.StrongSwanDir = filepath.Join(envInfo.DataDir, "strongswan")
nodeConfig.CACerts = info.CACerts
nodeConfig.Containerd.Config = filepath.Join(envInfo.DataDir, "etc/containerd/config.toml")
nodeConfig.Containerd.Port = envInfo.ContainerdPort
nodeConfig.Containerd.Root = filepath.Join(envInfo.DataDir, "containerd")
nodeConfig.Containerd.Opt = filepath.Join(envInfo.DataDir, "containerd")
if !envInfo.Debug {
......
......@@ -19,7 +19,7 @@ const ContainerdConfigTemplate = `
[plugins.cri]
stream_server_address = "127.0.0.1"
stream_server_port = "10010"
stream_server_port = "{{ .NodeConfig.Containerd.Port }}"
{{- if .IsRunningInUserNS }}
disable_cgroup = true
......
......@@ -21,6 +21,7 @@ type Agent struct {
PauseImage string
Docker bool
ContainerRuntimeEndpoint string
ContainerdPort int
NoFlannel bool
FlannelIface string
FlannelConf string
......@@ -74,6 +75,12 @@ var (
Usage: "(agent/runtime) Disable embedded containerd and use alternative CRI implementation",
Destination: &AgentConfig.ContainerRuntimeEndpoint,
}
ContainerdPortFlag = cli.IntFlag{
Name: "containerd-port",
Usage: "(agent/runtime) Specify the local containerd listen port",
Destination: &AgentConfig.ContainerdPort,
Value: 10010,
}
PrivateRegistryFlag = cli.StringFlag{
Name: "private-registry",
Usage: "(agent/runtime) Private registry configuration file",
......@@ -170,6 +177,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
NodeTaints,
DockerFlag,
CRIEndpointFlag,
ContainerdPortFlag,
PauseImageFlag,
PrivateRegistryFlag,
NodeIPFlag,
......
......@@ -216,6 +216,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
NodeTaints,
DockerFlag,
CRIEndpointFlag,
ContainerdPortFlag,
PauseImageFlag,
PrivateRegistryFlag,
NodeIPFlag,
......
......@@ -40,6 +40,7 @@ type Node struct {
type Containerd struct {
Address string
Log string
Port int
Root string
State string
Config string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment