Sunnypup-Helm/templates/mqtt.yaml
Ava Affine aca076e864 initial commit
Signed-off-by: Ava Affine <ava@sunnypup.io>
2025-07-18 11:27:07 -07:00

96 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: mqtt
labels:
app: frigate
spec:
replicas: 1
selector:
matchLabels:
app: mqtt
template:
metadata:
labels:
app: mqtt
spec:
containers:
- name: mqtt
image: eclipse-mosquitto
ports:
- name: mqtt
containerPort: 1883
- name: webui
containerPort: 9001
volumeMounts:
- name: mqtt-configmap
mountPath: /mosquitto/config/mosquitto.conf
subPath: mosquitto.conf
- name: mqtt-persistence
mountPath: /mosquitto/data
volumes:
- name: mqtt-configmap
configMap:
name: mqtt-configmap
- name: mqtt-persistence
persistentVolumeClaim:
claimName: mqtt-pvc
---
apiVersion: v1
kind: Service
metadata:
name: mqtt
labels:
app: frigate
spec:
type: NodePort
ports:
- name: mqtt
port: 1883
targetPort: mqtt
protocol: TCP
nodePort: 30000
- name: webui
port: 9001
targetPort: webui
protocol: TCP
nodePort: 30001
selector:
app: mqtt
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mqtt-pv
labels:
pvc_type: mqtt-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: {{ .Values.mqtt.path }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mqtt-pvc
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
storageClassName: ""
volumeName: mqtt-pv
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mqtt-configmap
data:
mosquitto.conf: |-
{{ (tpl (.Files.Get "configs/mqtt.yaml") . ) | nindent 4 }}