Skip to content

Commit c514630

Browse files
committed
docs: update registry config guide
Signed-off-by: Shuaiyi Zhang <[email protected]>
1 parent 8eb03f1 commit c514630

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

docs/cri/registry.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ This document describes the method to configure the image registry for `containe
55
> **_NOTE:_** registry.mirrors and registry.configs as previously described in this document
66
> have been DEPRECATED. As described in [the cri config](./config.md#registry-configuration) you
77
> should now use the following configuration
8+
+ Before containerd 2.0
89
```toml
910
[plugins."io.containerd.grpc.v1.cri".registry]
1011
config_path = "/etc/containerd/certs.d"
1112
```
13+
+ In containerd 2.0
14+
```toml
15+
[plugins."io.containerd.cri.v1.images".registry]
16+
config_path = "/etc/containerd/certs.d"
17+
```
1218

1319
## Configure Registry Credentials
1420

@@ -20,6 +26,7 @@ This document describes the method to configure the image registry for `containe
2026
To configure a credential for a specific registry, create/modify the
2127
`/etc/containerd/config.toml` as follows:
2228

29+
+ Before containerd 2.0
2330
```toml
2431
# explicitly use v2 config format
2532
version = 2
@@ -32,6 +39,19 @@ version = 2
3239
auth = ""
3340
identitytoken = ""
3441
```
42+
+ In containerd 2.0
43+
```toml
44+
# explicitly use v3 config format
45+
version = 3
46+
47+
# The registry host has to be a domain name or IP. Port number is also
48+
# needed if the default HTTPS or HTTP port is not used.
49+
[plugins."io.containerd.cri.v1.images".registry.configs."gcr.io".auth]
50+
username = ""
51+
password = ""
52+
auth = ""
53+
identitytoken = ""
54+
```
3555

3656
The meaning of each field is the same with the corresponding field in `.docker/config.json`.
3757

@@ -75,7 +95,7 @@ Now that you know you can access your GCR from your terminal, it is now time to
7595
Edit the containerd config (default location is at `/etc/containerd/config.toml`)
7696
to add your JSON key for `gcr.io` domain image pull
7797
requests:
78-
98+
+ Before containerd 2.0
7999
```toml
80100
version = 2
81101

@@ -90,6 +110,21 @@ version = 2
90110
username = "_json_key"
91111
password = 'paste output from jq'
92112
```
113+
+ In containerd 2.0
114+
```toml
115+
version = 3
116+
117+
[plugins."io.containerd.cri.v1.images".registry]
118+
[plugins."io.containerd.cri.v1.images".registry.mirrors]
119+
[plugins."io.containerd.cri.v1.images".registry.mirrors."docker.io"]
120+
endpoint = ["https://registry-1.docker.io"]
121+
[plugins."io.containerd.cri.v1.images".registry.mirrors."gcr.io"]
122+
endpoint = ["https://gcr.io"]
123+
[plugins."io.containerd.cri.v1.images".registry.configs]
124+
[plugins."io.containerd.cri.v1.images".registry.configs."gcr.io".auth]
125+
username = "_json_key"
126+
password = 'paste output from jq'
127+
```
93128

94129
> Note: `username` of `_json_key` signifies that JSON key authentication will be used.
95130

docs/hosts.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ been **DEPRECATED**._ You should now point your registry `config_path` to the pa
3333
`hosts.toml` files are located.
3434

3535
Modify your `config.toml` (default location: `/etc/containerd/config.toml`) as follows:
36+
+ Before containerd 2.0
3637
```toml
3738
version = 2
3839

3940
[plugins."io.containerd.grpc.v1.cri".registry]
4041
config_path = "/etc/containerd/certs.d"
4142
```
43+
+ In containerd 2.0
44+
```
45+
version = 3
46+
47+
[plugins."io.containerd.cri.v1.images".registry]
48+
config_path = "/etc/containerd/certs.d"
49+
```
4250

4351
## Support for Docker's Certificate File Pattern
4452

0 commit comments

Comments
 (0)