156 lines
3.8 KiB
YAML
156 lines
3.8 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: nefarious-admin
|
|
annotations:
|
|
"helm.sh/resource-policy": "keep"
|
|
type: Opaque
|
|
data:
|
|
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "nefarious-admin") | default dict }}
|
|
{{- $secretData := (get $secretObj "data") | default dict }}
|
|
{{- $pass := (get $secretData "password") | default (randAlphaNum 32 | b64enc) }}
|
|
password: {{ $pass | quote }}
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: nefarious
|
|
labels:
|
|
app: nefarious
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: nefarious
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nefarious
|
|
name: nefarious
|
|
spec:
|
|
containers:
|
|
- name: nefarious
|
|
image: lardbit/nefarious
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: NEFARIOUS_USER
|
|
value: "admin"
|
|
- name: NEFARIOUS_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: nefarious-admin
|
|
- name: DATABASE_URL
|
|
value: "sqlite:////nefarious-db/db.sqlite3"
|
|
- name: REDIS_HOST
|
|
value: "redis"
|
|
- name: REDIS_PORT
|
|
value: "6379"
|
|
- name: HOST_DOWNLOAD_PATH
|
|
value: "/downloads/complete"
|
|
- name: CONFIG_PATH
|
|
value: "/nefarious-db"
|
|
- name: INTERNAL_DOWNLOAD_PATH
|
|
value: "/downloads/complete"
|
|
volumeMounts:
|
|
- name: nefarious-persistent-storage
|
|
mountPath: /nefarious-db
|
|
subPath: backup/nefarious/nefarious-db
|
|
- name: nefarious-persistent-storage
|
|
mountPath: /downloads/complete/movies
|
|
subPath: nobackup/downloads/complete/movies
|
|
- name: nefarious-persistent-storage
|
|
mountPath: /downloads/complete/tvshows
|
|
subPath: nobackup/downloads/complete/tvshows
|
|
volumes:
|
|
- name: nefarious-persistent-storage
|
|
persistentVolumeClaim:
|
|
claimName: homey-pvc-nfs
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: celery
|
|
labels:
|
|
app: celery
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: celery
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: celery
|
|
name: celery
|
|
spec:
|
|
containers:
|
|
- name: celery
|
|
image: lardbit/nefarious
|
|
imagePullPolicy: Always
|
|
command: ["/app/entrypoint-celery.sh"]
|
|
env:
|
|
- name: DATABASE_URL
|
|
value: "sqlite:////nefarious-db/db.sqlite3"
|
|
- name: REDIS_HOST
|
|
value: "redis"
|
|
- name: REDIS_URL
|
|
value: "redis://redis:6379/"
|
|
- name: REDIS_PORT
|
|
value: "6379"
|
|
- name: REDIS_DB
|
|
value: "0"
|
|
- name: HOST_DOWNLOAD_PATH
|
|
value: "/downloads"
|
|
- name: INTERNAL_DOWNLOAD_PATH
|
|
value: "/downloads"
|
|
volumeMounts:
|
|
- name: celery-persistent-storage
|
|
mountPath: /nefarious-db
|
|
subPath: backup/nefarious/nefarious-db
|
|
- name: celery-persistent-storage
|
|
mountPath: /downloads
|
|
subPath: nobackup/downloads
|
|
volumes:
|
|
- name: celery-persistent-storage
|
|
persistentVolumeClaim:
|
|
claimName: homey-pvc-nfs
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: nefarious
|
|
spec:
|
|
selector:
|
|
app: nefarious
|
|
ports:
|
|
- port: 80
|
|
targetPort: 80
|
|
name: nefarious
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: nefarious-ingress
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/whitelist-source-range: "10.0.0.0/16"
|
|
spec:
|
|
ingressClassName: {{ .Values.homey.ingress_class }}
|
|
tls:
|
|
- hosts:
|
|
- nefarious.{{ .Values.homey.url }}
|
|
secretName: {{ .Values.homey.certname }}
|
|
rules:
|
|
- host: nefarious.{{ .Values.homey.url }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: nefarious
|
|
port:
|
|
number: 80
|