This has been running a while

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2024-10-03 14:48:47 +00:00
parent 83200ad7c0
commit 569393186e
5 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: mosquitto-config
data:
mosquitto.conf: |
persistence true
persistence_location /mosquitto/data/
log_dest stdout
password_file /mosquitto/data/auth
# MQTTS listener
listener 8883
protocol mqtt
cafile /etc/ssl/certs/ca-certificates.crt
keyfile /mosquitto/certs/tls.key
certfile /mosquitto/certs/tls.crt
# WS Listener
listener 9001
protocol websockets

View File

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mosquitto
spec:
replicas: 1
selector:
matchLabels:
app: mosquitto
template:
metadata:
labels:
app: mosquitto
spec:
containers:
- name: mosquitto
image: eclipse-mosquitto
ports:
- containerPort: 8883
- containerPort: 9001
volumeMounts:
- mountPath: /mosquitto/config/
name: config
- mountPath: /mosquitto/certs/
name: certs
- mountPath: /mosquitto/data/
name: data
volumes:
- name: config
configMap:
name: mosquitto-config
- name: certs
secret:
secretName: mosquitto-certs
- name: data
persistentVolumeClaim:
claimName: mosquitto-data

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mosquitto-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: longhorn-fast

View File

@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: mosquitto-mqtts
spec:
type: LoadBalancer
selector:
app: mosquitto
ports:
- port: 8883
---
apiVersion: v1
kind: Service
metadata:
name: mosquitto-ws
spec:
type: ClusterIP
selector:
app: mosquitto
ports:
- port: 9001

View File

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