postgres: reserve database capacity and probe pinned runtime

This commit is contained in:
jenkins 2026-10-03 01:23:30 -05:00
parent 5f3f31849c
commit 103e20645e

View File

@ -25,7 +25,15 @@ spec:
serviceAccountName: postgres-vault serviceAccountName: postgres-vault
nodeSelector: nodeSelector:
node-role.kubernetes.io/worker: "true" node-role.kubernetes.io/worker: "true"
hardware: rpi5 tolerations:
- key: atlas.bstein.dev/spillover
operator: Equal
value: "true"
effect: PreferNoSchedule
- key: longhorn
operator: Equal
value: "true"
effect: PreferNoSchedule
affinity: affinity:
nodeAffinity: nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution: requiredDuringSchedulingIgnoredDuringExecution:
@ -36,24 +44,47 @@ spec:
values: ["true"] values: ["true"]
- key: hardware - key: hardware
operator: In operator: In
values: ["rpi5"] values: ["rpi5", "rpi4"]
- key: kubernetes.io/hostname
operator: NotIn
values: ["titan-06"]
preferredDuringSchedulingIgnoredDuringExecution: preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100 - weight: 100
preference: preference:
matchExpressions: matchExpressions:
- key: kubernetes.io/hostname - key: hardware
operator: In operator: In
values: ["titan-05", "titan-07", "titan-08", "titan-11"] values: ["rpi5"]
- weight: 50
preference:
matchExpressions:
- key: hardware
operator: In
values: ["rpi4"]
containers: containers:
- name: postgres - name: postgres
image: postgres:15 image: postgres:15@sha256:6eb0add3b77c081df18aa518ce43df58fdcc40f2e6d868a6fd08038dc7acd425
ports: ports:
- name: postgres - name: postgres
containerPort: 5432 containerPort: 5432
protocol: TCP protocol: TCP
# The namespace's 512 MiB default previously killed backend processes.
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
cpu: "2"
memory: 2Gi
startupProbe:
exec:
command: [pg_isready, -U, postgres, -d, postgres]
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 60
readinessProbe:
exec:
command: [pg_isready, -U, postgres, -d, postgres]
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
env: env:
- name: PGDATA - name: PGDATA
value: /var/lib/postgresql/data/pgdata value: /var/lib/postgresql/data/pgdata
@ -70,7 +101,14 @@ spec:
mountPath: /mnt/vault mountPath: /mnt/vault
readOnly: true readOnly: true
- name: postgres-exporter - name: postgres-exporter
image: quay.io/prometheuscommunity/postgres-exporter:v0.15.0 image: quay.io/prometheuscommunity/postgres-exporter:v0.15.0@sha256:386b12d19eab2a37d7cd8ca8b4c7491cc7a830d9581f49af6c98a393da9605e6
resources:
requests:
cpu: 20m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
ports: ports:
- name: metrics - name: metrics
containerPort: 9187 containerPort: 9187