Files
homelab/cluster-config/longhorn_bootstrap.sh
Story Crater Bot cb4b7a078a infra: add helmfile and talos cluster configuration
- helmfile: 18 releases across 22 namespaces
- Pod disruption budgets for zero-downtime drain
- Nginx ingress with LoadBalancer + Cilium LB-IPAM
- Cluster bootstrap hooks
2026-08-18 15:07:59 -07:00

20 lines
703 B
Bash

# bootstrap.sh
#!/bin/bash
# Wait for cluster to be ready
kubectl wait --for=condition=Ready nodes --all --timeout=300s
# Longhorn requires privileged pods and hostPath volumes
kubectl create namespace longhorn-system --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace longhorn-system \
pod-security.kubernetes.io/enforce=privileged \
pod-security.kubernetes.io/enforce-version=latest \
--overwrite
# Install Longhorn
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.7.0/deploy/longhorn.yaml
# Set as default StorageClass
kubectl patch storageclass longhorn \
-p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'