Mosquitto

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2023-11-14 15:22:11 +01:00
parent f1637fcb7b
commit 0e9e681ed5
5 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,15 @@
apiVersion: v1
data:
mosquitto.conf: |
persistence true
persistence_location /mosquitto/data/
log_dest stdout
listener 1883
listener 9090
protocol websockets
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/name: mosquitto
name: mosquitto
namespace: mosquitto

View File

@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: mosquitto
name: mosquitto
namespace: mosquitto
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/name: mosquitto
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: mosquitto
spec:
containers:
- image: eclipse-mosquitto:1.6.12
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 1
successThreshold: 1
tcpSocket:
port: websocket
timeoutSeconds: 1
name: mosquitto
ports:
- containerPort: 1883
name: mqtt
protocol: TCP
- containerPort: 9090
name: websocket
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 3
periodSeconds: 3
successThreshold: 1
tcpSocket:
port: websocket
timeoutSeconds: 1
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /mosquitto/config/mosquitto.conf
name: config
subPath: mosquitto.conf
- mountPath: /mosquitto/data
name: data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
serviceAccount: mosquitto
serviceAccountName: mosquitto
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
name: mosquitto
name: config
- name: data

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: mosquitto
name: mosquitto
namespace: mosquitto

View File

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: mosquitto
annotations:
external-dns.alpha.kubernetes.io/hostname: mosquitto.martyn.berlin
name: mosquitto
namespace: mosquitto
spec:
ports:
- name: mqtt
port: 1883
targetPort: mqtt
- name: websocket
port: 9090
targetPort: websocket
selector:
app.kubernetes.io/name: mosquitto
type: LoadBalancer

View File

@ -0,0 +1,17 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mosquitto
namespace: argocd
spec:
destination:
namespace: mosquitto
server: https://kubernetes.default.svc
project: apps
source:
path: apps-kustomized/mosquitto
repoURL: https://git.martyn.berlin/martyn/infra4talos
targetRevision: HEAD
syncPolicy:
automated:
selfHeal: true