change db
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-02-08 01:53:04 +03:00
parent 9d34deb77d
commit 990a6fe918
5 changed files with 10 additions and 106 deletions

View File

@ -25,7 +25,7 @@ spec:
- name: PORT
value: "4001"
- name: DB_HOST
value: "postgres-service"
value: "shared-postgres-service.shared-db.svc.cluster.local"
- name: DB_PORT
value: "5432"
- name: DB_DATABASE

View File

@ -1,11 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: local-path

View File

@ -1,71 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
serviceName: postgres-service
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:15-alpine
ports:
- containerPort: 5432
name: postgres
env:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: team-planner-secrets
key: db-name
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: team-planner-secrets
key: db-user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: team-planner-secrets
key: db-password
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
exec:
command:
- sh
- -c
- 'pg_isready -h 127.0.0.1 -U "$POSTGRES_USER" -d "$POSTGRES_DB"'
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
exec:
command:
- sh
- -c
- 'pg_isready -h 127.0.0.1 -U "$POSTGRES_USER" -d "$POSTGRES_DB"'
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc