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.PauseImage = envInfo.PauseImage
|
||||
nodeConfig.AgentConfig.Snapshotter = envInfo.Snapshotter
|
||||
nodeConfig.AgentConfig.IPSECPSK = controlConfig.IPSECPSK
|
||||
nodeConfig.AgentConfig.StrongSwanDir = filepath.Join(envInfo.DataDir, "strongswan")
|
||||
nodeConfig.CACerts = info.CACerts
|
||||
|
@ -33,6 +33,11 @@ const ContainerdConfigTemplate = `
|
||||
sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
|
||||
{{end}}
|
||||
|
||||
{{- if .NodeConfig.AgentConfig.Snapshotter }}
|
||||
[plugins.cri.containerd]
|
||||
snapshotter = "{{ .NodeConfig.AgentConfig.Snapshotter }}"
|
||||
{{end}}
|
||||
|
||||
{{- if not .NodeConfig.NoFlannel }}
|
||||
[plugins.cri.cni]
|
||||
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
|
||||
|
@ -21,6 +21,7 @@ type Agent struct {
|
||||
NodeExternalIP string
|
||||
NodeName string
|
||||
PauseImage string
|
||||
Snapshotter string
|
||||
Docker bool
|
||||
ContainerRuntimeEndpoint string
|
||||
NoFlannel bool
|
||||
@ -90,6 +91,12 @@ var (
|
||||
Destination: &AgentConfig.PauseImage,
|
||||
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{
|
||||
Name: "no-flannel",
|
||||
Usage: "(deprecated) use --flannel-backend=none",
|
||||
@ -190,6 +197,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) *cli.Command {
|
||||
&DisableSELinuxFlag,
|
||||
&CRIEndpointFlag,
|
||||
&PauseImageFlag,
|
||||
&SnapshotterFlag,
|
||||
&PrivateRegistryFlag,
|
||||
&NodeIPFlag,
|
||||
&NodeExternalIPFlag,
|
||||
|
@ -238,6 +238,7 @@ func NewServerCommand(action func(*cli.Context) error) *cli.Command {
|
||||
&DisableSELinuxFlag,
|
||||
&CRIEndpointFlag,
|
||||
&PauseImageFlag,
|
||||
&SnapshotterFlag,
|
||||
&PrivateRegistryFlag,
|
||||
&NodeIPFlag,
|
||||
&NodeExternalIPFlag,
|
||||
|
@ -72,6 +72,7 @@ type Agent struct {
|
||||
ExtraKubeletArgs []string
|
||||
ExtraKubeProxyArgs []string
|
||||
PauseImage string
|
||||
Snapshotter string
|
||||
CNIPlugin bool
|
||||
NodeTaints []string
|
||||
NodeLabels []string
|
||||
|
Loading…
Reference in New Issue
Block a user