homelab/archive/2022.07.bxl-k3s-pi/apps/hass/mosquitto.yaml

64 lines
1.1 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: mosquitto
namespace: hass
data:
mosquitto.conf: |
# persistence true
# persistence_location /mosquitto/data
listener 1883
allow_anonymous true
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mosquitto
namespace: hass
labels:
app: mosquitto
spec:
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app: mosquitto
template:
metadata:
labels:
app: mosquitto
spec:
volumes:
- name: config
configMap:
name: mosquitto
containers:
- name: mosquitto
image: eclipse-mosquitto:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: config
mountPath: /mosquitto/config/mosquitto.conf
subPath: mosquitto.conf
readOnly: true
---
apiVersion: v1
kind: Service
metadata:
name: mosquitto
namespace: hass
spec:
type: ClusterIP
ports:
- name: mqtt
port: 1883
targetPort: 1883
protocol: TCP
selector:
app: mosquitto