apiVersion: apps/v1
kind: Deployment
metadata:
  name: asr-worker
spec:
  selector:
    matchLabels:
      app: asr-worker
  template:
    metadata:
      labels:
        app: asr-worker
    spec:
      containers:
        - name: asr-worker
          image: ghcr.io/tartunlp/speech-to-text-worker:latest  # TODO
          env:
            - name: MQ_HOST
              value: $(RABBITMQ_SERVICE_HOST)
            - name: MQ_PORT
              value: $(RABBITMQ_SERVICE_PORT)
            - name: MQ_USERNAME
              valueFrom:
                secretKeyRef:
                  key: username
                  name: rabbitmq
            - name: MQ_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: rabbitmq
            - name: API_HOST
              value: http://$(ASR_SERVICE_SERVICE_HOST)
            - name: API_USERNAME
              valueFrom:
                secretKeyRef:
                  key: username
                  name: asr
            - name: API_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: asr
          volumeMounts:
            - mountPath: /dev/shm
              name: dshm
          resources:
            requests:
              memory: "16G"
              cpu: "4.0"
            limits:
              memory: "16G"
      volumes:
        - name: dshm
          emptyDir:
            medium: Memory