diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index c98327c6..e7621acb 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -8,3 +8,4 @@ resources: - rbac.yaml - deployment.yaml - service.yaml + - metrics-service.yaml diff --git a/k8s/metrics-service.yaml b/k8s/metrics-service.yaml new file mode 100644 index 00000000..eb4d2d92 --- /dev/null +++ b/k8s/metrics-service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: prop-metrics + namespace: prop + labels: + app: prop + purpose: metrics +spec: + type: NodePort + # Don't pin scrapes to a single pod — we want Prometheus to sample + # across all replicas so BEAM-level metrics (memory, scheduler util) + # stay representative. DB-backed gauges (oban queue depth) are + # identical across pods so per-scrape rotation is fine there too. + sessionAffinity: None + selector: + app: prop + ports: + - name: metrics + # Fixed high-numbered NodePort so the external Prometheus at + # 10.0.15.25 can scrape `nodeIP:30090` without needing k8s SD. + nodePort: 30090 + port: 5000 + targetPort: 5000 + protocol: TCP