This repository was archived by the owner on May 30, 2023. It is now read-only.
explicitly set 'runtime_type' in containerd config#1214
Merged
Conversation
…being unset
The containerd config works in mysterious ways - sometimes it acts hierarchical
with respect to the section headers, other times not. In this case, setting
runc.options resets all the fields of the runc section, including
'runtime_type'. Having an unset runtime_type causes containerd to fail to spawn
containers (but the daemon itself starts succesfully) returning the error:
kubelet[13148]: E0823 11:57:17.030551 13148 remote_runtime.go:116] "RunPodSandbox from runtime service failed" err="rpc error: code = InvalidArgument desc = failed to create containerd container: create container failed validation: container.Runtime.Name must be set: invalid argument"
Explicitly set the runtime_type in all containerd configs, and bump the config
version to 2.
Reported as flatcar/Flatcar#484
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Contributor
|
@jepio reading the |
Contributor
Author
|
I checked two things: $ containerd -c before.toml config dump >a
$ containerd -c after.toml config dump >b
$ diff -up a b
--- a 2021-08-24 07:52:17.000000000 +0000
+++ b 2021-08-24 07:52:13.000000000 +0000
@@ -1,5 +1,5 @@
disabled_plugins = []
-imports = ["before.toml"]
+imports = ["after.toml"]
oom_score = -999
plugin_dir = ""
required_plugins = []
@@ -99,17 +99,7 @@ version = 2
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
- BinaryName = ""
- CriuImagePath = ""
- CriuPath = ""
- CriuWorkPath = ""
- IoGid = 0
- IoUid = 0
- NoNewKeyring = false
- NoPivotRoot = false
- Root = ""
- ShimCgroup = ""
- SystemdCgroup = false
+ SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
base_runtime_spec = ""
So the other fields have default zero values that will be kept. |
Contributor
Author
sayanchowdhury
approved these changes
Aug 24, 2021
jepio
added a commit
that referenced
this pull request
Aug 24, 2021
explicitly set 'runtime_type' in containerd config Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
explicitly set 'runtime_type' in containerd config
The way the SystemdCgroup parameter was being set resulted in 'runtime_type' being unset, which prevents containerd from being used as the kubelet container runtime. Explicitly set in 'runtime_type' to fix the issue.
Fixes flatcar/Flatcar#484
How to use
Rebuild image and deploy kubernetes with containerd as the runtime.
Testing done
CI pending