Grafana Operations

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

Change Admin Password

The initial login credentials are admin/prom-operator. They are base64-encoded (and can be updated) in the prometheus-grafana secret.

Expose Grafana Locally

Apply:

namespace="prom"
cat <<EOF | kubectl -n ${namespace} apply -f - 
apiVersion: v1
kind: Service
metadata:
  name: prometheus-grafana-lb
  namespace: ${namespace}
spec:
  type: LoadBalancer
  ports:
  - name: service
    port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app.kubernetes.io/instance: prometheus
    app.kubernetes.io/name: grafana
EOF

This will expose Grafana as:

http://localhost:3000/

Set Light Theme

kubectl -n prometheus edit cm prometheus-grafana
data:
  grafana.ini: |
    ... 
    [users]
    default_theme = light
kubectl -n prometheus scale deployment prometheus-grafana --replicas 0
kubectl -n prometheus scale deployment prometheus-grafana --replicas 1