Skip to content

Commit 042e49f

Browse files
mikebrowdmcgowan
authored andcommitted
adds credentials description
Signed-off-by: Mike Brown <[email protected]> (cherry picked from commit 6e249b1) Signed-off-by: Derek McGowan <[email protected]>
1 parent aeee093 commit 042e49f

1 file changed

Lines changed: 54 additions & 15 deletions

File tree

docs/hosts.md

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
# Registry Configuration - Introduction
33

44
Configuring registries will be done by specifying (optionally) a `hosts.toml` file for
5-
each desired registry host in a configuration directory. **Updates under this directory
6-
do not require restarting the containerd daemon.**
5+
each desired registry host in a configuration directory. **Note**: Updates under this directory
6+
do not require restarting the containerd daemon.
77

88
## Specifying the Configuration Directory
99

10-
## Using Host Namespace Configs with CTR
10+
### Using Host Namespace Configs with CTR
1111

1212
When pulling via `ctr` use the `--hosts-dir` option:
1313
```
1414
ctr images pull --hosts-dir "/etc/containerd/certs.d"
1515
```
1616

17-
## CRI
17+
### CRI
1818
_The old CRI config pattern for specifying registry.mirrors and registry.configs has
19-
been **DEPRECATED**._ You should now point your registry `config_path` to path where your
19+
been **DEPRECATED**._ You should now point your registry `config_path` to the path where your
2020
`hosts.toml` files are located.
2121

2222
Modify your `config.toml` (default location: `/etc/containerd/config.toml`) as follows:
@@ -42,7 +42,7 @@ host names. For example, docker.io, quay.io, gcr.io, and ghcr.io.
4242

4343
A registry host namespace is, for the purpose of containerd registry configuration, a
4444
path to the `hosts.toml` file specified by the registry host name, or ip address, and an
45-
optional port identifier. When makeing a pull request for an image the format is
45+
optional port identifier. When making a pull request for an image the format is
4646
typically as follows:
4747
```
4848
pull [registry_host_name|IP address][:port][/v2][/org_path]<image_name>[:tag|@DIGEST]
@@ -69,6 +69,45 @@ pull myregistry.io:5000/image_name:tag
6969
```
7070
The pull will resolve to `https://myregistry.io:5000/v2/image_name:tag`
7171

72+
## Specifying Registry Credentials
73+
74+
### CTR
75+
76+
When performing image operations via `ctr` use the --help option to get a list of options you can set for specifying credentials:
77+
```
78+
ctr i pull --help
79+
...
80+
OPTIONS:
81+
--skip-verify, -k skip SSL certificate validation
82+
--plain-http allow connections using plain HTTP
83+
--user value, -u value user[:password] Registry user and password
84+
--refresh value refresh token for authorization server
85+
--hosts-dir value Custom hosts configuration directory
86+
--tlscacert value path to TLS root CA
87+
--tlscert value path to TLS client certificate
88+
--tlskey value path to TLS client key
89+
--http-dump dump all HTTP request/responses when interacting with container registry
90+
--http-trace enable HTTP tracing for registry interactions
91+
--snapshotter value snapshotter name. Empty value stands for the default value. [$CONTAINERD_SNAPSHOTTER]
92+
--label value labels to attach to the image
93+
--platform value Pull content from a specific platform
94+
--all-platforms pull content and metadata from all platforms
95+
--all-metadata Pull metadata for all platforms
96+
--print-chainid Print the resulting image's chain ID
97+
--max-concurrent-downloads value Set the max concurrent downloads for each pull (default: 0)
98+
```
99+
100+
## CRI
101+
102+
Although we have deprecated the old CRI config pattern for specifying registry.mirrors
103+
and registry.configs you can still specify your credentials via
104+
[CRI config](https://github.com/containerd/containerd/blob/master/docs/cri/registry.md#configure-registry-credentials).
105+
106+
Additionally, the containerd CRI plugin implements/supports the authentication parameters passed in through CRI pull image service requests.
107+
For example, when containerd is the container runtime implementation for `Kubernetes`, the containerd CRI plugin receives
108+
authentication credentials from kubelet as retrieved from
109+
[Kubernetes Image Pull Secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
110+
72111
# Registry Configuration - Examples
73112

74113
### Simple (default) Host Config for Docker
@@ -123,7 +162,7 @@ For each registry host namespace directory in your registry `config_path` you ma
123162
include a `hosts.toml` configuration file. The following root level toml fields
124163
apply to the registry host namespace:
125164

126-
*** Note: All paths specified in the `hosts.toml` file may be absolute or relative
165+
**Note**: All paths specified in the `hosts.toml` file may be absolute or relative
127166
to the `hosts.toml` file.
128167

129168
## server field
@@ -179,17 +218,17 @@ ca = ["/etc/certs/test-1-ca.pem", "/etc/certs/special.pem"]
179218

180219
`client` certificates are configured as follows
181220

182-
`a path`:
221+
a path:
183222
```
184223
client = "/etc/certs/client.pem"
185224
```
186225

187-
`an array of paths`:
226+
an array of paths:
188227
```
189228
client = ["/etc/certs/client-1.pem", "/etc/certs/client-2.pem"]
190229
```
191230

192-
`an array of pairs of paths`:
231+
an array of pairs of paths:
193232
```
194233
client = [["/etc/certs/client.cert", "/etc/certs/client.key"],["/etc/certs/client.pem", ""]]
195234
```
@@ -206,19 +245,19 @@ skip_verify = false
206245

207246
`[header]` contains some number of keys where each key is to one of a string or
208247

209-
`an array of strings as follows`:
248+
an array of strings as follows:
210249
```
211250
[header]
212251
x-custom-1 = "custom header"
213252
```
214253

215-
`or`
254+
or
216255
```
217256
[header]
218257
x-custom-1 = ["custom header part a","part b"]
219258
```
220259

221-
`or`
260+
or
222261
```
223262
[header]
224263
x-custom-1 = "custom header",
@@ -263,8 +302,8 @@ for this registry host namespace:
263302
client = ["/etc/certs/client-1.pem", "/etc/certs/client-2.pem"]
264303
```
265304

266-
**Further, recursion is not supported in the specification of host mirror
267-
namespaces in the hosts.toml file. Thus the following is not allowed/supported:**
305+
**Note**: Recursion is not supported in the specification of host mirror
306+
namespaces in the hosts.toml file. Thus the following is not allowed/supported:
268307
```
269308
[host."http://mirror.registry"]
270309
capabilities = ["pull"]

0 commit comments

Comments
 (0)