91 lines
2.2 KiB
YAML
91 lines
2.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: planka-postgres
|
|
namespace: wedding-planner
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: planka-postgres
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: planka-postgres
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 999
|
|
runAsGroup: 999
|
|
fsGroup: 999
|
|
fsGroupChangePolicy: OnRootMismatch
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: postgres
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- name: postgres
|
|
containerPort: 5432
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
env:
|
|
- name: POSTGRES_DB
|
|
value: planka
|
|
- name: POSTGRES_USER
|
|
value: planka
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: planka-secret
|
|
key: POSTGRES_PASSWORD
|
|
- name: PGDATA
|
|
value: /var/lib/postgresql/data/pgdata
|
|
volumeMounts:
|
|
- name: database
|
|
mountPath: /var/lib/postgresql/data
|
|
startupProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- planka
|
|
- -d
|
|
- planka
|
|
failureThreshold: 30
|
|
periodSeconds: 5
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- planka
|
|
- -d
|
|
- planka
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- planka
|
|
- -d
|
|
- planka
|
|
periodSeconds: 20
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 1
|
|
memory: 1Gi
|
|
volumes:
|
|
- name: database
|
|
persistentVolumeClaim:
|
|
claimName: planka-postgres
|