apiVersion: v1
kind: Service
metadata:
  name: mosquitto
  namespace: mqtt
  labels:
    tier: db
spec:
  type: LoadBalancer
  selector:             # indicates into which pods ClusterIP provides access
    app: mosquitto
  ports:
    - protocol: TCP
      port: 61883
      targetPort: 1883    # port exposed by Pod
      nodePort: 31883
