Low Orbit Flux Logo 2 F

Prometheus Grafana



helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
kubectl create namespace monitoring
helm install prometheus-stack prometheus-community/kube-prometheus-stack -n monitoring

This deploys:



kubectl get pods -n monitoring

Host Based Ingress



root@template-host:~# cat prom-ingress.yaml
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: prom-ingress
spec:
  entryPoints:
    - web
  routes:
  - match: "Host(`prom1`)"
    kind: Rule
    services:
    - name: prometheus-stack-kube-prom-prometheus
      port: 9090

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: graf-ingress
spec:
  entryPoints:
    - web
  routes:
  - match: "Host(`graf1`)"
    kind: Rule
    services:
    - name: prometheus-stack-grafana
      port: 80

Apply it:



kubectl apply -f prom-ingress.yaml

Add hosts:



/etc/hosts
192.168.3.228 kube-test1 kube-test1.lab.net prom1 graf1

Access with these hosts:

Creds:

Password might be different, get it with this:



kubectl get secret -n monitoring prometheus-stack-grafana -o jsonpath="{.data.admin-password}" | base64 --decode

This was already setup by default:

Might want to add these dashboards:

Persistent Storage

Add persistent storage:



values.yaml

prometheus:
  server:
    persistentVolume:
      enabled: true
      size: 10Gi

Update it with helm:



helm upgrade prometheus-stack prometheus-community/kube-prometheus-stack -n monitoring -f values.yaml