apiVersion: apps/v1
kind: Deployment
metadata:
  name: rayflume
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: rayflume
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: rayflume
    helm.sh/chart: rayflume-4.5.0
  namespace: rayflume
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: rayflume
      app.kubernetes.io/instance: rayflume
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: rayflume
        app.kubernetes.io/name: rayflume
    spec:
      enableServiceLinks: false
      serviceAccountName: default
      automountServiceAccountToken: true
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: DEBUG
              value: "true"
            - name: ALLOWED_HOSTS
              value: rayflume.alexlebens.net,rayflume.rayflume
            - name: SECRET_KEY
              valueFrom:
                secretKeyRef:
                  key: SECRET_KEY
                  name: rayflume-config-secret
            - name: LIDARR_TOKEN
              valueFrom:
                secretKeyRef:
                  key: LIDARR_TOKEN
                  name: rayflume-config-secret
            - name: YOUTUBE_API_KEY
              valueFrom:
                secretKeyRef:
                  key: YOUTUBE_API_KEY
                  name: rayflume-config-secret
            - name: MB_USER_AGENT
              valueFrom:
                secretKeyRef:
                  key: MB_USER_AGENT
                  name: rayflume-config-secret
            - name: CELERY_BROKER_URL
              value: redis://redis-replication-rayflume-master.rayflume:6379/0
            - name: CELERY_RESULT_BACKEND
              value: redis://redis-replication-rayflume-master.rayflume:6379/0
          image: harbor.alexlebens.net/images/rayflume:0.0.7
          imagePullPolicy: IfNotPresent
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 64Mi
          volumeMounts:
            - mountPath: /data
              name: data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: rayflume-data
