apiVersion: apps/v1
kind: Deployment
metadata:
  name: bazarr
  labels:
    app.kubernetes.io/name: bazarr
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: bazarr
  template:
    metadata:
      labels:
        app.kubernetes.io/name: bazarr
    spec:
      containers:
        - name: bazarr
          image: ghcr.io/k8s-at-home/bazarr:v1.0.2
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 50m
              memory: 200Mi
          ports:
            - name: http
              protocol: TCP
              containerPort: 6767
          volumeMounts:
            - name: bazarr-config
              mountPath: /config
            - name: bazarr-media
              mountPath: /data
          livenessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 5
          readinessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 5
          env:
            - name: TZ
              value: ${CONFIG_TIMEZONE}
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
        fsGroupChangePolicy: "OnRootMismatch"
      volumes:
        - name: bazarr-config
          persistentVolumeClaim:
            claimName: bazarr-config
        - name: bazarr-media
          persistentVolumeClaim:
            claimName: shared-media
