apiVersion: apps/v1
kind: Deployment

metadata:
  name: rabbitmq-consumer-deployment
  labels:
    run: rabbitmq-consumer

spec:
  replicas: 1
  selector:
    matchLabels:
      run: rabbitmq-consumer

  template:
    metadata:
      labels:
        run: rabbitmq-consumer
        app: rabbitmq-consumer
    spec:
      containers:
        - name: rabbitmq-consumer
          image: ngacrregistry.azurecr.io/nileshgule/techtalksconsumer:rabbitmq-keda-6.0
          env:
            - name: ASPNETCORE_ENVIRONMENT
              value: "Development"
            - name: RABBITMQ_HOST_NAME
              value: "rabbitmq"
            - name: RABBITMQ_USER_NAME
              value: "user"
            - name: RABBITMQ_PASSWORD
              value: "PASSWORD"
            - name: RABBITMQ_BATCH_SIZE
              value: "50"
          imagePullPolicy: Always
      restartPolicy: Always
      imagePullSecrets:
        - name: acr-image-secret
      terminationGracePeriodSeconds: 30
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 10.0.0.10
        searches:
          - default.svc.cluster.local
          - svc.cluster.local
          - cluster.local
        options:
          - name: ndots
            value: "5"
      nodeSelector:
        kubernetes.io/role: agent
        beta.kubernetes.io/os: linux
        type: virtual-kubelet
      tolerations:
        - key: virtual-kubelet.io/provider
          operator: Equal
          value: azure
          effect: NoSchedule
