feat: add jellystat deployment, database service, and persistent volume claim configurations
This commit is contained in:
46
cluster/apps/jellystat/jellystat-db.yml
Normal file
46
cluster/apps/jellystat/jellystat-db.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
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
cluster/apps/jellystat/jellystat-pvc.yml
Normal file
13
cluster/apps/jellystat/jellystat-pvc.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: longhorn-jellystat-data
|
||||
namespace: default
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
29
cluster/apps/jellystat/jellystat-svc.yml
Normal file
29
cluster/apps/jellystat/jellystat-svc.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jellystat-service
|
||||
namespace: default
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: jellystat
|
||||
ports:
|
||||
- port: 3000
|
||||
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
|
||||
57
cluster/apps/jellystat/jellystat.yml
Normal file
57
cluster/apps/jellystat/jellystat.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: jellystat
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: jellystat
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: jellystat
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
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
|
||||
containers:
|
||||
- name: jellystat
|
||||
image: cyfershepard/jellystat:1.1.5
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: "postgres"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: jellystat-secret
|
||||
key: password
|
||||
- name: POSTGRES_IP
|
||||
value: "jellystat-db-service"
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: jellystat-secret
|
||||
key: jwt
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /app/backend/backup-data
|
||||
subPath: backup
|
||||
volumes:
|
||||
- name: backup
|
||||
persistentVolumeClaim:
|
||||
claimName: longhorn-jellystat-backup
|
||||
|
||||
Reference in New Issue
Block a user