apiVersion: v1
kind: Service
metadata:
  name: mqtt-svc
spec:
  selector:
    app: mqtt
  ports:
    - protocol: TCP
      port: 1883
      targetPort: 1883
  externalTrafficPolicy: Local
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mqtt
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mqtt
  template:
    metadata:
      labels:
        app: mqtt
    spec:
      containers:
        - name: mqtt
          image: oktopusp/mqtt:latest
          ports:
            - containerPort: 1883
          resources:
            requests:
              memory: 64Mi
              cpu: 100m
            limits:
              memory: 256Mi
              cpu: 200m
          imagePullPolicy: IfNotPresent
          env:
            - name: MQTT_PORT
              value: ":1883"
            - name: MQTT_TLS
              value: "false"
            - name: LOG_LEVEL
              value: "0"  # 0 - DEBUG
            - name: REDIS_ENABLE
              value: "false"

