From c7420ac75fb21a8ed21533e1f56009e85ba531d9 Mon Sep 17 00:00:00 2001 From: victor Date: Tue, 22 Oct 2024 13:15:50 +0200 Subject: [PATCH] fixed script --- start_cluster..sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 start_cluster..sh diff --git a/start_cluster..sh b/start_cluster..sh new file mode 100644 index 0000000..e7dc0e4 --- /dev/null +++ b/start_cluster..sh @@ -0,0 +1,82 @@ +#!/bin/sh +set -o errexit +# 1. 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" --network bridge --name "${reg_name}" \ + registry:2 +fi + +# 2. Create kind cluster with containerd registry config dir enabled +# TODO: kind will eventually enable this by default and this patch will +# be unnecessary. +# +# See: +# https://github.com/kubernetes-sigs/kind/issues/2875 +# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration +# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md +kind create cluster --config manifests/kind-cluster-config.yaml +# cat <