46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mosquitto-deployment
|
|
labels:
|
|
app: mosquitto
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: mosquitto
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mosquitto
|
|
spec:
|
|
containers:
|
|
- name: mosquitto
|
|
image: eclipse-mosquitto
|
|
volumeMounts:
|
|
- name: mosquitto-volume
|
|
mountPath: /mosquitto
|
|
- name: mosquitto-config
|
|
mountPath: /mosquitto/config/mosquitto.conf
|
|
volumes:
|
|
- name: mosquitto-volume
|
|
hostPath:
|
|
path: /root/kubernetes/homeassistant/data/mosquitto
|
|
type: DirectoryOrCreate
|
|
- name: mosquitto-config
|
|
hostPath:
|
|
path: /root/kubernetes/homeassistant/data/mosquitto.conf
|
|
type: File
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mosquitto-service
|
|
spec:
|
|
selector:
|
|
app: mosquitto
|
|
ports:
|
|
- protocol: TCP
|
|
port: 1883
|
|
targetPort: 1883
|