Skip to content

Commit

Permalink
feat(media): deploy replex
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Jan 28, 2025
1 parent 8c9afa5 commit dfed687
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 0 deletions.
25 changes: 25 additions & 0 deletions kubernetes/apps/media/plex/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,28 @@ spec:
targetNamespace: *namespace
timeout: 5m
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app plex-tools
namespace: &namespace media
spec:
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: onepassword-store
namespace: external-secrets
- name: plex
namespace: *namespace
interval: 30m
path: ./kubernetes/apps/media/plex/tools
prune: true
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
targetNamespace: *namespace
timeout: 5m
wait: true
5 changes: 5 additions & 0 deletions kubernetes/apps/media/plex/tools/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./replex
18 changes: 18 additions & 0 deletions kubernetes/apps/media/plex/tools/replex/externalsecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: replex
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword
target:
name: replex-secret
creationPolicy: Owner
template:
data:
REPLEX_TOKEN: "{{ .PLEX_TOKEN }}"
dataFrom:
- extract:
key: plex
81 changes: 81 additions & 0 deletions kubernetes/apps/media/plex/tools/replex/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app replex
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.6.1
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
values:
controllers:
replex:
annotations:
reloader.stakater.com/auto: "true"
containers:
app:
image:
repository: ghcr.io/lostb1t/replex
tag: 0.27.23@sha256:5c29c04bd9d5cc8126ee74ae5466b8c78c133841810ea6e97afd6463b2dbb55c
env:
REPLEX_HOST: http://plex.media.svc.cluster.local:32400
envFrom:
- secretRef:
name: replex-secret
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /identity
port: &port 3001
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
resources:
requests:
cpu: 10m
limits:
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: ["ALL"] }
defaultPodOptions:
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
ingress:
app:
className: internal
hosts:
- host: "{{ .Release.Name }}.ktwo.io"
paths:
- path: /
service:
identifier: app
port: http
service:
app:
controller: *app
ports:
http:
port: *port
6 changes: 6 additions & 0 deletions kubernetes/apps/media/plex/tools/replex/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml

0 comments on commit dfed687

Please sign in to comment.