diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-07 23:13:29 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-07 23:13:29 +0200 |
| commit | c508f37fb97c1881c0452daa242dc1ae9db12d1a (patch) | |
| tree | bf54a31f85ced643f078a1763e53fe3e0a88a529 /f3s/loki/Justfile | |
| parent | 19a8b3cb725554141e8d5c166060e44079f19735 (diff) | |
Migrate Loki and Alloy to ArgoCD GitOps
- Created two ArgoCD Application manifests (loki and alloy)
- Updated Justfile with ArgoCD commands for both apps
- Loki: log aggregation (SingleBinary mode, 10Gi storage)
- Alloy: log collection DaemonSet + OTLP receiver for traces
- Both apps are Synced and Healthy
- Alloy forwards logs to Loki and traces to Tempo
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'f3s/loki/Justfile')
| -rw-r--r-- | f3s/loki/Justfile | 69 |
1 files changed, 54 insertions, 15 deletions
diff --git a/f3s/loki/Justfile b/f3s/loki/Justfile index 395d5d6..10cc6b9 100644 --- a/f3s/loki/Justfile +++ b/f3s/loki/Justfile @@ -1,15 +1,54 @@ -install: - helm repo add grafana https://grafana.github.io/helm-charts || true - helm repo update - kubectl apply -f persistent-volumes.yaml - helm install loki grafana/loki --namespace monitoring -f values.yaml - helm install alloy grafana/alloy --namespace monitoring -f alloy-values.yaml - -uninstall: - helm uninstall alloy --namespace monitoring - helm uninstall loki --namespace monitoring - kubectl delete -f persistent-volumes.yaml - -upgrade: - helm upgrade loki grafana/loki --namespace monitoring -f values.yaml - helm upgrade alloy grafana/alloy --namespace monitoring -f alloy-values.yaml +NAMESPACE := "monitoring" + +status: + @echo "=== Loki Pods ===" + @kubectl get pods -n {{NAMESPACE}} -l app.kubernetes.io/name=loki + @echo "" + @echo "=== Alloy Pods ===" + @kubectl get pods -n {{NAMESPACE}} -l app.kubernetes.io/name=alloy + @echo "" + @echo "=== Services ===" + @kubectl get svc -n {{NAMESPACE}} | grep -E '(loki|alloy)' + @echo "" + @echo "=== PVC ===" + @kubectl get pvc -n {{NAMESPACE}} loki-data-pvc + @echo "" + @echo "=== ArgoCD Status ===" + @kubectl get application loki -n cicd -o jsonpath='Loki - Sync: {.status.sync.status}, Health: {.status.health.status}' 2>/dev/null && echo "" + @kubectl get application alloy -n cicd -o jsonpath='Alloy - Sync: {.status.sync.status}, Health: {.status.health.status}' 2>/dev/null && echo "" + +logs-loki lines="100": + kubectl logs -n {{NAMESPACE}} -l app.kubernetes.io/name=loki --tail={{lines}} -f + +logs-alloy lines="100": + kubectl logs -n {{NAMESPACE}} -l app.kubernetes.io/name=alloy --tail={{lines}} -f + +port-forward-loki port="3100": + @echo "Forwarding Loki to localhost:{{port}}" + kubectl port-forward -n {{NAMESPACE}} svc/loki {{port}}:3100 + +sync: + @echo "Triggering ArgoCD sync for Loki..." + @kubectl annotate application loki -n cicd argocd.argoproj.io/refresh=normal --overwrite + @echo "Triggering ArgoCD sync for Alloy..." + @kubectl annotate application alloy -n cicd argocd.argoproj.io/refresh=normal --overwrite + @sleep 2 + @kubectl get application loki -n cicd -o jsonpath='Loki - Sync: {.status.sync.status}, Health: {.status.health.status}' && echo "" + @kubectl get application alloy -n cicd -o jsonpath='Alloy - Sync: {.status.sync.status}, Health: {.status.health.status}' && echo "" + +argocd-status: + @echo "=== Loki ===" + @argocd app get loki --core + @echo "" + @echo "=== Alloy ===" + @argocd app get alloy --core + +restart-loki: + @echo "Restarting Loki..." + kubectl rollout restart -n {{NAMESPACE}} statefulset/loki + +restart-alloy: + @echo "Restarting Alloy..." + kubectl rollout restart -n {{NAMESPACE}} daemonset/alloy + +restart: restart-loki restart-alloy |
