--- apiVersion: apps/v1 kind: Deployment metadata: name: nzbget namespace: arrstack spec: replicas: 1 strategy: # RWO config PVC + single queue state: never run two pods at once. type: Recreate selector: matchLabels: app: nzbget template: metadata: labels: app: nzbget spec: securityContext: fsGroup: 1000 fsGroupChangePolicy: OnRootMismatch initContainers: # Seed download layout onto the shared media PVCs (not /config or an # emptyDir) so completed downloads land beside the arr libraries and # imports are same-filesystem hardlink moves. Reuses the image's own # template (inherits correct WebDir/ConfigTemplate) and appends the # path/category overrides once; nzbget honours the last value for a # repeated option, and the grep guard keeps re-runs idempotent so admin # UI edits to the persisted /config/nzbget.conf survive restarts. - name: seed-config image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/linuxserver/nzbget:v26.2 command: - sh - -c - | set -e if [ ! -f /config/nzbget.conf ]; then cp /app/nzbget/share/nzbget/nzbget.conf /config/nzbget.conf fi if ! grep -q '# arrstack-managed' /config/nzbget.conf; then cat >> /config/nzbget.conf << 'CONF' # arrstack-managed download layout (appended once; last value wins). # Downloads land on the shared media PVCs by category so sonarr/radarr # import with atomic hardlink moves (download dir + library share one # filesystem per media type). InterDir is empty: nzbget writes each # download straight into its category DestDir, so BOTH tv and movies # stay on their own PVC with no cross-filesystem intermediate copy. MainDir=/media/tv InterDir= DestDir=/media/tv/downloads NzbDir=/config/nzb QueueDir=/config/queue TempDir=/config/tmp ControlIP=0.0.0.0 ControlPort=6789 Category1.Name=tv Category1.DestDir=/media/tv/downloads Category2.Name=movies Category2.DestDir=/media/movies/downloads CONF fi mkdir -p /media/tv/series /media/tv/downloads /media/movies/films /media/movies/downloads chown 1000:1000 /config/nzbget.conf \ /media/tv /media/tv/series /media/tv/downloads \ /media/movies /media/movies/films /media/movies/downloads resources: requests: cpu: 10m memory: 32Mi limits: cpu: 200m memory: 128Mi volumeMounts: - name: config mountPath: /config - name: media-tv mountPath: /media/tv - name: media-movies mountPath: /media/movies containers: - name: nzbget image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/linuxserver/nzbget:v26.2 imagePullPolicy: IfNotPresent ports: - name: http containerPort: 6789 protocol: TCP env: - name: PUID value: "1000" - name: PGID value: "1000" - name: TZ value: Australia/Sydney livenessProbe: # nzbget's root path requires auth (401); a TCP check is the # dependency-free liveness signal for the web/JSON-RPC server. tcpSocket: port: http initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: tcpSocket: port: http initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 resources: requests: cpu: 200m memory: 256Mi limits: # Headroom for par2 repair + unpack of large downloads. cpu: "2" memory: 2Gi volumeMounts: - name: config mountPath: /config - name: media-tv mountPath: /media/tv - name: media-movies mountPath: /media/movies volumes: - name: config persistentVolumeClaim: claimName: nzbget-config - name: media-tv persistentVolumeClaim: claimName: media-tv - name: media-movies persistentVolumeClaim: claimName: media-movies