---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: plex
  name: plex
  namespace: seedbox
spec:
  replicas: 1
  selector:
    matchLabels:
      app: plex
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: plex
    spec:
      containers:
      - image: docker.io/plexinc/pms-docker:1.25.2.5319-c43dc0277
        name: plex
        ports:
        - containerPort: 32400
          name: http
        env:
        - name: PUID
          value: "1000"
        - name: PGID
          value: "1000"
        - name: VERSION
          value: latest
        - name: TZ
          value: "Europe/Paris"
        - name: PLEX_CLAIM
          valueFrom:
            secretKeyRef:
              name: plex-secret
              key: plex-claim
        volumeMounts:
        - mountPath: "/config"
          name: plex-config
        # TODO: weird issue with having 2 juicefs pvc here
        - mountPath: "/data"
          name: plex-all
        - mountPath: "/transcode"
          name: plex-transcode
      volumes:
      - name: plex-config
        persistentVolumeClaim:
          claimName: plex-config
      - name: plex-all
        persistentVolumeClaim:
          claimName: plex-all
      - name: plex-transcode
        emptyDir: {}
