apiVersion: apps/v1
kind: Deployment
metadata:
  name: query-handler
  labels:
    app: query-service
spec:
  replicas: 1 
  selector:
    matchLabels:
      app: query-service
  template:
    metadata:
      labels:
        app: query-service 
    spec:
      containers:
      - name: query-service
        image: datastropheregistry.azurecr.io/query-service:latest
        ports:
        - containerPort: 3000 
        env:
        - name: RABBIT_HOST
          value: rabbitmq
        - name: RABBIT_PORT
          value: "5672"
        - name: RABBIT_USER
          valueFrom:
            secretKeyRef: 
              name: rabbitmq-default-user
              key: username
        - name: RABBIT_PASSWORD
          valueFrom:
            secretKeyRef: 
              name: rabbitmq-default-user
              key: password
        - name: REDIS_ADDRESS
          value: redis.redis.svc.cluster.local:6379
        - name: LOG_MESSAGES
          value: "true"
        resources:
            requests:
              memory: "100Mi"
              cpu: "100m"
            limits:
              memory: "250Mi"
              cpu: "500m"
      imagePullSecrets:
      - name: docker-regcred