mirror of https://github.com/k3s-io/k3s
Make pause image configurable (#345)
parent
ea94b1af77
commit
52f845ec84
|
@ -304,6 +304,7 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
|
|||
nodeConfig.AgentConfig.ListenAddress = "0.0.0.0"
|
||||
nodeConfig.AgentConfig.KubeConfig = kubeConfig
|
||||
nodeConfig.AgentConfig.RootDir = filepath.Join(envInfo.DataDir, "kubelet")
|
||||
nodeConfig.AgentConfig.PauseImage = envInfo.PauseImage
|
||||
nodeConfig.CACerts = info.CACerts
|
||||
nodeConfig.Containerd.Config = filepath.Join(envInfo.DataDir, "etc/containerd/config.toml")
|
||||
nodeConfig.Containerd.Root = filepath.Join(envInfo.DataDir, "containerd")
|
||||
|
|
|
@ -19,17 +19,22 @@ path = "{{ .NodeConfig.Containerd.Opt }}"
|
|||
[plugins.cri]
|
||||
stream_server_address = "{{ .NodeConfig.AgentConfig.NodeName }}"
|
||||
stream_server_port = "10010"
|
||||
{{ if .IsRunningInUserNS }}
|
||||
|
||||
{{- if .IsRunningInUserNS }}
|
||||
disable_cgroup = true
|
||||
disable_apparmor = true
|
||||
restrict_oom_score_adj = true
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
|
||||
{{ if not .NodeConfig.NoFlannel }}
|
||||
{{- if .NodeConfig.AgentConfig.PauseImage }}
|
||||
sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
|
||||
{{ end -}}
|
||||
|
||||
{{- if not .NodeConfig.NoFlannel }}
|
||||
[plugins.cri.cni]
|
||||
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
|
||||
conf_dir = "{{ .NodeConfig.AgentConfig.CNIConfDir }}"
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
`
|
||||
|
||||
func ParseTemplateFromConfig(templateBuffer string, config interface{}) (string, error) {
|
||||
|
|
|
@ -16,6 +16,7 @@ type Agent struct {
|
|||
NodeIP string
|
||||
NodeName string
|
||||
ClusterSecret string
|
||||
PauseImage string
|
||||
Docker bool
|
||||
ContainerRuntimeEndpoint string
|
||||
NoFlannel bool
|
||||
|
@ -65,9 +66,14 @@ var (
|
|||
Usage: "(agent) Disable embedded containerd and use alternative CRI implementation",
|
||||
Destination: &AgentConfig.ContainerRuntimeEndpoint,
|
||||
}
|
||||
PauseImageFlag = cli.StringFlag{
|
||||
Name: "pause-image",
|
||||
Usage: "(agent) Customized pause image for containerd sandbox",
|
||||
Destination: &AgentConfig.PauseImage,
|
||||
}
|
||||
ResolvConfFlag = cli.StringFlag{
|
||||
Name: "resolv-conf",
|
||||
Usage: "Kubelet resolv.conf file",
|
||||
Usage: "(agent) Kubelet resolv.conf file",
|
||||
EnvVar: "K3S_RESOLV_CONF",
|
||||
Destination: &AgentConfig.ResolvConf,
|
||||
}
|
||||
|
@ -131,6 +137,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
|
|||
NodeNameFlag,
|
||||
NodeIPFlag,
|
||||
CRIEndpointFlag,
|
||||
PauseImageFlag,
|
||||
ResolvConfFlag,
|
||||
ExtraKubeletArgs,
|
||||
ExtraKubeProxyArgs,
|
||||
|
|
|
@ -143,6 +143,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
|||
FlannelFlag,
|
||||
FlannelIfaceFlag,
|
||||
CRIEndpointFlag,
|
||||
PauseImageFlag,
|
||||
ResolvConfFlag,
|
||||
ExtraKubeletArgs,
|
||||
ExtraKubeProxyArgs,
|
||||
|
|
|
@ -53,6 +53,7 @@ type Agent struct {
|
|||
CNIConfDir string
|
||||
ExtraKubeletArgs []string
|
||||
ExtraKubeProxyArgs []string
|
||||
PauseImage string
|
||||
CNIPlugin bool
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue