apiVersion: apps/v1
kind: Deployment
metadata:
    namespace: iot
    name: mqtt
    labels:
        app.kubernetes.io/name: mqtt
spec:
    replicas: 1
    selector:
        matchLabels:
            role: mqtt
    template:
        metadata:
            labels:
                role: mqtt
        spec:
            containers:
            -   name: mqtt
                image: eclipse-mosquitto:latest
                env:
                -   name: TZ
                    value: America/Chicago
                ports:
                -   containerPort: 1883
                    name: mqtt
                volumeMounts:
                -   name: conf
                    mountPath: /mosquitto/config/mosquitto.conf
                    subPath: mosquitto.conf
            restartPolicy: Always
            volumes:
            -   name: conf
                configMap:
                    name: mosquitto.conf
                    items:
                    -   key: mosquitto.conf
                        path: mosquitto.conf
