#!/usr/bin/env bash # Linux/macOS equivalent of setup_kind.ps1 set -euo pipefail CLUSTER_NAME=${CLUSTER_NAME:-incident-commander} KIND_IMAGE=${KIND_IMAGE:-kindest/node:v1.30.4} REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" echo "==> Checking prerequisites" for bin in docker kind kubectl; do command -v "$bin" >/dev/null 2>&1 || { echo "'$bin' not found on PATH"; exit 1; } done docker info >/dev/null 2>&1 || { echo "Docker daemon not reachable"; exit 1; } if kind get clusters 2>/dev/null | grep -qx "$CLUSTER_NAME"; then echo "==> Cluster '$CLUSTER_NAME' already exists — reusing" else echo "==> Creating kind cluster '$CLUSTER_NAME' ($KIND_IMAGE)" kind create cluster --name "$CLUSTER_NAME" --image "$KIND_IMAGE" --wait 60s fi kubectl cluster-info --context "kind-$CLUSTER_NAME" echo "==> Applying namespaces" kubectl apply -f "$REPO_ROOT/rl-agent/sample_app/namespaces.yaml" echo "==> Applying base deployments" kubectl apply -R -f "$REPO_ROOT/rl-agent/sample_app/base" echo "==> Waiting for pods (~60s)" for ns in ic-payments ic-frontend ic-auth; do kubectl -n "$ns" wait --for=condition=available --timeout=180s deployment --all done kubectl get pods -A cat <