Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update registry config guide #10075

Merged
merged 1 commit into from May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 36 additions & 1 deletion docs/cri/registry.md
Expand Up @@ -5,10 +5,16 @@ This document describes the method to configure the image registry for `containe
> **_NOTE:_** registry.mirrors and registry.configs as previously described in this document
> have been DEPRECATED. As described in [the cri config](./config.md#registry-configuration) you
> should now use the following configuration
+ Before containerd 2.0
```toml
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
```
+ In containerd 2.0
```toml
[plugins."io.containerd.cri.v1.images".registry]
config_path = "/etc/containerd/certs.d"
```

## Configure Registry Credentials

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

+ Before containerd 2.0
```toml
# explicitly use v2 config format
version = 2
Expand All @@ -32,6 +39,19 @@ version = 2
auth = ""
identitytoken = ""
```
+ In containerd 2.0
```toml
# explicitly use v3 config format
version = 3

# The registry host has to be a domain name or IP. Port number is also
# needed if the default HTTPS or HTTP port is not used.
[plugins."io.containerd.cri.v1.images".registry.configs."gcr.io".auth]
username = ""
password = ""
auth = ""
identitytoken = ""
```

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

Expand Down Expand Up @@ -75,7 +95,7 @@ Now that you know you can access your GCR from your terminal, it is now time to
Edit the containerd config (default location is at `/etc/containerd/config.toml`)
to add your JSON key for `gcr.io` domain image pull
requests:

+ Before containerd 2.0
```toml
version = 2

Expand All @@ -90,6 +110,21 @@ version = 2
username = "_json_key"
password = 'paste output from jq'
```
+ In containerd 2.0
```toml
version = 3

[plugins."io.containerd.cri.v1.images".registry]
[plugins."io.containerd.cri.v1.images".registry.mirrors]
[plugins."io.containerd.cri.v1.images".registry.mirrors."docker.io"]
endpoint = ["https://registry-1.docker.io"]
[plugins."io.containerd.cri.v1.images".registry.mirrors."gcr.io"]
endpoint = ["https://gcr.io"]
[plugins."io.containerd.cri.v1.images".registry.configs]
[plugins."io.containerd.cri.v1.images".registry.configs."gcr.io".auth]
username = "_json_key"
password = 'paste output from jq'
```

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

Expand Down
8 changes: 8 additions & 0 deletions docs/hosts.md
Expand Up @@ -33,12 +33,20 @@ been **DEPRECATED**._ You should now point your registry `config_path` to the pa
`hosts.toml` files are located.

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

[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
```
+ In containerd 2.0
```
version = 3
[plugins."io.containerd.cri.v1.images".registry]
config_path = "/etc/containerd/certs.d"
```

## Support for Docker's Certificate File Pattern

Expand Down