---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: message-consumer
  labels:
    app: message-consumer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: message-consumer
  template:
    metadata:
      labels:
        app: message-consumer
    spec:
      containers:
      - image: gjtempleton/pika:0.2.1
        name: message-consumer
        command:
          - "python"
          - "-u"
          - "/pika-reader.py"
        env:
          - name: RABBIT_CONNECTION
            value: rabbitmq.default.svc.cluster.local
          - name: RABBIT_USERNAME
            value: user
          - name: RABBIT_PASSWORD
            valueFrom:
              secretKeyRef:
                key: rabbitmq-password
                name: rabbitmq
          - name: MESSAGES_PER_SECOND
            value: "1"
        resources:
          requests:
            cpu: 200m
            memory: 64Mi
          limits:
            cpu: 200m
            memory: 64Mi