77 lines
2.2 KiB
YAML
77 lines
2.2 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mosquitto
|
|
labels:
|
|
app.kubernetes.io/name: mosquitto
|
|
spec:
|
|
revisionHistoryLimit: 3
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: mosquitto
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: mosquitto
|
|
spec:
|
|
initContainers:
|
|
- name: create-config
|
|
image: "eclipse-mosquitto:2.0.22"
|
|
command: ['sh', '-c', "cd /mosquitto/config/ && cp -v /tmp/mosquitto.conf mosquitto.conf && cp -v /tmp/password_file password_file"]
|
|
volumeMounts:
|
|
- name: mosquitto-conf
|
|
mountPath: /mosquitto/config
|
|
- name: mosquitto-base-config
|
|
mountPath: /tmp/mosquitto.conf
|
|
subPath: mosquitto.conf
|
|
- name: mosquitto-base-config
|
|
mountPath: /tmp/password_file
|
|
subPath: password_file
|
|
containers:
|
|
- name: mosquitto
|
|
image: "eclipse-mosquitto:2.0.22"
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: mqtt
|
|
containerPort: 1883
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: mosquitto-data
|
|
mountPath: /mosquitto/data
|
|
- name: mosquitto-conf
|
|
mountPath: /mosquitto/config
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 1883
|
|
initialDelaySeconds: 0
|
|
failureThreshold: 3
|
|
timeoutSeconds: 1
|
|
periodSeconds: 60
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 1883
|
|
initialDelaySeconds: 0
|
|
failureThreshold: 3
|
|
timeoutSeconds: 1
|
|
periodSeconds: 60
|
|
startupProbe:
|
|
tcpSocket:
|
|
port: 1883
|
|
initialDelaySeconds: 0
|
|
failureThreshold: 30
|
|
timeoutSeconds: 1
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: mosquitto-data
|
|
persistentVolumeClaim:
|
|
claimName: mosquitto-data
|
|
- name: mosquitto-conf
|
|
persistentVolumeClaim:
|
|
claimName: mosquitto-conf
|
|
- name: mosquitto-base-config
|
|
configMap:
|
|
name: mosquitto-base-config |