From 1de4e7576373d7216bc792c76908ad5272c03c4c Mon Sep 17 00:00:00 2001 From: Marta Bulic Date: Thu, 21 May 2026 18:17:49 +0200 Subject: [PATCH] limit postgres resources to fit quota --- manifests/database/deployment.yaml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/manifests/database/deployment.yaml b/manifests/database/deployment.yaml index 426cb1c..d3d5776 100644 --- a/manifests/database/deployment.yaml +++ b/manifests/database/deployment.yaml @@ -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 \ No newline at end of file