Update config.toml.j2 (#8340) (#8602)

* Update config.toml.j2

i think this commit code is not completed works

exam registry address : a.com:5000

insecure registry must be http://a.com:5000

but this code add insecure a.com:5000 (without http://)

If there is no http, containerd accesses with https even if insecure_skip_verify = true

solution is code edit

* Update config.toml.j2

* Update containerd.yml

* Update containerd.yml

* Update containerd.yml

* Update config.toml.j2

(cherry picked from commit dda557ed23)

Co-authored-by: Choi Yongbeom <59861163+mircyb@users.noreply.github.com>
This commit is contained in:
Takuya Murakami 2022-03-09 23:22:13 +09:00 committed by GitHub
parent 0c43883e5c
commit 019bcbc893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -33,10 +33,11 @@
## An obvious use case is allowing insecure-registry access to self hosted registries. ## An obvious use case is allowing insecure-registry access to self hosted registries.
## Can be ipaddress and domain_name. ## Can be ipaddress and domain_name.
## example define mirror.registry.io or 172.19.16.11:5000 ## example define mirror.registry.io or 172.19.16.11:5000
## set "name": "url". insecure url must be started http://
## Port number is also needed if the default HTTPS port is not used. ## Port number is also needed if the default HTTPS port is not used.
# containerd_insecure_registries: # containerd_insecure_registries:
# - mirror.registry.io # "localhost": "http://127.0.0.1"
# - 172.19.16.11:5000 # "172.19.16.11:5000": "http://172.19.16.11:5000"
# containerd_registries: # containerd_registries:
# "docker.io": "https://registry-1.docker.io" # "docker.io": "https://registry-1.docker.io"

View file

@ -54,12 +54,14 @@ oom_score = {{ containerd_oom_score }}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"] endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"]
{% endfor %} {% endfor %}
{% for addr in containerd_insecure_registries %} {% if containerd_insecure_registries is defined and containerd_insecure_registries|length>0 %}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ addr }}"] {% for registry, addr in containerd_insecure_registries.items() %}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"] endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"]
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ addr }}".tls] [plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry }}".tls]
insecure_skip_verify = true insecure_skip_verify = true
{% endfor %} {% endfor %}
{% endif %}
{% for registry in containerd_registry_auth if registry['registry'] is defined %} {% for registry in containerd_registry_auth if registry['registry'] is defined %}
{% if (registry['username'] is defined and registry['password'] is defined) or registry['auth'] is defined %} {% if (registry['username'] is defined and registry['password'] is defined) or registry['auth'] is defined %}
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry['registry'] }}".auth] [plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry['registry'] }}".auth]