---
apiVersion: v1
kind: Pod
metadata:
  name: mqtt-publisher-pod
  namespace: uc0
  labels:
    environment: production
    app: mqtt-publisher-pod
spec:
  containers:
  - name: mqtt-publisher-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: SENSORS
      value: "1"
    - name: MESSAGE_DELAY
      value: "0.5"
    - name: MQTT_TOPIC
      value: "mqtt/temperature/readings"
    - name: VALUE_TYPE
      value: "float"
    - name: START_VALUE
      value: "1.0"
    - name: END_VALUE
      value: "99.99"
    - name: INVALID_VALUE_OCCURRENCE
      value: "5"
    - name: INVALID_VALUE
      value: "200.0"
    - name: INPUT_FILE
      value: "generated_values.csv"
    command: ["python3"]
    args: ["publisher.py"]
    imagePullPolicy: "IfNotPresent"
    volumeMounts:
    - mountPath: /data
      name: data-volume
  restartPolicy: Always
  nodeSelector:
    kubernetes.io/hostname: worker-vm-1
  volumes:
  - name: data-volume
    hostPath:
      # directory location on host
      path: /opt/data
      # this field is optional
      type: Directory