This commit is contained in:
Joseph Hanson 2024-09-12 16:42:30 -05:00
parent d6859bf689
commit fc1fa644aa
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
5 changed files with 196 additions and 11 deletions

View file

@ -6,19 +6,20 @@ resources:
# Pre Flux-Kustomizations
- ./namespace.yaml
# Flux-Kustomizations
- ./maintainerr/ks.yaml
- ./radarr/ks.yaml
- ./sonarr/ks.yaml
- ./sabnzbd/ks.yaml
- ./atuin/ks.yaml
- ./prowlarr/ks.yaml
- ./unpackerr/ks.yaml
- ./tautulli/ks.yaml
- ./redlib/ks.yaml
- ./overseerr/ks.yaml
- ./autobrr/ks.yaml
- ./omegabrr/ks.yaml
- ./it-tools/ks.yaml
- ./excalidraw/ks.yaml
- ./it-tools/ks.yaml
- ./maintainerr/ks.yaml
- ./omegabrr/ks.yaml
- ./overseerr/ks.yaml
- ./plex.yaml
- ./prowlarr/ks.yaml
- ./radarr/ks.yaml
- ./recyclarr/ks.yaml
- ./redlib/ks.yaml
- ./sabnzbd/ks.yaml
- ./searxng/ks.yaml
- ./sonarr/ks.yaml
- ./tautulli/ks.yaml
- ./unpackerr/ks.yaml

View file

@ -0,0 +1,134 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: plex
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.4.0
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
dependsOn:
- name: nvidia-device-plugin
namespace: kube-system
- name: rook-ceph-cluster
namespace: rook-ceph
- name: volsync
namespace: volsync-system
values:
controllers:
plex:
annotations:
reloader.stakater.com/auto: "true"
containers:
app:
image:
repository: ghcr.io/onedr0p/plex
tag: 1.41.0.8992-8463ad060@sha256:d4c31adff5f2ed92152de7c2fb73464e71bea72c28fc7b4ebe74eefab2d9d048
env:
TZ: America/Chicago
PLEX_ADVERTISE_URL: https://plex.hsn.dev:443,http://10.1.1.39:32400
PLEX_NO_AUTH_NETWORKS: 10.1.1.0/24
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /identity
port: 32400
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
startup:
enabled: true
spec:
failureThreshold: 30
periodSeconds: 10
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: ["ALL"] }
resources:
requests:
cpu: 100m
limits:
nvidia.com/gpu: 1 # requesting 1 GPU
memory: 16Gi
defaultPodOptions:
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
fsGroup: 568
fsGroupChangePolicy: OnRootMismatch
supplementalGroups: [44, 10000]
seccompProfile: { type: RuntimeDefault }
nodeSelector:
nvidia.com/gpu.present: "true"
runtimeClassName: nvidia
service:
app:
controller: plex
type: LoadBalancer
annotations:
io.cilium/lb-ipam-ips: 10.1.1.39
ports:
http:
port: 32400
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.hsn.dev
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
className: external-nginx
hosts:
- host: "{{ .Release.Name }}.hsn.dev"
paths:
- path: /
service:
identifier: app
port: http
persistence:
config:
existingClaim: plex
# TODO: If setting up Plex for the first time, you'll want to add the globalMounts section
globalMounts:
- path: /config/Library/Application Support/Plex Media Server
# Separate PVC for cache to avoid backing up cache files
cache:
existingClaim: plex-cache
globalMounts:
- path: /config/Library/Application Support/Plex Media Server/Cache
logs:
type: emptyDir
globalMounts:
- path: /config/Library/Application Support/Plex Media Server/Logs
tmp:
type: emptyDir
transcode:
type: emptyDir
media:
type: nfs
server: 10.1.1.61
path: /moria/Media
globalMounts:
- path: /media
readOnly: true

View file

@ -0,0 +1,11 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./pvc.yaml
- ./helmrelease.yaml
- ../../../../templates/gatus/external
- ../../../../templates/volsync
generatorOptions:
disableNameSuffixHash: true

View file

@ -0,0 +1,11 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: plex-cache
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 75Gi
storageClassName: ceph-block

View file

@ -0,0 +1,28 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app plex
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: external-secrets-stores
path: ./kubernetes/apps/default/plex/app
prune: true
sourceRef:
kind: GitRepository
name: theshire
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *app
GATUS_PATH: /web/index.html
VOLSYNC_CAPACITY: 30Gi