move to postgresql
This commit is contained in:
@@ -24,6 +24,8 @@ spec:
|
||||
name: mpr-config
|
||||
- configMapRef:
|
||||
name: minio-config
|
||||
- configMapRef:
|
||||
name: postgres-config
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
|
||||
@@ -8,6 +8,7 @@ resources:
|
||||
- configmap.yaml
|
||||
- redis.yaml
|
||||
- minio.yaml
|
||||
- postgres.yaml
|
||||
- fastapi.yaml
|
||||
- detection-ui.yaml
|
||||
- gateway.yaml
|
||||
|
||||
63
ctrl/k8s/base/postgres.yaml
Normal file
63
ctrl/k8s/base/postgres.yaml
Normal 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
|
||||
Reference in New Issue
Block a user