Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit aaddaa2

Browse files
committed
bump up the default runtime to "io.containerd.runc.v2"
The former default runtime "io.containerd.runc.v1" won't support new features like support for cgroup v2: containerd/containerd#3726 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 61d3e49 commit aaddaa2

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

docs/config.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ version = 2
104104
# of runtime configurations, to the matching configurations.
105105
# In this example, 'runc' is the RuntimeHandler string to match.
106106
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
107-
# runtime_type is the runtime type to use in containerd e.g. io.containerd.runtime.v1.linux
108-
runtime_type = "io.containerd.runc.v1"
107+
# runtime_type is the runtime type to use in containerd.
108+
# The default value is "io.containerd.runc.v2" since containerd 1.4.
109+
# The default value was "io.containerd.runc.v1" in containerd 1.3, "io.containerd.runtime.v1.linux" in prior releases.
110+
runtime_type = "io.containerd.runc.v2"
109111

110112
# pod_annotations is a list of pod annotations passed to both pod
111113
# sandbox as well as container OCI annotations. Pod_annotations also
@@ -129,8 +131,8 @@ version = 2
129131
privileged_without_host_devices = false
130132

131133
# 'plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options' is options specific to
132-
# "io.containerd.runc.v1". Its corresponding options type is:
133-
# https://github.com/containerd/containerd/blob/v1.2.0-rc.1/runtime/v2/runc/options/oci.pb.go#L39.
134+
# "io.containerd.runc.v1" and "io.containerd.runc.v2". Its corresponding options type is:
135+
# https://github.com/containerd/containerd/blob/v1.3.2/runtime/v2/runc/options/oci.pb.go#L26 .
134136
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
135137
# NoPivotRoot disables pivot root when creating a container.
136138
NoPivotRoot = false
@@ -159,6 +161,12 @@ version = 2
159161
# SystemdCgroup enables systemd cgroups.
160162
SystemdCgroup = false
161163

164+
# CriuImagePath is the criu image path
165+
CriuImagePath = ""
166+
167+
# CriuWorkPath is the criu work path.
168+
CriuWorkPath = ""
169+
162170
# 'plugins."io.containerd.grpc.v1.cri".cni' contains config related to cni
163171
[plugins."io.containerd.grpc.v1.cri".cni]
164172
# bin_dir is the directory in which the binaries for the plugin is kept.

pkg/config/config_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func DefaultConfig() PluginConfig {
3838
NoPivot: false,
3939
Runtimes: map[string]Runtime{
4040
"runc": {
41-
Type: "io.containerd.runc.v1",
41+
Type: "io.containerd.runc.v2",
4242
},
4343
},
4444
},

pkg/server/sandbox_run_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (c *criService) cleanupSandboxFiles(id string, config *runtime.PodSandboxCo
298298
func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts {
299299
// TODO(random-liu): Remove this after shim v1 is deprecated.
300300
var taskOpts []containerd.NewTaskOpts
301-
if c.config.NoPivot && runtimeType == plugin.RuntimeRuncV1 {
301+
if c.config.NoPivot && (runtimeType == plugin.RuntimeRuncV1 || runtimeType == plugin.RuntimeRuncV2) {
302302
taskOpts = append(taskOpts, containerd.WithNoPivotRoot)
303303
}
304304
return taskOpts

0 commit comments

Comments
 (0)