add dataRoot configuration support for containerd

This commit is contained in:
elmer 2022-08-16 15:35:10 +08:00
parent abc46826f2
commit 74b24b47ec
2 changed files with 5 additions and 0 deletions

View File

@ -201,6 +201,7 @@ func InstallContainerd(m *InstallContainerModule) []task.Interface {
"InsecureRegistries": m.KubeConf.Cluster.Registry.InsecureRegistries,
"SandBoxImage": images.GetImage(m.Runtime, m.KubeConf, "pause").ImageName(),
"Auths": registry.DockerRegistryAuthEntries(m.KubeConf.Cluster.Registry.Auths),
"DataRoot": templates.DataRoot(m.KubeConf),
},
},
Parallel: true,

View File

@ -24,7 +24,11 @@ import (
var ContainerdConfig = template.Must(template.New("config.toml").Parse(
dedent.Dedent(`version = 2
{{- if .DataRoot }}
root = {{ .DataRoot }}
{{ else }}
root = "/var/lib/containerd"
{{- end }}
state = "/run/containerd"
[grpc]