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