@@ -21,7 +21,7 @@ set -eo pipefail
2121set -x
2222
2323KIND_CLUSTER_NAME=kind
24- KIND_CLUSTER_IMAGE=${KIND_CLUSTER_IMAGE:- kindest/ node: v1.28.0 } # Important! k8s v1.25.0 brings breaking changes.
24+ KIND_CLUSTER_IMAGE=${KIND_CLUSTER_IMAGE:- kindest/ node: v1.35.1 } # Important! k8s v1.25.0 brings breaking changes.
2525KIND_API_SERVER_ADDRESS=${KIND_API_SERVER_ADDRESS:- 127.0.0.1}
2626KIND_API_SERVER_PORT=${KIND_API_SERVER_PORT:- 8888}
2727CONTAINER_REGISTRY_NAME=${CONTAINER_REGISTRY_NAME:- kind-registry}
@@ -78,14 +78,27 @@ networking:
7878# create a cluster with the local registry enabled in containerd
7979containerdConfigPatches:
8080- |-
81- [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${CONTAINER_REGISTRY_PORT} "]
82- endpoint = ["http://${CONTAINER_REGISTRY_NAME} :${CONTAINER_REGISTRY_PORT} "]
81+ [plugins."io.containerd.grpc.v1.cri".registry]
82+ config_path = "/etc/containerd/certs.d"
83+
8384EOF
8485
86+ # Configure registry for containerd 2.x using config_path mode
87+ for node in $( kind get nodes --name $KIND_CLUSTER_NAME ) ;
88+ do
89+ docker exec " $node " mkdir -p " /etc/containerd/certs.d/localhost:${CONTAINER_REGISTRY_PORT} "
90+ docker exec " $node " sh -c " cat > /etc/containerd/certs.d/localhost:${CONTAINER_REGISTRY_PORT} /hosts.toml <<EOT
91+ server = \" http://localhost:${CONTAINER_REGISTRY_PORT} \"
92+
93+ [host.\" http://${CONTAINER_REGISTRY_NAME} :${CONTAINER_REGISTRY_PORT} \" ]
94+ capabilities = [\" pull\" , \" resolve\" , \" push\" ]
95+ EOT"
96+ done
97+
8598 #
8699 # Work around a bug in KIND where DNS is not always resolved correctly on machines with IPv6
87100 #
88- for node in $( kind get nodes) ;
101+ for node in $( kind get nodes --name $KIND_CLUSTER_NAME ) ;
89102 do
90103 docker exec " $node " sysctl net.ipv4.conf.all.route_localnet=1;
91104 done
0 commit comments