mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Add containerd snapshotter flag (#1991)
* Add containerd snapshotter flag Signed-off-by: Jason-ZW <zhenyang@rancher.com> * Fix CamelCase nit and option description Signed-off-by: Brad Davidson <brad.davidson@rancher.com> Signed-off-by: Jason-ZW <zhenyang@rancher.com> Co-authored-by: Brad Davidson <brad@oatmail.org>
This commit is contained in:
parent
206accbe8d
commit
e3f8789114
@ -423,6 +423,7 @@ func get(envInfo *cmds.Agent, proxy proxy.Proxy) (*config.Node, error) {
|
|||||||
nodeConfig.AgentConfig.RootDir = filepath.Join(envInfo.DataDir, "kubelet")
|
nodeConfig.AgentConfig.RootDir = filepath.Join(envInfo.DataDir, "kubelet")
|
||||||
}
|
}
|
||||||
nodeConfig.AgentConfig.PauseImage = envInfo.PauseImage
|
nodeConfig.AgentConfig.PauseImage = envInfo.PauseImage
|
||||||
|
nodeConfig.AgentConfig.Snapshotter = envInfo.Snapshotter
|
||||||
nodeConfig.AgentConfig.IPSECPSK = controlConfig.IPSECPSK
|
nodeConfig.AgentConfig.IPSECPSK = controlConfig.IPSECPSK
|
||||||
nodeConfig.AgentConfig.StrongSwanDir = filepath.Join(envInfo.DataDir, "strongswan")
|
nodeConfig.AgentConfig.StrongSwanDir = filepath.Join(envInfo.DataDir, "strongswan")
|
||||||
nodeConfig.CACerts = info.CACerts
|
nodeConfig.CACerts = info.CACerts
|
||||||
|
@ -33,6 +33,11 @@ const ContainerdConfigTemplate = `
|
|||||||
sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
|
sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{- if .NodeConfig.AgentConfig.Snapshotter }}
|
||||||
|
[plugins.cri.containerd]
|
||||||
|
snapshotter = "{{ .NodeConfig.AgentConfig.Snapshotter }}"
|
||||||
|
{{end}}
|
||||||
|
|
||||||
{{- if not .NodeConfig.NoFlannel }}
|
{{- if not .NodeConfig.NoFlannel }}
|
||||||
[plugins.cri.cni]
|
[plugins.cri.cni]
|
||||||
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
|
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
|
||||||
|
@ -21,6 +21,7 @@ type Agent struct {
|
|||||||
NodeExternalIP string
|
NodeExternalIP string
|
||||||
NodeName string
|
NodeName string
|
||||||
PauseImage string
|
PauseImage string
|
||||||
|
Snapshotter string
|
||||||
Docker bool
|
Docker bool
|
||||||
ContainerRuntimeEndpoint string
|
ContainerRuntimeEndpoint string
|
||||||
NoFlannel bool
|
NoFlannel bool
|
||||||
@ -90,6 +91,12 @@ var (
|
|||||||
Destination: &AgentConfig.PauseImage,
|
Destination: &AgentConfig.PauseImage,
|
||||||
Value: "docker.io/rancher/pause:3.1",
|
Value: "docker.io/rancher/pause:3.1",
|
||||||
}
|
}
|
||||||
|
SnapshotterFlag = cli.StringFlag{
|
||||||
|
Name: "snapshotter",
|
||||||
|
Usage: "(agent/runtime) Override default containerd snapshotter",
|
||||||
|
Destination: &AgentConfig.Snapshotter,
|
||||||
|
Value: "overlayfs",
|
||||||
|
}
|
||||||
FlannelFlag = cli.BoolFlag{
|
FlannelFlag = cli.BoolFlag{
|
||||||
Name: "no-flannel",
|
Name: "no-flannel",
|
||||||
Usage: "(deprecated) use --flannel-backend=none",
|
Usage: "(deprecated) use --flannel-backend=none",
|
||||||
@ -190,6 +197,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) *cli.Command {
|
|||||||
&DisableSELinuxFlag,
|
&DisableSELinuxFlag,
|
||||||
&CRIEndpointFlag,
|
&CRIEndpointFlag,
|
||||||
&PauseImageFlag,
|
&PauseImageFlag,
|
||||||
|
&SnapshotterFlag,
|
||||||
&PrivateRegistryFlag,
|
&PrivateRegistryFlag,
|
||||||
&NodeIPFlag,
|
&NodeIPFlag,
|
||||||
&NodeExternalIPFlag,
|
&NodeExternalIPFlag,
|
||||||
|
@ -238,6 +238,7 @@ func NewServerCommand(action func(*cli.Context) error) *cli.Command {
|
|||||||
&DisableSELinuxFlag,
|
&DisableSELinuxFlag,
|
||||||
&CRIEndpointFlag,
|
&CRIEndpointFlag,
|
||||||
&PauseImageFlag,
|
&PauseImageFlag,
|
||||||
|
&SnapshotterFlag,
|
||||||
&PrivateRegistryFlag,
|
&PrivateRegistryFlag,
|
||||||
&NodeIPFlag,
|
&NodeIPFlag,
|
||||||
&NodeExternalIPFlag,
|
&NodeExternalIPFlag,
|
||||||
|
@ -72,6 +72,7 @@ type Agent struct {
|
|||||||
ExtraKubeletArgs []string
|
ExtraKubeletArgs []string
|
||||||
ExtraKubeProxyArgs []string
|
ExtraKubeProxyArgs []string
|
||||||
PauseImage string
|
PauseImage string
|
||||||
|
Snapshotter string
|
||||||
CNIPlugin bool
|
CNIPlugin bool
|
||||||
NodeTaints []string
|
NodeTaints []string
|
||||||
NodeLabels []string
|
NodeLabels []string
|
||||||
|
Loading…
Reference in New Issue
Block a user