Skip to content

Commit 588f8a0

Browse files
Fix broken setup script for kind 0.8 (#62)
1 parent 85ad151 commit 588f8a0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/dev/setup_kind_cluster.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22
set -Eeou pipefail
33

4+
# create the kind network early unless it already exists.
5+
# it would normally be created automatically by kind but we
6+
# need it earlier to get the IP address of our registry.
7+
docker network create kind || true
48

59
# adapted from https://kind.sigs.k8s.io/docs/user/local-registry/
610
# create registry container unless it already exists
@@ -9,11 +13,12 @@ reg_port='5000'
913
running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
1014
if [ "${running}" != 'true' ]; then
1115
docker run \
12-
-d --restart=always -p "${reg_port}:${reg_port}" --name "${reg_name}" \
16+
-d --restart=always -p "${reg_port}:${reg_port}" --name "${reg_name}" --network kind \
1317
registry:2
1418
fi
1519

16-
ip="$(docker inspect kind-registry -f '{{.NetworkSettings.IPAddress}}')"
20+
# find registry IP inside the kind network
21+
ip="$(docker inspect kind-registry -f '{{.NetworkSettings.Networks.kind.IPAddress}}')"
1722

1823
# create a cluster with the local registry enabled in containerd
1924
cat <<EOF | kind create cluster --kubeconfig ~/.kube/kind --config=-

0 commit comments

Comments
 (0)