Skip to content

Commit 5f098dc

Browse files
committed
feat(stand): make blockstor target — install CRDs+controller+satellites
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 0a7955e commit 5f098dc

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

stand/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ KUBECONFIG := $(WORK_DIR)/kubeconfig
1313
export TALOSCONFIG
1414
export KUBECONFIG
1515

16-
.PHONY: stand-help up down reset piraeus oracle smoke smoke-blockstor burnin-blockstor e2e e2e-list use list stand-clean
16+
.PHONY: stand-help up down reset piraeus oracle blockstor smoke smoke-blockstor burnin-blockstor e2e e2e-list use list stand-clean
1717

1818
stand-help: ## list dev-stand targets
1919
@echo "stand targets (use NAME=<cluster>):"
@@ -34,6 +34,9 @@ piraeus: ## install piraeus-operator + linstor-csi (NAME=<n>)
3434
oracle: ## install Java LINSTOR controller as in-cluster oracle (NAME=<n>)
3535
@./stand/install-oracle.sh "$(WORK_DIR)"
3636

37+
blockstor: ## install blockstor CRDs + controller + satellites (NAME=<n>)
38+
@./stand/install-blockstor.sh "$(WORK_DIR)"
39+
3740
smoke: ## run piraeus-stack smoke (PVC + linstor-csi) (NAME=<n>)
3841
@./tests/smoke.sh "$(WORK_DIR)"
3942

stand/install-blockstor.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
#
3+
# usage: install-blockstor.sh WORK_DIR
4+
#
5+
# Wires the blockstor controller + satellite onto a freshly-created
6+
# Talos+QEMU cluster (`make up NAME=<n>`). Idempotent: re-running on a
7+
# cluster that already has blockstor returns 0 with the rolling-update
8+
# bringing the latest images.
9+
#
10+
# Steps:
11+
# 1. apply CRDs from config/crd/bases/
12+
# 2. apply blockstor-deploy.yaml (controller + RBAC + namespace)
13+
# 3. apply blockstor-satellite-daemonset.yaml
14+
# 4. wait for controller + satellites Running
15+
#
16+
# Assumes the host registry on 10.164.0.1:5000 is reachable from the
17+
# cluster (Talos config-patch trusts http for that mirror — see
18+
# stand/up.sh).
19+
20+
set -euo pipefail
21+
22+
WORK_DIR=${1:?work_dir required}
23+
export KUBECONFIG="$WORK_DIR/kubeconfig"
24+
25+
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
26+
27+
echo ">> apply CRDs"
28+
kubectl apply -f "$REPO_ROOT/config/crd/bases/" 2>&1 | tail -5
29+
30+
echo ">> apply controller + RBAC"
31+
kubectl apply -f "$REPO_ROOT/stand/blockstor-deploy.yaml" 2>&1 | tail -5
32+
33+
echo ">> apply satellite DaemonSet"
34+
kubectl apply -f "$REPO_ROOT/stand/blockstor-satellite-daemonset.yaml" 2>&1 | tail -5
35+
36+
echo ">> wait for controller Running"
37+
kubectl -n blockstor-system rollout status deploy/blockstor-controller --timeout=120s
38+
39+
echo ">> wait for satellites (3 workers)"
40+
deadline=$(( $(date +%s) + 180 ))
41+
while (( $(date +%s) < deadline )); do
42+
ready=$(kubectl -n blockstor-system get pods -l app=blockstor-satellite --no-headers 2>/dev/null \
43+
| awk '{print $2}' | grep -c '^1/1$' || true)
44+
if [[ "$ready" == "3" ]]; then
45+
break
46+
fi
47+
sleep 5
48+
done
49+
50+
if [[ "$ready" != "3" ]]; then
51+
echo "FAIL: only $ready/3 satellites Running"
52+
kubectl -n blockstor-system get pods -l app=blockstor-satellite
53+
exit 1
54+
fi
55+
56+
echo ">> blockstor stack ready on $(basename "$WORK_DIR")"

0 commit comments

Comments
 (0)