titan-iac/services/pegasus/deployment.yaml

112 lines
3.7 KiB
YAML
Raw Normal View History

2025-09-07 13:20:49 -05:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: pegasus
namespace: jellyfin
spec:
2025-10-09 23:23:41 -05:00
replicas: 1
revisionHistoryLimit: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
2026-01-21 13:33:42 +00:00
selector: {matchLabels: {app: pegasus}}
2025-09-07 13:20:49 -05:00
template:
2026-01-21 13:33:42 +00:00
metadata: {labels: {app: pegasus}}
2025-09-07 13:20:49 -05:00
spec:
2025-09-15 12:32:52 -05:00
nodeSelector:
kubernetes.io/arch: amd64
2025-09-07 13:20:49 -05:00
securityContext:
runAsNonRoot: true
2025-09-16 20:08:50 -05:00
runAsUser: 65532
runAsGroup: 65532
fsGroup: 65532
2025-09-07 13:20:49 -05:00
fsGroupChangePolicy: "OnRootMismatch"
2025-09-16 22:45:15 -05:00
initContainers:
- name: fix-perms
image: alpine:3.20
command:
- sh
- -lc
- |
set -eux
# Scratch area for tus uploads (always writable)
mkdir -p /media/.pegasus-tus
chmod 0777 /media/.pegasus-tus
# Make each top-level library dir group-writable and setgid,
# and try to set its group to 65532 (so the app can write).
for d in /media/*; do
[ -d "$d" ] || continue
base="$(basename "$d")"
[ "$base" = ".pegasus-tus" ] && continue
# chgrp can fail on some backends; don't block the pod if it does.
chgrp 65532 "$d" || true
chmod 2775 "$d" || true
done
securityContext:
runAsUser: 0
runAsGroup: 0
runAsNonRoot: false
allowPrivilegeEscalation: false
volumeMounts:
2026-01-21 13:33:42 +00:00
- {name: media, mountPath: /media}
2025-09-07 13:20:49 -05:00
containers:
2025-09-16 22:45:15 -05:00
- name: pegasus
2026-01-21 13:33:42 +00:00
image: registry.bstein.dev/streaming/pegasus-vault:1.2.32 # {"$imagepolicy": "jellyfin:pegasus"}
2025-09-16 22:45:15 -05:00
imagePullPolicy: Always
command: ["/pegasus"]
env:
- name: PEGASUS_MEDIA_ROOT
2026-01-21 13:33:42 +00:00
valueFrom: {configMapKeyRef: {name: pegasus-config, key: PEGASUS_MEDIA_ROOT}}
2025-09-16 22:45:15 -05:00
- name: PEGASUS_BIND
2026-01-21 13:33:42 +00:00
valueFrom: {configMapKeyRef: {name: pegasus-config, key: PEGASUS_BIND}}
2025-09-16 22:45:15 -05:00
- name: PEGASUS_USER_MAP_FILE
value: "/config/user-map.yaml"
- name: PEGASUS_SESSION_KEY
2026-01-21 13:33:42 +00:00
valueFrom: {secretKeyRef: {name: pegasus-secrets, key: PEGASUS_SESSION_KEY}}
2025-09-16 22:45:15 -05:00
- name: JELLYFIN_URL
2026-01-21 13:33:42 +00:00
valueFrom: {secretKeyRef: {name: pegasus-secrets, key: JELLYFIN_URL}}
2025-09-18 02:33:37 -05:00
- name: JELLYFIN_API_KEY
2026-01-21 13:33:42 +00:00
valueFrom: {secretKeyRef: {name: pegasus-secrets, key: JELLYFIN_API_KEY}}
2025-09-16 22:45:15 -05:00
- name: PEGASUS_DEBUG
value: "1"
- name: PEGASUS_DRY_RUN
value: "0"
2026-01-21 13:33:42 +00:00
ports: [{name: http, containerPort: 8080}]
2025-09-16 22:45:15 -05:00
readinessProbe:
2026-01-21 13:33:42 +00:00
httpGet: {path: /healthz, port: http}
2025-09-16 22:45:15 -05:00
initialDelaySeconds: 2
periodSeconds: 5
timeoutSeconds: 1
livenessProbe:
2026-01-21 13:33:42 +00:00
httpGet: {path: /healthz, port: http}
2025-09-16 22:45:15 -05:00
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 2
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
2026-01-21 13:33:42 +00:00
capabilities: {drop: ["ALL"]}
2025-09-16 22:45:15 -05:00
resources:
2026-01-21 13:33:42 +00:00
requests: {cpu: 100m, memory: 256Mi}
limits: {cpu: 1000m, memory: 1Gi}
2025-09-16 22:45:15 -05:00
volumeMounts:
- name: media
mountPath: /media
- name: config
mountPath: /config
readOnly: true
- name: tmp
mountPath: /tmp
2025-09-07 13:20:49 -05:00
volumes:
- name: media
persistentVolumeClaim:
claimName: jellyfin-media-asteria-new
2025-09-07 13:20:49 -05:00
- name: config
2026-01-21 13:33:42 +00:00
configMap: {name: pegasus-user-map}
2025-09-07 13:20:49 -05:00
- name: tmp
2025-09-15 02:45:22 -05:00
emptyDir: {}