Skip to content

Commit

Permalink
Merge pull request #83 from NIAEFEUP/feature/observability
Browse files Browse the repository at this point in the history
Add observability to the cluster
  • Loading branch information
limwa authored Jan 2, 2025
2 parents 69d1708 + df6c898 commit 3ebbd2c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions services/grafana/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

port=8080

helm repo add grafana https://grafana.github.io/helm-charts # Add Grafana Helm chart
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts # Add Prometheus Helm chart
helm repo update

kubectl create namespace monitoring
helm upgrade --install --namespace monitoring loki grafana/loki -f $(dirname $0)/loki-values.yaml --set loki.auth_enabled=false --set loki.schemaConfig=$(dirname $0)/loki-schema.yaml # Install Loki

helm install kube-prometheus prometheus-community/kube-prometheus-stack --namespace monitoring -f $(dirname $0)/prometheus-config.yaml # Install Kube Prometheus Stack

sleep 10 # TODO: Wait for pods
POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=grafana" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring wait --for=condition=ready pods/$POD_NAME --timeout=1200s
kubectl --namespace monitoring port-forward service/kube-prometheus-grafana $port:80 &
9 changes: 9 additions & 0 deletions services/grafana/loki-schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
schema_config:
configs:
- from: 2024-11-01
object_store: s3
store: tsdb
schema: v13
index:
prefix: index_
period: 24h
2 changes: 2 additions & 0 deletions services/grafana/loki-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minio:
enabled: true
11 changes: 11 additions & 0 deletions services/grafana/prometheus-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
grafana:
defaultDashboardsTimezone: Europe/Lisbon
enabled: true
adminPassword: tosta-mista-789 # TODO: Change password

additionalDataSources:
- name: Loki
type: loki
access: proxy
url: http://loki-gateway.monitoring.svc.cluster.local/
isDefault: false

0 comments on commit 3ebbd2c

Please sign in to comment.