Skip to content

Commit 195fc74

Browse files
committed
docs: migrate config v1 to v2
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 84cebaf commit 195fc74

File tree

9 files changed

+60
-16
lines changed

9 files changed

+60
-16
lines changed

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

@@ -87,15 +87,15 @@ The following plugins are enabled by default and their settings are shown below.
8787
Plugins that are not enabled by default will provide their own configuration values
8888
documentation.
8989

90-
- **[plugins.cgroup]** has one option __no_prometheus__ (Default: **false**)
91-
- **[plugins.diff]** has one option __default__, a list by default set to **["walking"]**
90+
- **[plugins."io.containerd.monitor.v1.cgroups"]** has one option __no_prometheus__ (Default: **false**)
91+
- **[plugins."io.containerd.service.v1.diff-service"]** has one option __default__, a list by default set to **["walking"]**
9292
- **[plugins."io.containerd.gc.v1.scheduler"]** has several options that perform advanced tuning for the scheduler:
9393
- **pause_threshold** is the maximum amount of time GC should be scheduled (Default: **0.02**),
9494
- **deletion_threshold** guarantees GC is scheduled after n number of deletions (Default: **0** [not triggered]),
9595
- **mutation_threshold** guarantees GC is scheduled after n number of database mutations (Default: **100**),
9696
- **schedule_delay** defines the delay after trigger event before scheduling a GC (Default **"0ms"** [immediate]),
9797
- **startup_delay** defines the delay after startup before scheduling a GC (Default **"100ms"**)
98-
- **[plugins."io.containerd.runtime-shim.v2.shim"]** specifies options for configuring the runtime shim:
98+
- **[plugins."io.containerd.runtime.v2.task"]** specifies options for configuring the runtime shim:
9999
- **platforms** specifies the list of supported platforms
100100
- **sched_core** Core scheduling is a feature that allows only trusted tasks
101101
to run concurrently on cpus sharing compute resources (eg: hyperthreads on
@@ -152,6 +152,8 @@ the main config.
152152
The following is a complete **config.toml** default configuration example:
153153

154154
```
155+
version = 2
156+
155157
root = "/var/lib/containerd"
156158
state = "/run/containerd"
157159
oom_score = 0
@@ -176,17 +178,17 @@ imports = ["/etc/containerd/runtime_*.toml", "./debug.toml"]
176178
path = ""
177179
178180
[plugins]
179-
[plugins.cgroups]
181+
[[plugins."io.containerd.monitor.v1.cgroups"]
180182
no_prometheus = false
181-
[plugins.diff]
183+
[plugins."io.containerd.service.v1.diff-service"]
182184
default = ["walking"]
183-
[plugins.scheduler]
185+
[plugins."io.containerd.gc.v1.scheduler"]
184186
pause_threshold = 0.02
185187
deletion_threshold = 0
186188
mutation_threshold = 100
187189
schedule_delay = 0
188190
startup_delay = "100ms"
189-
[plugins."io.containerd.runtime-shim.v2.shim"]
191+
[plugins."io.containerd.runtime.v2.task"]
190192
platforms = ["linux/amd64"]
191193
sched_core = true
192194
[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
@@ -212,7 +214,9 @@ Both modes share backing data, while "shared" will reduce total bandwidth across
212214
The default is "shared". While this is largely the most desired policy, one can change to "isolated" mode with the following configuration:
213215

214216
```toml
215-
[plugins.bolt]
217+
version = 2
218+
219+
[plugins."io.containerd.metadata.v1.bolt"]
216220
content_sharing_policy = "isolated"
217221
```
218222

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)