|
22 | 22 | metadata: |
23 | 23 | labels: |
24 | 24 | app: instant-worker |
| 25 | + annotations: |
| 26 | + # Prometheus pod-annotation discovery (P1-W5-08). The worker serves |
| 27 | + # /metrics on port 8091 — the same port as /healthz. These let an |
| 28 | + # annotation-based Prometheus discovery scrape the pod directly; the |
| 29 | + # in-cluster instant-worker Service below is the static_configs path |
| 30 | + # used by infra/prometheus/prometheus.yml. |
| 31 | + prometheus.io/scrape: "true" |
| 32 | + prometheus.io/port: "8091" |
| 33 | + prometheus.io/path: "/metrics" |
25 | 34 | spec: |
26 | 35 | serviceAccountName: instant-worker |
27 | 36 | # Multi-worker is safe — River queue uses Postgres SELECT FOR UPDATE |
|
40 | 49 | image: instant-worker:local |
41 | 50 | imagePullPolicy: Never |
42 | 51 | ports: |
| 52 | + # 8091 serves both /healthz (probes) and /metrics (Prometheus |
| 53 | + # scrape). Named 'metrics' so the instant-worker Service below |
| 54 | + # can reference it by name. |
43 | 55 | - containerPort: 8091 |
44 | | - name: liveness |
| 56 | + name: metrics |
45 | 57 | # Probes (2026-05-18): the worker binary registers ONLY /healthz |
46 | 58 | # (plus /metrics) — it never serves /livez. All three probes hit |
47 | 59 | # /healthz. /healthz checks River queue connectivity + DB pool |
@@ -149,3 +161,31 @@ spec: |
149 | 161 | value: "noreply@instanode.dev" |
150 | 162 | - name: BREVO_SENDER_NAME |
151 | 163 | value: "instanode" |
| 164 | +--- |
| 165 | +# Headless ClusterIP Service for the worker (P1-W5-08 / T13-S5-05). The worker |
| 166 | +# is a background-job processor with no inbound API traffic, but it serves |
| 167 | +# /healthz + /metrics on 8091. This Service exists solely so Prometheus can |
| 168 | +# resolve instant-worker.instant-infra.svc.cluster.local:8091 — the target of |
| 169 | +# the 'instant-worker' scrape job in infra/prometheus/prometheus.yml, which |
| 170 | +# feeds the AnonymousResourceExpiryStopped + StorageIamCreateFailures alerts. |
| 171 | +apiVersion: v1 |
| 172 | +kind: Service |
| 173 | +metadata: |
| 174 | + name: instant-worker |
| 175 | + namespace: instant-infra |
| 176 | + labels: |
| 177 | + app: instant-worker |
| 178 | + annotations: |
| 179 | + prometheus.io/scrape: "true" |
| 180 | + prometheus.io/port: "8091" |
| 181 | + prometheus.io/path: "/metrics" |
| 182 | +spec: |
| 183 | + type: ClusterIP |
| 184 | + clusterIP: None |
| 185 | + selector: |
| 186 | + app: instant-worker |
| 187 | + ports: |
| 188 | + - name: metrics |
| 189 | + port: 8091 |
| 190 | + targetPort: metrics |
| 191 | + protocol: TCP |
0 commit comments