Add Longhorn setup script and integrate into setup-all.sh

This commit is contained in:
2025-05-24 10:18:32 -07:00
parent 51ff5a6c42
commit bb925d56da
5 changed files with 5229 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# Longhorn Storage
See: [Longhorn Docs v 1.8.1](https://longhorn.io/docs/1.8.1/deploy/install/install-with-kubectl/)
## Installation Notes
- Manifest copied from https://raw.githubusercontent.com/longhorn/longhorn/v1.8.1/deploy/longhorn.yaml
- Using kustomize to apply custom configuration (see `kustomization.yaml`)
## Important Settings
- **Number of Replicas**: Set to 1 (default is 3) to accommodate smaller clusters
- This avoids "degraded" volumes when fewer than 3 nodes are available
- For production with 3+ nodes, consider changing back to 3 for better availability
## Common Operations
- View volumes: `kubectl get volumes.longhorn.io -n longhorn-system`
- Check volume status: `kubectl describe volumes.longhorn.io <volume-name> -n longhorn-system`
- Access Longhorn UI: Set up port-forwarding with `kubectl -n longhorn-system port-forward service/longhorn-frontend 8080:80`

View File

@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- longhorn.yaml

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,9 @@ chmod +x *.sh
# Setup MetalLB (must be first for IP allocation) # Setup MetalLB (must be first for IP allocation)
./setup-metallb.sh ./setup-metallb.sh
# Setup Longhorn
./setup-longhorn.sh
# Setup Traefik # Setup Traefik
./setup-traefik.sh ./setup-traefik.sh

View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -e
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
cd "$SCRIPT_DIR"
if [[ -f "../load-env.sh" ]]; then
source ../load-env.sh
fi
echo "Setting up Longhorn..."
# Apply Longhorn with kustomize to apply our customizations
kubectl apply -k ${SCRIPT_DIR}/longhorn/
echo "Longhorn setup complete!"