Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add observability to the cluster #83

Merged
merged 8 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading