Skip to content

Commit fcdaf09

Browse files
AkihiroSudathaJeztah
authored andcommitted
docs: migrate config v1 to v2
Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit 195fc74) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 728d5c5 commit fcdaf09

9 files changed

Lines changed: 60 additions & 16 deletions

File tree

docs/PLUGINS.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ section for your given plugin `[proxy_plugins.myplugin]`. The `address` must
5050
refer to a local socket file which the containerd process has access to. The
5151
currently supported types are `snapshot` and `content`.
5252

53-
```
53+
```toml
54+
version = 2
55+
5456
[proxy_plugins]
5557
[proxy_plugins.customsnapshot]
5658
type = "snapshot"
@@ -236,7 +238,7 @@ Plugins are configured using the `[plugins]` section of containerd's config.
236238
Every plugin can have its own section using the pattern `[plugins."<plugin type>.<plugin id>"]`.
237239

238240
example configuration
239-
```
241+
```toml
240242
version = 2
241243

242244
[plugins]
@@ -245,4 +247,27 @@ version = 2
245247
```
246248

247249
To see full configuration example run `containerd config default`.
248-
If you want to get the configuration combined with your configuration, run `containerd config dump`.
250+
If you want to get the configuration combined with your configuration, run `containerd config dump`.
251+
252+
##### Version header
253+
254+
containerd has two configuration versions:
255+
- Version 2 (Recommended): Introduced in containerd 1.3.
256+
- Version 1 (Default): Introduced in containerd 1.0. Deprecated and will be removed in containerd 2.0.
257+
258+
A configuration with Version 2 must have `version = 2` header, and must have
259+
fully qualified plugin IDs in the `[plugins]` section:
260+
```toml
261+
version = 2
262+
263+
[plugins]
264+
[plugins."io.containerd.monitor.v1.cgroups"]
265+
no_prometheus = false
266+
```
267+
268+
A configuration with Version 1 may not have `version` header, and does not need fully qualified plugin IDs.
269+
```toml
270+
[plugins]
271+
[plugins.cgroups]
272+
no_prometheus = false
273+
```

docs/garbage-collection.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ configuration is under the `scheduler` plugin.
140140

141141
The default configuration is represented as...
142142
```.toml
143+
version = 2
143144
[plugins]
144-
[plugins.scheduler]
145+
[plugins."io.containerd.gc.v1.scheduler"]
145146
pause_threshold = 0.02
146147
deletion_threshold = 0
147148
mutation_threshold = 100

docs/hosts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ been **DEPRECATED**._ You should now point your registry `config_path` to the pa
3434

3535
Modify your `config.toml` (default location: `/etc/containerd/config.toml`) as follows:
3636
```toml
37+
version = 2
38+
3739
[plugins."io.containerd.grpc.v1.cri".registry]
3840
config_path = "/etc/containerd/certs.d"
3941
```

docs/man/containerd-config.toml.5.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# /etc/containerd/config.toml 5 08/08/2018
1+
# /etc/containerd/config.toml 5 04/05/2022
22

33
## NAME
44

@@ -85,8 +85,8 @@ The following plugins are enabled by default and their settings are shown below.
8585
Plugins that are not enabled by default will provide their own configuration values
8686
documentation.
8787

88-
- **[plugins.cgroup]** has one option __no_prometheus__ (Default: **false**)
89-
- **[plugins.diff]** has one option __default__, a list by default set to **["walking"]**
88+
- **[plugins."io.containerd.monitor.v1.cgroups"]** has one option __no_prometheus__ (Default: **false**)
89+
- **[plugins."io.containerd.service.v1.diff-service"]** has one option __default__, a list by default set to **["walking"]**
9090
- **[plugins.linux]** has several options for configuring the runtime, shim, and related options:
9191
- **shim** specifies the shim binary (Default: **"containerd-shim"**),
9292
- **runtime** is the OCI compliant runtime binary (Default: **"runc"**),
@@ -99,7 +99,7 @@ documentation.
9999
- **mutation_threshold** guarantees GC is scheduled after n number of database mutations (Default: **100**),
100100
- **schedule_delay** defines the delay after trigger event before scheduling a GC (Default **"0ms"** [immediate]),
101101
- **startup_delay** defines the delay after startup before scheduling a GC (Default **"100ms"**)
102-
- **[plugins."io.containerd.runtime-shim.v2.shim"]** specifies options for configuring the runtime shim:
102+
- **[plugins."io.containerd.runtime.v2.task"]** specifies options for configuring the runtime shim:
103103
- **platforms** specifies the list of supported platforms
104104
- **sched_core** Core scheduling is a feature that allows only trusted tasks
105105
to run concurrently on cpus sharing compute resources (eg: hyperthreads on
@@ -156,6 +156,8 @@ the main config.
156156
The following is a complete **config.toml** default configuration example:
157157

158158
```
159+
version = 2
160+
159161
root = "/var/lib/containerd"
160162
state = "/run/containerd"
161163
oom_score = 0
@@ -180,23 +182,23 @@ imports = ["/etc/containerd/runtime_*.toml", "./debug.toml"]
180182
path = ""
181183
182184
[plugins]
183-
[plugins.cgroups]
185+
[[plugins."io.containerd.monitor.v1.cgroups"]
184186
no_prometheus = false
185-
[plugins.diff]
187+
[plugins."io.containerd.service.v1.diff-service"]
186188
default = ["walking"]
187189
[plugins.linux]
188190
shim = "containerd-shim"
189191
runtime = "runc"
190192
runtime_root = ""
191193
no_shim = false
192194
shim_debug = false
193-
[plugins.scheduler]
195+
[plugins."io.containerd.gc.v1.scheduler"]
194196
pause_threshold = 0.02
195197
deletion_threshold = 0
196198
mutation_threshold = 100
197199
schedule_delay = 0
198200
startup_delay = "100ms"
199-
[plugins."io.containerd.runtime-shim.v2.shim"]
201+
[plugins."io.containerd.runtime.v2.task"]
200202
platforms = ["linux/amd64"]
201203
sched_core = true
202204
[plugins."io.containerd.service.v1.tasks-service"]

docs/managed-opt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Configuration:
1111

1212
*containerd config:*
1313
```toml
14-
[plugins.opt]
14+
version = 2
15+
16+
[plugins."io.containerd.internal.v1.opt"]
1517
path = "/opt/mypath"
1618

1719
```

docs/ops.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ They should not be tampered with as corruption and bugs can and will happen.
154154
External apps reading or watching changes in these directories have been known to cause `EBUSY` and stale file handles when containerd and/or its plugins try to cleanup resources.
155155

156156
```toml
157+
version = 2
158+
157159
# persistent data location
158160
root = "/var/lib/containerd"
159161
# runtime state information
@@ -229,6 +231,8 @@ Both modes share backing data, while "shared" will reduce total bandwidth across
229231
The default is "shared". While this is largely the most desired policy, one can change to "isolated" mode with the following configuration:
230232

231233
```toml
232-
[plugins.bolt]
234+
version = 2
235+
236+
[plugins."io.containerd.metadata.v1.bolt"]
233237
content_sharing_policy = "isolated"
234238
```

docs/stream_processors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Processor Fields:
3333
* `args` - Arguments passed to the processor binary.
3434

3535
```toml
36+
version = 2
37+
3638
[stream_processors]
3739
[stream_processors."io.containerd.processor.v1.pigz"]
3840
accepts = ["application/vnd.docker.image.rootfs.diff.tar.gzip"]

docs/tracing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ By configuring `io.containerd.tracing.processor.v1.otlp` plugin.
99
containerd daemon can send traces to the specified OpenTelemetry endpoint.
1010

1111
```toml
12+
version = 2
13+
1214
[plugins."io.containerd.tracing.processor.v1.otlp"]
1315
endpoint = "http://localhost:4318"
1416
```
@@ -26,6 +28,8 @@ The sampling ratio and the service name on the traces could be configured by
2628
`io.containerd.internal.v1.tracing` plugin.
2729

2830
```toml
31+
version = 2
32+
2933
[plugins."io.containerd.internal.v1.tracing"]
3034
sampling_ratio = 1.0
3135
service_name = "containerd"

snapshots/devmapper/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ This file is typically located at `/etc/containerd/config.toml`.
1010

1111
Here's minimal sample entry that can be made in the configuration file:
1212

13-
```
13+
```toml
14+
version = 2
15+
1416
[plugins]
1517
...
16-
[plugins.devmapper]
18+
[plugins."io.containerd.snapshotter.v1.devmapper"]
1719
pool_name = "containerd-pool"
1820
base_image_size = "8192MB"
1921
...

0 commit comments

Comments
 (0)