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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
26 changes: 26 additions & 0 deletions services/grafana/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/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.useTestSchema=true # Install Loki
# TODO: Stop using test schema
# TODO (maybe): Use auth
# helm upgrade --install --namespace monitoring loki-grafana grafana/grafana -f $(dirname $0)/grafana-values.yaml # Install Grafana
# sleep 10 # TODO: Wait for pods
# export POD_NAME=$(kubectl get pods --namespace loki -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=loki-grafana" -o jsonpath="{.items[0].metadata.name}")
# kubectl --namespace loki wait --for=condition=ready pods/$POD_NAME --timeout=300s
# kubectl --namespace loki port-forward $POD_NAME $port:3000 &

# echo "Admin password:" $(kubectl get secret --namespace loki loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo)

helm install kube-prometheus prometheus-community/kube-prometheus-stack --namespace monitoring -f $(dirname $0)/prometheus-config.yaml

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=300s
kubectl --namespace monitoring port-forward service/kube-prometheus-grafana $port:80 &
Loading
Loading