Files
local-k8s/setup
T

26 lines
1002 B
Bash
Raw Normal View History

2021-09-14 08:32:10 +02:00
#!/usr/bin/env bash
2021-11-20 08:55:23 +01:00
set -euo pipefail
kind create cluster --config kind/kind.yaml --wait 10m
2021-09-14 08:32:10 +02:00
kubectl create secret docker-registry gitlab \
--docker-server=registry.gitlab.com \
--docker-username=gitlab \
--docker-password="${GITLAB_TOKEN}" \
--docker-email=gitlab@unbound.se
2021-09-14 08:32:10 +02:00
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "gitlab"}]}'
kustomized="$(mktemp --suffix .unboundkind.yaml --tmpdir=/tmp/)"
kubectl kustomize --enable-helm ./kind > "${kustomized}"
kubectl apply -f "${kustomized}" || true
kubectl wait --for=condition=Ready pods -n cert-manager -l app=cert-manager --timeout 5m
kubectl wait --for=condition=Ready pods -n cert-manager -l app=cainjector --timeout 5m
kubectl wait --for=condition=Ready pods -n cert-manager -l app=webhook --timeout 5m
kubectl wait --for=condition=Ready pods --all -n external-secrets --timeout=5m
kubectl apply -f "${kustomized}"
kubectl wait --for=condition=Ready pods --all --timeout=5m