diff --git a/.gitignore b/.gitignore index 53077780..a02f5c39 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ dist/ .devbox .envrc.local +kubeconfig diff --git a/hack/self-hosted-registry-demo/bootstrap-images.txt b/hack/self-hosted-registry-demo/bootstrap-images.txt new file mode 100644 index 00000000..a1f15a4a --- /dev/null +++ b/hack/self-hosted-registry-demo/bootstrap-images.txt @@ -0,0 +1,5 @@ +quay.io/cilium/certgen:v0.2.0 +quay.io/cilium/cilium-envoy:v1.29.9-1726784081-a90146d13b4cd7d168d573396ccf2b3db5a3b047 +quay.io/cilium/cilium:v1.16.2 +quay.io/cilium/operator-generic:v1.16.2 +registry.k8s.io/coredns/coredns:v1.11.1 diff --git a/hack/self-hosted-registry-demo/demo.sh b/hack/self-hosted-registry-demo/demo.sh new file mode 100755 index 00000000..acf8fb34 --- /dev/null +++ b/hack/self-hosted-registry-demo/demo.sh @@ -0,0 +1,270 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +readonly SCRIPT_DIR + +GIT_ROOT="$(git rev-parse --show-toplevel)" +readonly GIT_ROOT + +MINDTHEGAP_VERSION="$(gojq -r .version "${GIT_ROOT}/dist/metadata.json")" +readonly MINDTHEGAP_VERSION + +IMAGE_VERSION="${MINDTHEGAP_VERSION}-$(go env GOARCH)" +readonly IMAGE_VERSION + +# Build the image bundle +"${GIT_ROOT}/dist/mindthegap_$(go env GOOS)_$(go env GOARCH)/mindthegap" \ + create bundle \ + --images-file "${SCRIPT_DIR}/bootstrap-images.txt" \ + --output-file "${SCRIPT_DIR}/bundle.tar" \ + --platform linux/"$(go env GOARCH)" \ + --image-pull-concurrency 20 \ + --overwrite + +export KUBECONFIG="${SCRIPT_DIR}/kubeconfig" + +# Create the kind cluster, mounting the bundle into the control-plane node of the KinD cluster +kind create cluster --name self-hosted-registry-demo --config <( + cat </dev/null +server = "http://10.96.0.20" + +# See https://github.com/containerd/containerd/issues/10027 for containerd bug that requires this workaround, +# having an empty host tree here. +[host] +EOF +done + +# Create the registry pod. +cat <