feat: dodaj Kubernetes manifeste za FastAPI + Postgres

This commit is contained in:
2026-05-19 10:50:38 +02:00
parent 6a96a9a9ad
commit 4f6c8f897d
9 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: student-marijam1909
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
ports:
- containerPort: 5432
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