Files
dingoandClaude Opus 5.5 b4493b3d0f Add M8.5 observability: pinned Prometheus, tested alerts, capacity metrics
An AEvolution-only Prometheus 3.13.3 and Alertmanager 0.34.1, pinned by
digest and delivered by Argo (ADR-0072), scrape each region's operations
Service through static targets (no API access, no RBAC); the region
namespaces admit port 9100 from Prometheus only. Sixteen alert rules
cover authority, lease, commits, backlog and object capacity and are
proven by promtool injection tests in CI with tools copied from the same
pinned images. Two new gauges expose object volume free space and the
reserve. Alerts route to a null receiver until a destination is chosen;
no broker is adopted and the database outbox stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:16:36 -04:00

116 lines
3.3 KiB
YAML

# M8.5 Prometheus (ADR-0072), pinned by digest. Static scrape targets (no API access,
# no RBAC); 15 s scrape and evaluation; retention bounded by time and size.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prometheus-data
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path # Metrics are not world data; Delete reclaim is fine.
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
labels:
app.kubernetes.io/name: prometheus
spec:
replicas: 1
strategy:
type: Recreate # One TSDB writer on an RWO volume.
selector:
matchLabels:
app.kubernetes.io/name: prometheus
template:
metadata:
labels:
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: aevolution
spec:
serviceAccountName: aevolution-prometheus
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
fsGroup: 65534
seccompProfile: {type: RuntimeDefault}
containers:
- name: prometheus
image: quay.io/prometheus/prometheus:v3.13.3@sha256:6976aa8a60fec930796ce5772b8d12da7a318a5daa8d40d69c5c7819a05eeed7
args:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
- --storage.tsdb.retention.size=3GB
- --web.listen-address=:9090
ports:
- {name: web, containerPort: 9090}
readinessProbe:
httpGet: {path: /-/ready, port: web}
periodSeconds: 10
livenessProbe:
httpGet: {path: /-/healthy, port: web}
periodSeconds: 20
failureThreshold: 3
resources:
requests: {cpu: 100m, memory: 256Mi}
limits: {memory: 1Gi}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: {drop: [ALL]}
volumeMounts:
- {name: config, mountPath: /etc/prometheus, readOnly: true}
- {name: data, mountPath: /prometheus}
volumes:
- name: config
configMap:
name: prometheus-config
- name: data
persistentVolumeClaim:
claimName: prometheus-data
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: prometheus
ports:
- {name: web, port: 9090, targetPort: web}
---
# Prometheus reaches the region operations ports, Alertmanager and itself only.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: prometheus
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
policyTypes: [Egress]
egress:
- to:
- namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: In
values: [evolution-dev, evolution-stage]
podSelector:
matchLabels:
app.kubernetes.io/name: evo-region
ports:
- {protocol: TCP, port: 9100}
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: alertmanager
ports:
- {protocol: TCP, port: 9093}