# 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}