Merge pull request #1359 from AkihiroSuda/shim-v2-runc-v2

bump up the default runtime to "io.containerd.runc.v2"
This commit is contained in:
Lantao Liu 2019-12-17 11:24:22 -08:00 committed by GitHub
commit ff8a2e7c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -104,8 +104,10 @@ version = 2
# of runtime configurations, to the matching configurations. # of runtime configurations, to the matching configurations.
# In this example, 'runc' is the RuntimeHandler string to match. # In this example, 'runc' is the RuntimeHandler string to match.
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
# runtime_type is the runtime type to use in containerd e.g. io.containerd.runtime.v1.linux # runtime_type is the runtime type to use in containerd.
runtime_type = "io.containerd.runc.v1" # The default value is "io.containerd.runc.v2" since containerd 1.4.
# The default value was "io.containerd.runc.v1" in containerd 1.3, "io.containerd.runtime.v1.linux" in prior releases.
runtime_type = "io.containerd.runc.v2"
# pod_annotations is a list of pod annotations passed to both pod # pod_annotations is a list of pod annotations passed to both pod
# sandbox as well as container OCI annotations. Pod_annotations also # sandbox as well as container OCI annotations. Pod_annotations also
@ -129,8 +131,8 @@ version = 2
privileged_without_host_devices = false privileged_without_host_devices = false
# 'plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options' is options specific to # 'plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options' is options specific to
# "io.containerd.runc.v1". Its corresponding options type is: # "io.containerd.runc.v1" and "io.containerd.runc.v2". Its corresponding options type is:
# https://github.com/containerd/containerd/blob/v1.2.0-rc.1/runtime/v2/runc/options/oci.pb.go#L39. # https://github.com/containerd/containerd/blob/v1.3.2/runtime/v2/runc/options/oci.pb.go#L26 .
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
# NoPivotRoot disables pivot root when creating a container. # NoPivotRoot disables pivot root when creating a container.
NoPivotRoot = false NoPivotRoot = false
@ -159,6 +161,12 @@ version = 2
# SystemdCgroup enables systemd cgroups. # SystemdCgroup enables systemd cgroups.
SystemdCgroup = false SystemdCgroup = false
# CriuImagePath is the criu image path
CriuImagePath = ""
# CriuWorkPath is the criu work path.
CriuWorkPath = ""
# 'plugins."io.containerd.grpc.v1.cri".cni' contains config related to cni # 'plugins."io.containerd.grpc.v1.cri".cni' contains config related to cni
[plugins."io.containerd.grpc.v1.cri".cni] [plugins."io.containerd.grpc.v1.cri".cni]
# bin_dir is the directory in which the binaries for the plugin is kept. # bin_dir is the directory in which the binaries for the plugin is kept.

View File

@ -38,7 +38,7 @@ func DefaultConfig() PluginConfig {
NoPivot: false, NoPivot: false,
Runtimes: map[string]Runtime{ Runtimes: map[string]Runtime{
"runc": { "runc": {
Type: "io.containerd.runc.v1", Type: "io.containerd.runc.v2",
}, },
}, },
}, },

View File

@ -298,7 +298,7 @@ func (c *criService) cleanupSandboxFiles(id string, config *runtime.PodSandboxCo
func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts { func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts {
// TODO(random-liu): Remove this after shim v1 is deprecated. // TODO(random-liu): Remove this after shim v1 is deprecated.
var taskOpts []containerd.NewTaskOpts var taskOpts []containerd.NewTaskOpts
if c.config.NoPivot && runtimeType == plugin.RuntimeRuncV1 { if c.config.NoPivot && (runtimeType == plugin.RuntimeRuncV1 || runtimeType == plugin.RuntimeRuncV2) {
taskOpts = append(taskOpts, containerd.WithNoPivotRoot) taskOpts = append(taskOpts, containerd.WithNoPivotRoot)
} }
return taskOpts return taskOpts