Skip to content

Commit f8cad30

Browse files
committed
Remove additional changes
1 parent 335151d commit f8cad30

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

scripts/dev/setup_kind_cluster.sh

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ reg_name='kind-registry'
5656
reg_port='5000'
5757
running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
5858
if [ "${running}" != 'true' ]; then
59-
docker run -d --restart=always -p "127.0.0.1:${reg_port}:5000" --network kind --name "${reg_name}" registry:2
59+
docker run -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" registry:2
6060
fi
6161

6262
if [ "${recreate}" != 0 ]; then
@@ -72,26 +72,10 @@ networking:
7272
serviceSubnet: "${service_network}"
7373
containerdConfigPatches:
7474
- |-
75-
[plugins."io.containerd.grpc.v1.cri".registry]
76-
config_path = "/etc/containerd/certs.d"
75+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]
76+
endpoint = ["http://${reg_name}:${reg_port}"]
7777
EOF
7878

79-
# Add the registry config to the nodes
80-
#
81-
# This is necessary because localhost resolves to loopback addresses that are
82-
# network-namespace local.
83-
# In other words: localhost in the container is not localhost on the host.
84-
#
85-
# We want a consistent name that works from both ends, so we tell containerd to
86-
# alias localhost:${reg_port} to the registry container when pulling images
87-
REGISTRY_DIR="/etc/containerd/certs.d/localhost:${reg_port}"
88-
for node in $(kind get nodes --name "${cluster_name}"); do
89-
docker exec "${node}" mkdir -p "${REGISTRY_DIR}"
90-
cat <<EOF | docker exec -i "${node}" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml"
91-
[host."http://${reg_name}:5000"]
92-
EOF
93-
done
94-
9579
# connect the registry to the cluster network if not already connected
9680
if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then
9781
docker network connect "kind" "${reg_name}"

0 commit comments

Comments
 (0)