apiVersion: apps/v1
kind: Deployment
metadata:
  name: bazarr
  namespace: stack-arr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bazarr
  template:
    metadata:
      labels:
        app: bazarr
    spec:
      imagePullSecrets:
      - name: regcred
      containers:
      - name: bazarr
        image: lscr.io/linuxserver/bazarr:1.5.6
        securityContext:
          capabilities:
            add:
              - NET_ADMIN
        ports:
          - containerPort: 6767
            name: webui
        env:
        - name: BAZARR_DEBUG
          value: "true"
        - name: PUID
          value: "1013"
        - name: PGID
          value: "1013"
        - name: TZ
          value: 'Etc/UTC'
        - name: POSTGRES_ENABLED
          value: 'true'
        - name: POSTGRES_HOST
          value: 'stolon-proxy-service.postgresql.svc.cluster.local'
        - name: POSTGRES_PORT
          value: '5432'
        - name: POSTGRES_USERNAME
          valueFrom:
            secretKeyRef:
              name: bazarr-secret
              key: username
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: bazarr-secret
              key: password
        - name: POSTGRES_DATABASE
          valueFrom:
            secretKeyRef:
              name: bazarr-secret
              key: maindb
        volumeMounts:
        - name: config
          mountPath: /config
        - name: media
          mountPath: /media
        - name: lingarrpy
          mountPath: /app/bazarr/bin/bazarr/subtitles/tools/translate/services/lingarr_translator.py
          subPath: lingarr_translator.py
          readOnly: true
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: bazarr-config-pvc
      - name: media
        persistentVolumeClaim:
          claimName: bazarr-media-pvc
      - name: lingarrpy
        configMap:
          name: bazarr-lingarrpy-configmap



