first commit
This commit is contained in:
6
clusters/default/apps/jellystat/Chart.yaml
Normal file
6
clusters/default/apps/jellystat/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: jellystat
|
||||
description: A Helm chart for Jellystat
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.1.6"
|
||||
27
clusters/default/apps/jellystat/Values.yaml
Normal file
27
clusters/default/apps/jellystat/Values.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
name: jellystat
|
||||
namespace: prod
|
||||
|
||||
image:
|
||||
repository: cyfershepard/jellystat
|
||||
tag: "1.1.6"
|
||||
|
||||
env:
|
||||
dbName: jfstat
|
||||
dbUser: postgres
|
||||
|
||||
secrets:
|
||||
db:
|
||||
secretName: jellystat-secret
|
||||
secretKey: password
|
||||
jwt:
|
||||
secretName: jellystat-secret
|
||||
secretKey: jwt
|
||||
|
||||
persistence:
|
||||
enabled: true
|
||||
existingClaim: true
|
||||
claimName: longhorn-jellystat-data
|
||||
|
||||
service:
|
||||
type: LoadBalancer
|
||||
port: 3001
|
||||
13
clusters/default/apps/jellystat/templates/jellystat-pvc.yaml
Normal file
13
clusters/default/apps/jellystat/templates/jellystat-pvc.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: "longhorn-{{ .Values.name }}"
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size }}
|
||||
22
clusters/default/apps/jellystat/templates/jellystat-svc.yaml
Normal file
22
clusters/default/apps/jellystat/templates/jellystat-svc.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "{{ .Values.name }}-service"
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.name }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
type: LoadBalancer
|
||||
{{- else if eq .Values.service.type "NodePort" }}
|
||||
type: NodePort
|
||||
{{- end }}
|
||||
ports:
|
||||
- targetPort: 3000
|
||||
protocol: TCP
|
||||
{{- if eq .Values.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- else if eq .Values.service.type "LoadBalancer" }}
|
||||
port: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
78
clusters/default/apps/jellystat/templates/jellystat.yaml
Normal file
78
clusters/default/apps/jellystat/templates/jellystat.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.name }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.name }}
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init-cleanup
|
||||
image: busybox
|
||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: "{{ .Values.name }}-db"
|
||||
image: postgres:alpine
|
||||
restartPolicy: Always
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: "{{ .Values.env.dbName }}"
|
||||
- name: POSTGRES_USER
|
||||
value: "{{ .Values.env.dbUser }}"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.secrets.db.secretName }}
|
||||
key: {{ .Values.secrets.db.secretKey }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata
|
||||
containers:
|
||||
- name: {{ .Values.name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: "{{ .Values.env.dbUser }}"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.secrets.db.secretName }}
|
||||
key: {{ .Values.secrets.db.secretKey }}
|
||||
- name: POSTGRES_IP
|
||||
value: "localhost"
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.secrets.jwt.secretName }}
|
||||
key:
|
||||
- name: POSTGRES_DB
|
||||
value: "{{ .Values.env.dbName }}"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /app/backend/backup-data
|
||||
subPath: backup
|
||||
volumes:
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Values.persistence.claimName }}"
|
||||
{{- else if .Values.persistence.enabled }}
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: "longhorn-{{ .Values.name }}"
|
||||
{{- else }}
|
||||
- name: config
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user