move to postgresql

This commit is contained in:
2026-03-26 10:27:07 -03:00
parent c9ba9e4f5f
commit a85722f96a
20 changed files with 800 additions and 234 deletions

View File

@@ -24,6 +24,8 @@ spec:
name: mpr-config
- configMapRef:
name: minio-config
- configMapRef:
name: postgres-config
readinessProbe:
httpGet:
path: /health

View File

@@ -8,6 +8,7 @@ resources:
- configmap.yaml
- redis.yaml
- minio.yaml
- postgres.yaml
- fastapi.yaml
- detection-ui.yaml
- gateway.yaml

View File

@@ -0,0 +1,63 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-config
namespace: mpr
data:
POSTGRES_DB: mpr
POSTGRES_USER: mpr
POSTGRES_PASSWORD: mpr
DATABASE_URL: postgresql://mpr:mpr@postgres:5432/mpr
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: mpr
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres-config
readinessProbe:
exec:
command: ["pg_isready", "-U", "mpr"]
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumes:
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: mpr
spec:
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432