59 lines
1.1 KiB
YAML
59 lines
1.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
name: postgres
|
|
namespace: student-antoniomaric1
|
|
|
|
spec:
|
|
replicas: 1
|
|
|
|
selector:
|
|
matchLabels:
|
|
app: postgres
|
|
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: postgres
|
|
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
|
|
image: postgres:16-alpine
|
|
|
|
resources:
|
|
requests:
|
|
cpu: "10m"
|
|
memory: "64Mi"
|
|
limits:
|
|
cpu: "50m"
|
|
memory: "128Mi"
|
|
|
|
ports:
|
|
- containerPort: 5432
|
|
|
|
envFrom:
|
|
- secretRef:
|
|
name: postgres-secret
|
|
|
|
volumeMounts:
|
|
- name: postgres-data
|
|
mountPath: /var/lib/postgresql/data
|
|
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- fastapiuser
|
|
- -d
|
|
- fastapidb
|
|
|
|
initialDelaySeconds: 10
|
|
|
|
volumes:
|
|
- name: postgres-data
|
|
persistentVolumeClaim:
|
|
claimName: postgres-pvc |