Add Longhorn setup script and integrate into setup-all.sh
This commit is contained in:
20
infrastructure_setup/longhorn/README.md
Normal file
20
infrastructure_setup/longhorn/README.md
Normal 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`
|
5
infrastructure_setup/longhorn/kustomization.yaml
Normal file
5
infrastructure_setup/longhorn/kustomization.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- longhorn.yaml
|
5185
infrastructure_setup/longhorn/longhorn.yaml
Normal file
5185
infrastructure_setup/longhorn/longhorn.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
|
|
||||||
|
16
infrastructure_setup/setup-longhorn.sh
Executable file
16
infrastructure_setup/setup-longhorn.sh
Executable 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!"
|
Reference in New Issue
Block a user