apiVersion: apps/v1
kind: Deployment
metadata:
  name: device-simulator
  labels:
    app: device-simulator
spec:
  selector:
    matchLabels:
      app: device-simulator
  template:
    metadata:
      labels:
        app: device-simulator
    spec:
      containers:
        - name: device-simulator
          image: gcr.io/iot-garage-242501/device-simulator:0897264e9b3e969f1f87b566edbef482c3f85fcf
          imagePullPolicy: Always
          resources:
            limits:
              memory: "100M"
              cpu: "100m"
            requests:
              memory: "25M"
              cpu: "25m"
          command: ["python"]
          args:
            [
              "simulate.py",
              "--env",
              "production",
              "--imap-server",
              "imap.gmail.com",
            ]
          env:
            - name: LOG_LEVEL
              value: "INFO"
            - name: SLACK_WEBHOOK
              valueFrom:
                secretKeyRef:
                  name: device-simulator-accounts
                  key: slack_webhook
            - name: USER_A_EMAIL
              valueFrom:
                secretKeyRef:
                  name: device-simulator-accounts
                  key: user_a_email
            - name: USER_B_EMAIL
              valueFrom:
                secretKeyRef:
                  name: device-simulator-accounts
                  key: user_b_email
            - name: USER_A_PASS
              valueFrom:
                secretKeyRef:
                  name: device-simulator-accounts
                  key: user_a_pass
            - name: USER_B_PASS
              valueFrom:
                secretKeyRef:
                  name: device-simulator-accounts 
                  key: user_b_pass
