apiVersion: apps/v1
kind: Deployment
metadata:
  name: worker-deployment
spec:
  replicas: 8
  selector:
    matchLabels:
      component: worker
  template:
    metadata:
      labels:
        component: worker
    spec:
      containers:
        - name: worker
          image: delftdatasystems/schema-matching-engine:latest
          resources:
            limits:
              memory: "2Gi"
              cpu: "1"
            requests:
              memory: "2Gi"
              cpu: "1"
          command: ["celery"]
          args: ["-A", "app.celery", "worker", "-l", "INFO", "--concurrency=1", "--max-memory-per-child=1953125"]
          ports:
            - containerPort: 5000
          env:
            - name: REDIS_HOST
              value: redis-master
            - name: REDIS_PORT
              value: '6379'
            - name: REDIS_PASSWORD
              value: "redis"
            - name: RABBITMQ_HOST
              value: rabbitmq
            - name: RABBITMQ_PORT
              value: '5672'
            - name: RABBITMQ_DEFAULT_USER
              value: rabbitmq
            - name: RABBITMQ_DEFAULT_PASS
              value: rabbitmq
            - name: MINIO_HOST
              value: minio
            - name: MINIO_PORT
              value: '9000'
            - name: MINIO_ACCESS_KEY
              value: "minio"
            - name: MINIO_SECRET_KEY
              value: "minio123"
            - name: POSTGRES_USER
              value: "postgres"
            - name: POSTGRES_PASSWORD
              value: "postgres"
            - name: POSTGRES_HOST
              value: "postgres-postgresql"
            - name: POSTGRES_PORT
              value: "5432"