feat: dodaj Kubernetes manifeste

This commit is contained in:
2026-05-19 10:24:54 +02:00
parent 2ecad4d349
commit 44f271f1a0
9 changed files with 231 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: student-dinkoglc
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
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

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: student-dinkoglc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: local-path

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: postgres-service
namespace: student-dinkoglc
spec:
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432
type: ClusterIP