Skip to content

Commit 07a402c

Browse files
kvapsclaude
andcommitted
fix(stand): apply StoragePool CRDs from install-pools.sh + per-cluster node names
The dev stand's StoragePool CRDs (stand/blockstor-storagepools.yaml) were never applied to the cluster — install-pools.sh only created the backing zpool / VG / file dir on the satellite container side but never `kubectl apply`-ed the CRDs that drive the satellite's StoragePoolReconciler. Without those CRDs the reconciler never registered any storage.Provider, so every Resource that landed on a satellite hit the empty providers map and the apply chain silently did nothing — e2e symptom: every RD stuck at "never reached UpToDate on both peers" because no backing LV / zvol was created and DRBD couldn't attach to a disk that didn't exist. Also fixes the manifest's hardcoded nodeNames (talos-stand-w1..3) which assumed NAME=stand. The yaml now ships with __WORKER_N__ placeholders and install-pools.sh substitutes them at apply time with the actual worker names discovered from kubectl. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 9cfee77 commit 07a402c

2 files changed

Lines changed: 32 additions & 9 deletions

File tree

stand/blockstor-storagepools.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ kind: StoragePool
2626
metadata:
2727
name: stand-w1
2828
spec:
29-
nodeName: talos-stand-w1
29+
nodeName: __WORKER_1__
3030
poolName: stand
3131
providerKind: FILE_THIN
3232
props:
@@ -37,7 +37,7 @@ kind: StoragePool
3737
metadata:
3838
name: stand-w2
3939
spec:
40-
nodeName: talos-stand-w2
40+
nodeName: __WORKER_2__
4141
poolName: stand
4242
providerKind: FILE_THIN
4343
props:
@@ -48,7 +48,7 @@ kind: StoragePool
4848
metadata:
4949
name: stand-w3
5050
spec:
51-
nodeName: talos-stand-w3
51+
nodeName: __WORKER_3__
5252
poolName: stand
5353
providerKind: FILE_THIN
5454
props:
@@ -64,7 +64,7 @@ kind: StoragePool
6464
metadata:
6565
name: lvm-thin-w1
6666
spec:
67-
nodeName: talos-stand-w1
67+
nodeName: __WORKER_1__
6868
poolName: lvm-thin
6969
providerKind: LVM_THIN
7070
props:
@@ -76,7 +76,7 @@ kind: StoragePool
7676
metadata:
7777
name: lvm-thin-w2
7878
spec:
79-
nodeName: talos-stand-w2
79+
nodeName: __WORKER_2__
8080
poolName: lvm-thin
8181
providerKind: LVM_THIN
8282
props:
@@ -88,7 +88,7 @@ kind: StoragePool
8888
metadata:
8989
name: lvm-thin-w3
9090
spec:
91-
nodeName: talos-stand-w3
91+
nodeName: __WORKER_3__
9292
poolName: lvm-thin
9393
providerKind: LVM_THIN
9494
props:
@@ -104,7 +104,7 @@ kind: StoragePool
104104
metadata:
105105
name: zfs-thin-w1
106106
spec:
107-
nodeName: talos-stand-w1
107+
nodeName: __WORKER_1__
108108
poolName: zfs-thin
109109
providerKind: ZFS_THIN
110110
props:
@@ -115,7 +115,7 @@ kind: StoragePool
115115
metadata:
116116
name: zfs-thin-w2
117117
spec:
118-
nodeName: talos-stand-w2
118+
nodeName: __WORKER_2__
119119
poolName: zfs-thin
120120
providerKind: ZFS_THIN
121121
props:
@@ -126,7 +126,7 @@ kind: StoragePool
126126
metadata:
127127
name: zfs-thin-w3
128128
spec:
129-
nodeName: talos-stand-w3
129+
nodeName: __WORKER_3__
130130
poolName: zfs-thin
131131
providerKind: ZFS_THIN
132132
props:

stand/install-pools.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,26 @@ for pod in $(kubectl -n "$NS" get pods -l app=blockstor-satellite -o name); do
111111
done
112112

113113
echo ">> pools provisioned on all workers"
114+
115+
# Apply StoragePool CRDs so the satellite's StoragePoolReconciler
116+
# discovers them and registers the matching storage.Provider. The
117+
# yaml ships with `__WORKER_N__` placeholders; substitute with the
118+
# actual cluster's worker node names (sorted) before applying.
119+
mapfile -t _WORKERS < <(
120+
kubectl get nodes -l '!node-role.kubernetes.io/control-plane' \
121+
-o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | sort
122+
)
123+
W1="${_WORKERS[0]:-}"
124+
W2="${_WORKERS[1]:-}"
125+
W3="${_WORKERS[2]:-}"
126+
127+
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
128+
echo ">> applying StoragePool CRDs (workers: $W1 $W2 $W3)"
129+
sed -e "s|__WORKER_1__|$W1|g" \
130+
-e "s|__WORKER_2__|$W2|g" \
131+
-e "s|__WORKER_3__|$W3|g" \
132+
"$REPO_ROOT/stand/blockstor-storagepools.yaml" | kubectl apply -f -
133+
134+
echo ">> waiting for satellite StoragePoolReconciler to pick up CRDs"
135+
sleep 5
136+
kubectl get storagepools -o wide

0 commit comments

Comments
 (0)