Merge pull request #1372 from cofyc/update-config-syntax
update config syntax in registry.md
This commit is contained in:
commit
c988d797be
@ -1,6 +1,10 @@
|
|||||||
# Configure Image Registry
|
# Configure Image Registry
|
||||||
This document describes the method to configure the image registry for `containerd` for use with the `cri` plugin.
|
This document describes the method to configure the image registry for `containerd` for use with the `cri` plugin.
|
||||||
|
|
||||||
|
NOTE: The configuration syntax used in this doc is in version 2 which is the
|
||||||
|
recommended since `containerd` 1.3. If your configuration is still in version 1,
|
||||||
|
you can replace `"io.containerd.grpc.v1.cri"` with `cri`.
|
||||||
|
|
||||||
## Configure Registry Endpoint
|
## Configure Registry Endpoint
|
||||||
With containerd, `docker.io` is the default image registry. You can also set up other image registries similar to docker.
|
With containerd, `docker.io` is the default image registry. You can also set up other image registries similar to docker.
|
||||||
|
|
||||||
@ -8,15 +12,18 @@ To configure image registries create/modify the `/etc/containerd/config.toml` as
|
|||||||
```toml
|
```toml
|
||||||
# Config file is parsed as version 1 by default.
|
# Config file is parsed as version 1 by default.
|
||||||
# To use the long form of plugin names set "version = 2"
|
# To use the long form of plugin names set "version = 2"
|
||||||
[plugins.cri.registry.mirrors]
|
# explicitly use v2 config format
|
||||||
[plugins.cri.registry.mirrors."docker.io"]
|
version = 2
|
||||||
|
|
||||||
|
[plugin."io.containerd.grpc.v1.cri".registry.mirrors]
|
||||||
|
[plugin."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
|
||||||
endpoint = ["https://registry-1.docker.io"]
|
endpoint = ["https://registry-1.docker.io"]
|
||||||
[plugins.cri.registry.mirrors."test.https-registry.io"]
|
[plugin."io.containerd.grpc.v1.cri".registry.mirrors."test.https-registry.io"]
|
||||||
endpoint = ["https://HostIP1:Port1"]
|
endpoint = ["https://HostIP1:Port1"]
|
||||||
[plugins.cri.registry.mirrors."test.http-registry.io"]
|
[plugin."io.containerd.grpc.v1.cri".registry.mirrors."test.http-registry.io"]
|
||||||
endpoint = ["http://HostIP2:Port2"]
|
endpoint = ["http://HostIP2:Port2"]
|
||||||
# wildcard matching is supported but not required.
|
# wildcard matching is supported but not required.
|
||||||
[plugins.cri.registry.mirrors."*"]
|
[plugin."io.containerd.grpc.v1.cri".registry.mirrors."*"]
|
||||||
endpoint = ["https://HostIP3:Port3"]
|
endpoint = ["https://HostIP3:Port3"]
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -40,9 +47,12 @@ After modify this config, you need restart the `containerd` service.
|
|||||||
|
|
||||||
To configure the TLS settings for a specific registry, create/modify the `/etc/containerd/config.toml` as follows:
|
To configure the TLS settings for a specific registry, create/modify the `/etc/containerd/config.toml` as follows:
|
||||||
```toml
|
```toml
|
||||||
|
# explicitly use v2 config format
|
||||||
|
version = 2
|
||||||
|
|
||||||
# The registry host has to be a domain name or IP. Port number is also
|
# 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.
|
# needed if the default HTTPS or HTTP port is not used.
|
||||||
[plugins.cri.registry.configs."my.custom.registry".tls]
|
[plugin."io.containerd.grpc.v1.cri".registry.configs."my.custom.registry".tls]
|
||||||
ca_file = "ca.pem"
|
ca_file = "ca.pem"
|
||||||
cert_file = "cert.pem"
|
cert_file = "cert.pem"
|
||||||
key_file = "key.pem"
|
key_file = "key.pem"
|
||||||
@ -54,13 +64,19 @@ In the config example shown above, TLS mutual authentication will be used for co
|
|||||||
`cert_file` and `key_file` are not needed when TLS mutual authentication is unused.
|
`cert_file` and `key_file` are not needed when TLS mutual authentication is unused.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[plugins.cri.registry.configs."my.custom.registry".tls]
|
# explicitly use v2 config format
|
||||||
|
version = 2
|
||||||
|
|
||||||
|
[plugin."io.containerd.grpc.v1.cri".registry.configs."my.custom.registry".tls]
|
||||||
ca_file = "ca.pem"
|
ca_file = "ca.pem"
|
||||||
```
|
```
|
||||||
|
|
||||||
To skip the registry certificate verification:
|
To skip the registry certificate verification:
|
||||||
```
|
```toml
|
||||||
[plugins.cri.registry.configs."my.custom.registry".tls]
|
# explicitly use v2 config format
|
||||||
|
version = 2
|
||||||
|
|
||||||
|
[plugin."io.containerd.grpc.v1.cri".registry.configs."my.custom.registry".tls]
|
||||||
insecure_skip_verify = true
|
insecure_skip_verify = true
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -71,9 +87,12 @@ To skip the registry certificate verification:
|
|||||||
To configure a credential for a specific registry, create/modify the
|
To configure a credential for a specific registry, create/modify the
|
||||||
`/etc/containerd/config.toml` as follows:
|
`/etc/containerd/config.toml` as follows:
|
||||||
```toml
|
```toml
|
||||||
|
# explicitly use v2 config format
|
||||||
|
version = 2
|
||||||
|
|
||||||
# The registry host has to be a domain name or IP. Port number is also
|
# 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.
|
# needed if the default HTTPS or HTTP port is not used.
|
||||||
[plugins.cri.registry.configs.auths."https://gcr.io"]
|
[plugin."io.containerd.grpc.v1.cri".registry.configs."gcr.io".auth]
|
||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
auth = ""
|
auth = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user