Initial commit: add .gitignore and README
This commit is contained in:
36
monitoring/loki/install.sh
Executable file
36
monitoring/loki/install.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Install Loki Stack for Logging
|
||||
|
||||
set -e
|
||||
|
||||
NAMESPACE="monitoring"
|
||||
RELEASE_NAME="loki"
|
||||
|
||||
echo "📊 Installing Loki Stack..."
|
||||
|
||||
# Check prerequisites
|
||||
command -v helm >/dev/null 2>&1 || { echo "❌ helm not found"; exit 1; }
|
||||
command -v kubectl >/dev/null 2>&1 || { echo "❌ kubectl not found"; exit 1; }
|
||||
|
||||
# Create namespace
|
||||
echo "📦 Creating namespace: $NAMESPACE"
|
||||
kubectl create namespace "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
# Add Grafana Helm repo
|
||||
echo "📥 Adding Grafana Helm repository..."
|
||||
helm repo add grafana https://grafana.github.io/helm-charts
|
||||
helm repo update
|
||||
|
||||
# Install Loki Stack
|
||||
echo "🚀 Installing Loki Stack..."
|
||||
helm upgrade --install "$RELEASE_NAME" grafana/loki-stack \
|
||||
--namespace "$NAMESPACE" \
|
||||
--create-namespace \
|
||||
--values values.yaml \
|
||||
--wait
|
||||
|
||||
echo "✅ Loki Stack installed successfully!"
|
||||
echo ""
|
||||
echo "📝 Access Grafana:"
|
||||
echo " kubectl port-forward -n $NAMESPACE svc/$RELEASE_NAME-grafana 3000:80"
|
||||
|
||||
Reference in New Issue
Block a user