From ef51fd692df2409087d5f976bf08e248d4db9357 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani <45800463+rchincha@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:37:13 -0700 Subject: [PATCH] feat: add a kind cluster example (#1378) Add examples/kind-with-registry.sh to start a kind cluster with zot as a local registry. Signed-off-by: Ramkumar Chinchani --- examples/kind/kind-with-registry.sh | 66 +++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 examples/kind/kind-with-registry.sh diff --git a/examples/kind/kind-with-registry.sh b/examples/kind/kind-with-registry.sh new file mode 100755 index 00000000..e040705f --- /dev/null +++ b/examples/kind/kind-with-registry.sh @@ -0,0 +1,66 @@ +#!/bin/sh +set -o errexit + +# Reference: https://kind.sigs.k8s.io/docs/user/local-registry/ + +# set no_proxy if applicable +if [ ! -z "${no_proxy}" ]; then + echo "Updating no_proxy env var"; + export no_proxy=${no_proxy},kind-registry; + export NO_PROXY=${no_proxy}; +fi + +# create registry container unless it already exists +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}" \ + ghcr.io/project-zot/zot-minimal-linux-amd64:latest +fi + +# create a cluster with the local registry enabled in containerd +cat <