]> git.frustrated-labs.net Git - dotfiles.git/commitdiff
feat: add config for prometheus deployment
authorAlexander Goussas <[email protected]>
Mon, 1 Jun 2026 02:38:59 +0000 (21:38 -0500)
committerAlexander Goussas <[email protected]>
Mon, 1 Jun 2026 02:38:59 +0000 (21:38 -0500)
k8s/prometheus.yaml [new file with mode: 0644]

diff --git a/k8s/prometheus.yaml b/k8s/prometheus.yaml
new file mode 100644 (file)
index 0000000..3f5796e
--- /dev/null
@@ -0,0 +1,59 @@
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: prom-config
+data:
+  prom-config: |
+    global:
+      scrape_interval: 30s
+
+    scrape_configs:
+      - job_name: "otel-collector"
+        static_configs:
+          - targets: [ "otel-collector.default.svc.cluster.local:8887" ]
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: prometheus
+spec:
+  selector:
+    matchLabels:
+      app: prometheus
+  replicas: 1
+  template:
+    metadata:
+      labels:
+        app: prometheus
+    spec:
+      volumes:
+        - name: prom-config-vol
+          configMap:
+            name: prom-config
+            items:
+              - key: prom-config
+                path: prometheus.yml
+      containers:
+        - name: prometheus
+          image: prom/prometheus:latest
+          ports:
+            - containerPort: 9090
+          volumeMounts:
+            - name: prom-config-vol
+              mountPath: /etc/prometheus
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: prometheus
+  labels:
+    app: prometheus
+spec:
+  selector:
+    app: prometheus
+  ports:
+    - port: 9090
+      name: prometheus-http-frontend
+      protocol: TCP
+      targetPort: 9090