@@ -63,9 +63,20 @@ _prepare_config() {
6363 local default_registry_port=" 5001"
6464
6565 info " Building manifests..."
66+
67+ # Create certs.d directory structure for containerd 2.0+ local registry
68+ # Structure: certs.d/localhost:PORT/hosts.toml
69+ local certs_d_dir=" $KIND_DIR /certs.d/localhost:${REGISTRY_PORT} "
70+ mkdir -p " $certs_d_dir "
71+ sed < " $KIND_MANIFESTS_DIR /hosts.toml" \
72+ -e " s/$default_registry_name /${KIND_REGISTRY_NAME} /g" \
73+ > " $certs_d_dir /hosts.toml"
74+
75+ # Generate kind config with registry settings and certs.d mount path
6676 sed < " $KIND_MANIFESTS_DIR /kind.yml" \
6777 -e " s/$default_registry_name /${KIND_REGISTRY_NAME} /g" \
6878 -e " s/$default_registry_port /${REGISTRY_PORT} /g" \
79+ -e " s|KIND_DIR_PLACEHOLDER|${KIND_DIR} |g" \
6980 > " $KIND_CONFIG_YAML "
7081
7182 for (( i = 0 ; i < KIND_WORKER_NODES; i++ )) ; do
@@ -76,6 +87,8 @@ _prepare_config() {
7687 containerPath: /proc-host
7788 - hostPath: /usr/src
7889 containerPath: /usr/src
90+ - hostPath: ${KIND_DIR} /certs.d
91+ containerPath: /etc/containerd/certs.d
7992
8093 EOF_NODE
8194 done
@@ -151,10 +164,11 @@ kind_down() {
151164 run $CTR_CMD rm -v -f " ${KIND_REGISTRY_NAME} "
152165
153166 info " Removing all generated files"
154- run rm -f \
167+ run rm -rf \
155168 " $KIND_CONFIG_YAML " \
156169 " $KIND_REGISTRY_YAML " \
157- " $KIND_KUBECONFIG "
170+ " $KIND_KUBECONFIG " \
171+ " $KIND_DIR /certs.d"
158172
159173 ok " kind cluster deleted successfully"
160174}
0 commit comments