apiVersion: apps/v1
kind: Deployment
metadata:
  name: neo4j-query-service
  labels:
    app: neo4j-query-service
    monitor: go-service
spec:
  replicas: 1 
  selector:
    matchLabels:
      app: neo4j-query-service
      monitor: go-service
  template:
    metadata:
      labels:
        app: neo4j-query-service
        monitor: go-service
    spec:
      containers:
      - name: neo4j-query-service
        image: datastropheregistry.azurecr.io/query-service:latest
        ports:
        - containerPort: 8080
        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"
        - name: MINIO_ADDRESS
          value: minio:9000
        - name: MINIO_ACCESSKEYID
          value: root
        - name: MINIO_ACCESSKEY
          value: DikkeDraak
        - name: QUERY_CONVERSION_LANGUAGE
          value: cypher
        - name: QUERY_EXECUTION
          value: neo4j
        resources:
            requests:
              memory: "100Mi"
              cpu: "100m"
            limits:
              memory: "250Mi"
              cpu: "500m"
      imagePullSecrets:
      - name: docker-regcred