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
|
targetPort: 3000
|
||||||
nodePort: 3001
|
nodePort: 3001
|
||||||
protocol: TCP
|
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
|
app: jellystat
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-for-db
|
- name: init-cleanup
|
||||||
image: busybox
|
image: busybox
|
||||||
command:
|
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||||
- sh
|
volumeMounts:
|
||||||
- -c
|
- name: backup
|
||||||
- |
|
mountPath: /var/lib/postgresql/data
|
||||||
until nc -z -v -w30 jellystat-db-service 5432; do
|
- name: jellystat-db
|
||||||
echo "Waiting for database to be ready..."
|
image: postgres:alpine
|
||||||
sleep 2
|
restartPolicy: Always
|
||||||
done
|
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:
|
containers:
|
||||||
- name: jellystat
|
- name: jellystat
|
||||||
image: cyfershepard/jellystat:1.1.6
|
image: cyfershepard/jellystat:1.1.6
|
||||||
@@ -38,7 +53,7 @@ spec:
|
|||||||
name: jellystat-secret
|
name: jellystat-secret
|
||||||
key: password
|
key: password
|
||||||
- name: POSTGRES_IP
|
- name: POSTGRES_IP
|
||||||
value: "jellystat-db-service"
|
value: "localhost"
|
||||||
- name: POSTGRES_PORT
|
- name: POSTGRES_PORT
|
||||||
value: "5432"
|
value: "5432"
|
||||||
- name: JWT_SECRET
|
- name: JWT_SECRET
|
||||||
@@ -54,4 +69,3 @@ spec:
|
|||||||
- name: backup
|
- name: backup
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: longhorn-jellystat-data
|
claimName: longhorn-jellystat-data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user