Add helper scripts for storage management: install-local-path-storage.sh: - Installs Rancher local-path-provisioner - Sets it as default storage class - Useful for local testing and single-node scenarios - Alternative to NFS for simpler setups diagnose-storage.sh: - Diagnoses storage-related issues - Checks for provisioner installation - Lists storage classes and PVC status - Identifies pods stuck due to storage problems 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
88 lines
2.1 KiB
Bash
Executable File
88 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Colors for output
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
log_info() {
|
|
echo -e "${BLUE}[INFO]${NC} $1"
|
|
}
|
|
|
|
log_success() {
|
|
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
}
|
|
|
|
log_warning() {
|
|
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
}
|
|
|
|
log_error() {
|
|
echo -e "${RED}[ERROR]${NC} $1"
|
|
}
|
|
|
|
echo "=========================================="
|
|
echo "Storage Diagnostics"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Check storage classes
|
|
log_info "Checking available storage classes..."
|
|
kubectl get storageclass
|
|
echo ""
|
|
|
|
# Check PVCs
|
|
log_info "Checking PersistentVolumeClaims in gitlab namespace..."
|
|
kubectl get pvc -n gitlab
|
|
echo ""
|
|
|
|
# Check PVC details
|
|
log_info "Detailed PVC status..."
|
|
kubectl describe pvc -n gitlab
|
|
echo ""
|
|
|
|
# Check pods
|
|
log_info "Checking pods in gitlab namespace..."
|
|
kubectl get pods -n gitlab
|
|
echo ""
|
|
|
|
# Check pod events
|
|
log_info "Checking events in gitlab namespace..."
|
|
kubectl get events -n gitlab --sort-by='.lastTimestamp' | tail -20
|
|
echo ""
|
|
|
|
# Summary and recommendations
|
|
echo "=========================================="
|
|
log_info "Summary and Recommendations"
|
|
echo "=========================================="
|
|
|
|
# Check if storage class exists
|
|
if kubectl get storageclass 2>&1 | grep -q "No resources found"; then
|
|
log_error "No storage class found!"
|
|
echo ""
|
|
log_info "Talos Linux does not include a default storage provisioner."
|
|
log_info "You need to install one of the following:"
|
|
echo ""
|
|
echo " 1. Local Path Provisioner (simple, single-node)"
|
|
echo " - Best for testing/development"
|
|
echo " - Uses local node storage"
|
|
echo ""
|
|
echo " 2. OpenEBS (distributed, multi-node)"
|
|
echo " - Production-ready"
|
|
echo " - Supports replication"
|
|
echo ""
|
|
echo " 3. Rook-Ceph (distributed, enterprise)"
|
|
echo " - Full-featured storage solution"
|
|
echo " - More complex setup"
|
|
echo ""
|
|
log_info "I recommend starting with Local Path Provisioner for simplicity."
|
|
else
|
|
log_success "Storage class found"
|
|
fi
|
|
|
|
echo ""
|