apiVersion: apps/v1
kind: Deployment
metadata:
  name: plex
  labels:
    app: plex
  annotations:
    keel.sh/policy: "force"
    keel.sh/match-tag: "true"
    keel.sh/trigger: "poll"
    keel.sh/pollSchedule: "@daily"
spec:
  replicas: 1
  revisionHistoryLimit: 0
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: plex
  template:
    metadata:
      labels:
        app: plex
    spec:
      hostNetwork: true
      containers:
        - name: plex
          image: ghcr.io/linuxserver/plex:latest
          env:
            - name: PUID
              value: "1000"
            - name: PGID
              value: "1000"
            - name: UMASK
              value: "022"
            - name: TZ
              value: "Europe/Warsaw"
            - name: VERSION
              value: "docker"
          ports:
            - containerPort: 32400
          volumeMounts:
            - mountPath: /config
              name: config-volume
            - mountPath: /tv
              name: media-volume
              subPath: tvshows
            - mountPath: /movies
              name: media-volume
              subPath: movies
      volumes:
        - name: config-volume
          persistentVolumeClaim:
            claimName: plex-config
        - name: media-volume
          nfs:
            server: nas01.home.arpa
            path: /mnt/zp01/media
