From 17cacf50665c852a1a64f045ce6b279aaaac86a7 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Tue, 20 Dec 2022 19:01:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20containerd=E6=97=A0=E6=B3=95=E6=8B=89?= =?UTF-8?q?=E5=8F=96harbor=E7=9A=84=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/config.yml | 1 + roles/containerd/templates/config.toml.j2 | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/example/config.yml b/example/config.yml index 6c98f4e..fa3a47c 100644 --- a/example/config.yml +++ b/example/config.yml @@ -200,6 +200,7 @@ HARBOR_VER: "__harbor__" HARBOR_DOMAIN: "harbor.easzlab.io.local" HARBOR_PATH: /var/data HARBOR_TLS_PORT: 8443 +HARBOR_REGISTRY: "{{ HARBOR_DOMAIN }}:{{ HARBOR_TLS_PORT }}" # if set 'false', you need to put certs named harbor.pem and harbor-key.pem in directory 'down' HARBOR_SELF_SIGNED_CERT: true diff --git a/roles/containerd/templates/config.toml.j2 b/roles/containerd/templates/config.toml.j2 index bca426e..07dcebd 100644 --- a/roles/containerd/templates/config.toml.j2 +++ b/roles/containerd/templates/config.toml.j2 @@ -139,11 +139,16 @@ version = 2 [plugins."io.containerd.grpc.v1.cri".registry.configs."easzlab.io.local:5000".tls] insecure_skip_verify = true + [plugins."io.containerd.grpc.v1.cri".registry.configs."{{ HARBOR_REGISTRY }}".tls] + insecure_skip_verify = true + [plugins."io.containerd.grpc.v1.cri".registry.headers] [plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."easzlab.io.local:5000"] endpoint = ["http://easzlab.io.local:5000"] + [plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ HARBOR_REGISTRY }}"] + endpoint = ["https://{{ HARBOR_REGISTRY }}"] {% if ENABLE_MIRROR_REGISTRY %} [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] endpoint = ["https://docker.nju.edu.cn/", "https://kuamavit.mirror.aliyuncs.com"]