---
apiVersion: v1
kind: Pod
metadata:
  name: temp-analyzer-pod
  namespace: uc0
  labels:
    environment: production
    app: temp-analyzer-pod
spec:
  containers:
  - name: t-a-container
    image: usman476/mqtt-kafka-faust:latest
    env:
    - name: MQTT_BROKER
      value: "mqtt-mosquitto.uc0.svc.cluster.local"
    - name: MQTT_BROKER_PORT
      value: "1883"
    - name: MQTT_ACTUATOR_TOPIC
      value: "mqtt/temperature/actions"
    - name: KAFKA_BROKER
      value: "bitnami-kafka-0.bitnami-kafka-headless.uc0.svc.cluster.local:9092"
    - name: KAFKA_TOPIC
      value: "temperature-readings"
    - name: VALUE_TYPE
      value: "float"
    - name: INVALID_VALUE
      value: "200.0"
    - name: MIN_THRESHOLD_VALUE
      value: "10.0"
    - name: MAX_THRESHOLD_VALUE
      value: "90.0"
    - name: SAVE_DATA
      value: "file"
    command: ["python3"]
    args: ["temp-analyzer.py", "worker", "-l", "info"]
    imagePullPolicy: "IfNotPresent"
    volumeMounts:
    - mountPath: /analyzer
      name: temperature-analyzer-volume
  restartPolicy: Always
  nodeSelector:
    kubernetes.io/hostname: worker-vm-2
  volumes:
  - name: temperature-analyzer-volume
    hostPath:
      # directory location on host
      path: /opt/data
      # this field is optional
      type: Directory