Skip to content

Commit fe7d74e

Browse files
committed
fix: to trust insecure registries for containerd #1515
1 parent 8b14c0b commit fe7d74e

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

roles/containerd/tasks/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
- "/etc/containerd/certs.d/{{ HARBOR_REGISTRY }}"
99
tags: support_private_registry
1010

11+
- name: 准备INSECURE REGISTRY 目录
12+
file:
13+
path: "/etc/containerd/certs.d/{{ item.split('/')[2] }}"
14+
state: directory
15+
loop: "{{ INSECURE_REG }}"
16+
1117
- name: 加载内核模块 overlay
1218
modprobe: name=overlay state=present
1319

@@ -34,10 +40,13 @@
3440
- name: 配置docker.io 加速镜像
3541
template: src=docker.io/hosts.toml.j2 dest=/etc/containerd/certs.d/docker.io/hosts.toml
3642

37-
- name: 配置local_registry 仓库
38-
template: src="easzlab.io.local:5000/hosts.toml.j2" dest=/etc/containerd/certs.d/easzlab.io.local:5000/hosts.toml
43+
- name: 配置信任 INSECURE REGISTRY 仓库
44+
template:
45+
src: hosts.toml.j2
46+
dest: "/etc/containerd/certs.d/{{ item.split('/')[2] }}/hosts.toml"
47+
loop: "{{ INSECURE_REG }}"
3948

40-
- name: 配置{{ HARBOR_REGISTRY }}仓库
49+
- name: 配置信任 {{ HARBOR_REGISTRY }} 仓库
4150
template: src="HARBOR_REGISTRY/hosts.toml.j2" dest=/etc/containerd/certs.d/{{ HARBOR_REGISTRY }}/hosts.toml
4251
tags: support_private_registry
4352

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#https://github.com/containerd/containerd/blob/main/docs/hosts.md
2+
server = "{{ item }}"
3+
4+
[host."{{ item }}"]
5+
capabilities = ["pull", "resolve"]
6+
skip_verify = true

0 commit comments

Comments
 (0)