remove separate db deployment
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: jellystat-db
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: jellystat-db
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: jellystat-db
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init-cleanup
|
||||
image: busybox
|
||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
containers:
|
||||
- name: jellystat-db
|
||||
image: postgres:alpine
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: "jfstat"
|
||||
- name: POSTGRES_USER
|
||||
value: "postgres"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: jellystat-secret
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: longhorn-jellystat-data
|
||||
@@ -13,17 +13,3 @@ spec:
|
||||
targetPort: 3000
|
||||
nodePort: 3001
|
||||
protocol: TCP
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jellystat-db-service
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: jellystat-db
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
|
||||
@@ -14,16 +14,31 @@ spec:
|
||||
app: jellystat
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
- name: init-cleanup
|
||||
image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z -v -w30 jellystat-db-service 5432; do
|
||||
echo "Waiting for database to be ready..."
|
||||
sleep 2
|
||||
done
|
||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: jellystat-db
|
||||
image: postgres:alpine
|
||||
restartPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: "jfstat"
|
||||
- name: POSTGRES_USER
|
||||
value: "postgres"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: jellystat-secret
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata
|
||||
containers:
|
||||
- name: jellystat
|
||||
image: cyfershepard/jellystat:1.1.6
|
||||
@@ -38,7 +53,7 @@ spec:
|
||||
name: jellystat-secret
|
||||
key: password
|
||||
- name: POSTGRES_IP
|
||||
value: "jellystat-db-service"
|
||||
value: "localhost"
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: JWT_SECRET
|
||||
@@ -54,4 +69,3 @@ spec:
|
||||
- name: backup
|
||||
persistentVolumeClaim:
|
||||
claimName: longhorn-jellystat-data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user