tandor moved to shared DB
This commit is contained in:
+5
-102
@@ -38,7 +38,7 @@ spec:
|
||||
- |
|
||||
. /opt/recipes/venv/bin/activate
|
||||
echo "Waiting for database..."
|
||||
while ! python -c "import socket; socket.create_connection(('tandoor-postgres', 5432), timeout=5)" 2>/dev/null; do
|
||||
while ! python -c "import socket; socket.create_connection(('postgresql-rw.database-system.svc.cluster.local', 5432), timeout=5)" 2>/dev/null; do
|
||||
sleep 2
|
||||
done
|
||||
echo "Database is ready. Running migrations..."
|
||||
@@ -67,8 +67,9 @@ spec:
|
||||
env:
|
||||
- name: DB_ENGINE
|
||||
value: django.db.backends.postgresql
|
||||
# Database - using shared PostgreSQL in database-system namespace
|
||||
- name: POSTGRES_HOST
|
||||
value: tandoor-postgres
|
||||
value: postgresql-rw.database-system.svc.cluster.local
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: POSTGRES_DB
|
||||
@@ -120,8 +121,9 @@ spec:
|
||||
value: "HTTP_X_FORWARDED_PROTO,https"
|
||||
- name: DB_ENGINE
|
||||
value: django.db.backends.postgresql
|
||||
# Database - using shared PostgreSQL in database-system namespace
|
||||
- name: POSTGRES_HOST
|
||||
value: tandoor-postgres
|
||||
value: postgresql-rw.database-system.svc.cluster.local
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: POSTGRES_DB
|
||||
@@ -194,69 +196,6 @@ spec:
|
||||
path: /mnt/4_hdd/data/tandoor/mediafiles
|
||||
type: DirectoryOrCreate
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
name: tandoor-postgres
|
||||
namespace: tandoor-system
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:16-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: tandoor-db
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: tandoor-db
|
||||
key: password
|
||||
- name: POSTGRES_DB
|
||||
value: tandoor
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: postgres
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: data
|
||||
securityContext:
|
||||
fsGroup: 999
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: tandoor-postgres
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
@@ -277,25 +216,6 @@ spec:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: tandoor
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
name: tandoor-postgres
|
||||
namespace: tandoor-system
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: postgres
|
||||
port: 5432
|
||||
protocol: TCP
|
||||
targetPort: postgres
|
||||
selector:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
@@ -352,20 +272,3 @@ spec:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: longhorn
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: tandoor
|
||||
app.kubernetes.io/name: postgres
|
||||
name: tandoor-postgres
|
||||
namespace: tandoor-system
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
storageClassName: longhorn
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user