feat: dodaj Kubernetes manifeste
This commit is contained in:
51
manifests/database/deployment.yaml
Normal file
51
manifests/database/deployment.yaml
Normal 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
|
||||
Reference in New Issue
Block a user