Skip to content

Commit

Permalink
Fixes kind create cluster script that contained a hardcoded IP for th…
Browse files Browse the repository at this point in the history
…e registry configuration in containerd. Instead it now uses the associated IP of the registry container running in Docker (apache#383)

Signed-off-by: Jordi Gil <jgil@redhat.com>
  • Loading branch information
jordigilh authored and rgdoliveira committed Mar 11, 2024
1 parent 1961489 commit 96deaef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hack/ci/create-kind-cluster-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ fi
#
# We want a consistent name that works from both ends, so we tell containerd to
# alias localhost:${reg_port} to the registry container when pulling images
REGISTRY_DIR="/etc/containerd/certs.d/172.18.0.3:5000"
# retrieve IP address of the container connected to the cluster network

# Retrieve IP address of the container connected to the cluster network
IP_ADDRESS=$(docker inspect --format='{{(index (index .NetworkSettings.Networks "kind") ).IPAddress}}' ${reg_name})

REGISTRY_DIR="/etc/containerd/certs.d/${IP_ADDRESS}:5000"
for node in $(kind get nodes); do
docker exec "${node}" mkdir -p "${REGISTRY_DIR}"
cat <<EOF | docker exec -i "${node}" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml"
Expand Down

0 comments on commit 96deaef

Please sign in to comment.