From bef26cf7a28972842651962c2846d92d1fd2ae52 Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Tue, 31 Oct 2023 17:14:20 +0100 Subject: [PATCH 1/2] Using --net=kind for running the container seem to work, and does not make podman cry, due to the docker network connect call Signed-off-by: Matthias Wessendorf --- site/static/examples/kind-with-registry.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/site/static/examples/kind-with-registry.sh b/site/static/examples/kind-with-registry.sh index d0f76081eb..9fc1088184 100755 --- a/site/static/examples/kind-with-registry.sh +++ b/site/static/examples/kind-with-registry.sh @@ -6,7 +6,7 @@ reg_name='kind-registry' reg_port='5001' if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then docker run \ - -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --net=kind --name "${reg_name}" \ registry:2 fi @@ -43,13 +43,7 @@ for node in $(kind get nodes); do EOF done -# 4. Connect the registry to the cluster network if not already connected -# This allows kind to bootstrap the network but ensures they're on the same network -if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then - docker network connect "kind" "${reg_name}" -fi - -# 5. Document the local registry +# 4. Document the local registry # https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry cat < Date: Fri, 3 Nov 2023 08:21:59 +0100 Subject: [PATCH 2/2] run registry as bridge network Signed-off-by: Matthias Wessendorf --- site/static/examples/kind-with-registry.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/site/static/examples/kind-with-registry.sh b/site/static/examples/kind-with-registry.sh index 9fc1088184..9fe55a821a 100755 --- a/site/static/examples/kind-with-registry.sh +++ b/site/static/examples/kind-with-registry.sh @@ -6,7 +6,7 @@ reg_name='kind-registry' reg_port='5001' if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then docker run \ - -d --restart=always -p "127.0.0.1:${reg_port}:5000" --net=kind --name "${reg_name}" \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --network bridge --name "${reg_name}" \ registry:2 fi @@ -43,7 +43,13 @@ for node in $(kind get nodes); do EOF done -# 4. Document the local registry +# 4. Connect the registry to the cluster network if not already connected +# This allows kind to bootstrap the network but ensures they're on the same network +if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then + docker network connect "kind" "${reg_name}" +fi + +# 5. Document the local registry # https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry cat <