Unverified Commit e3f87891 authored by Jason's avatar Jason Committed by GitHub

Add containerd snapshotter flag (#1991)

* Add containerd snapshotter flag Signed-off-by: 's avatarJason-ZW <zhenyang@rancher.com> * Fix CamelCase nit and option description Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> Signed-off-by: 's avatarJason-ZW <zhenyang@rancher.com> Co-authored-by: 's avatarBrad Davidson <brad@oatmail.org>
parent 206accbe
......@@ -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
......
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