summaryrefslogtreecommitdiff
path: root/docs/operations/kubernetes.md
blob: 20b8b072b069c5a888da2de5b0da69a0d7ebc492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Kubernetes

Common tasks when running Epimetheus against Prometheus, Pushgateway, and Grafana in Kubernetes.

## Port-forwards

To run Epimetheus on your laptop against cluster services:

```bash
# Pushgateway (realtime mode)
kubectl port-forward -n monitoring svc/pushgateway 9091:9091 &

# Prometheus (historic/watch, queries)
kubectl port-forward -n monitoring svc/prometheus-kube-prometheus-prometheus 9090:9090 &

# Grafana (dashboards)
kubectl port-forward -n monitoring svc/prometheus-grafana 3000:80
```

Then use `http://localhost:9091`, `http://localhost:9090`, and `http://localhost:3000` in Epimetheus flags and in the browser. Adjust service names and namespaces to match your cluster (e.g. `prometheus-kube-prometheus-prometheus` for kube-prometheus-stack).

## Deploying Pushgateway

Example using the official Helm chart:

```bash
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install pushgateway prometheus-community/prometheus-pushgateway -n monitoring --create-namespace
```

Alternatively use your own chart (e.g. from the [conf repository](https://codeberg.org/snonux/conf) at `f3s/pushgateway/helm-chart`).

## Deploying the Epimetheus Grafana dashboard

**ConfigMap (recommended):** If you have a manifest that creates a ConfigMap with the dashboard JSON and the Grafana label for auto-discovery:

```bash
kubectl apply -f ../prometheus/epimetheus-dashboard.yaml
```

**Script:** From the repo, with Grafana reachable (e.g. after port-forward):

```bash
./scripts/deploy-dashboard.sh
# Or with credentials:
GRAFANA_URL="http://localhost:3000" GRAFANA_USER="admin" GRAFANA_PASSWORD="yourpassword" ./scripts/deploy-dashboard.sh
```

## Namespace and service names

Replace `monitoring` and the Prometheus/Pushgateway/Grafana service names with whatever your Helm release or manifests use. Epimetheus only needs the URLs; it does not need to run inside the cluster.