apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: mqtt
    component: mqtt-connector
  name: mqtt-connector
  namespace: openfaas
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mqtt
      component: mqtt-connector
  template:
    metadata:
      labels:
        app: mqtt
        component: mqtt-connector
    spec:
      containers:
        - name: mqtt
          image: f43i4n/openfaas-mqtt-connector:latest
          imagePullPolicy: Always
          resources:
            limits:
              memory: "128Mi"
              cpu: "500m"
            requests:
              memory: "32Mi"
              cpu: "100m"
          env:
            - name: mqtt_url
              value: tcp://broker:1883
            - name: gateway_url
              value: "http://gateway.openfaas:8080"
            - name: print_response
              value: "true"
            - name: print_response_body
              value: "true"
            - name: basic_auth
              value: "true"
            - name: secret_mount_path
              value: "/var/secrets/"
            - name: topic_delimiter
              value: ","
            - name: asynchronous_invocation
              value: "true"
          volumeMounts:
            - name: auth
              readOnly: true
              mountPath: "/var/secrets/"
      volumes:
        - name: auth
          secret:
            secretName: basic-auth
