How to trust an insecure image registry?
TOC
Problem description
The image registry hosting platform component images may not provide HTTPS service or may not have a valid TLS certificate issued by a public certificate authority. If you trust this registry, configure your container runtime by following the steps below.
Configure trust for an insecure image registry
Configuration steps vary by container runtime. This document covers Docker and Containerd.
Docker runtime
Steps
-
Run the following on every node in the import cluster:
-
Back up the Docker configuration file.
-
Edit
/etc/docker/daemon.json.Ensure the
insecure-registriesparameter exists and add the image registry address obtained earlier. For multiple registries, for example:
-
-
(Optional) Validate Docker config syntax with jq.
TIPEnsure
jqis installed. For example:yum install jq -y. -
Restart Docker on all nodes.
Containerd runtime
Notes:
- All nodes that need to use images, including newly added nodes, must be configured and have Containerd restarted.
- The configuration differs slightly between Containerd v1.4/v1.5 and v1.6. Follow the appropriate steps for your version.
-
Run the following on every node in the import cluster:
-
Back up the configuration file
-
Get the Containerd runtime version
-
-
Run the following on every node in the import cluster:
-
Edit
/etc/containerd/config.toml -
Restart Containerd.
-
-
Run the following on every node in the import cluster:
-
Check whether
config_pathexists in the config. -
Create the
hosts.tomlfile.If the previous command printed
Follow the steps in "Containerd v1.4 v1.5 configuration for insecure registries"., see Containerd v1.4 v1.5 configuration for insecure registries. -
Restart Containerd.
-