limit postgres resources to fit quota

This commit is contained in:
2026-05-21 18:17:49 +02:00
parent 92cf92c3a1
commit 1de4e75763

View File

@@ -3,33 +3,50 @@ kind: Deployment
metadata:
name: postgres
namespace: student-martabulic
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
envFrom:
- secretRef:
name: postgres-secret # lozinke iz Secreta
name: postgres-secret
ports:
- containerPort: 5432
resources:
requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "100m"
memory: "128Mi"
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
readinessProbe:
exec:
command: ["pg_isready", "-U", "fastapiuser", "-d", "fastapidb"]
initialDelaySeconds: 10
periodSeconds: 5
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: postgres-pvc # disk koji smo rezervirali
claimName: postgres-pvc