first commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: tcp-services
|
||||||
|
namespace: nginx
|
||||||
|
data:
|
||||||
|
"1883": "mosquitto/mosquitto-mqtt:1883"
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-config
|
||||||
|
namespace: mosquitto
|
||||||
|
data:
|
||||||
|
mosquitto.conf: |
|
||||||
|
|
||||||
|
persistence true
|
||||||
|
persistence_location /mosquitto/data/
|
||||||
|
log_dest stdout
|
||||||
|
log_type all
|
||||||
|
connection_messages true
|
||||||
|
log_timestamp true
|
||||||
|
|
||||||
|
password_file /mosquitto/secrets/passwd
|
||||||
|
allow_anonymous false
|
||||||
|
|
||||||
|
# MQTTS listener
|
||||||
|
listener 1883
|
||||||
|
protocol mqtt
|
||||||
|
|
||||||
|
# WS Listener
|
||||||
|
listener 9001
|
||||||
|
protocol websockets
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
namespace: mosquitto
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mosquitto
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mosquitto
|
||||||
|
image: eclipse-mosquitto
|
||||||
|
ports:
|
||||||
|
- containerPort: 1883
|
||||||
|
- containerPort: 9001
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /mosquitto/config/mosquitto.conf
|
||||||
|
subPath: mosquitto.conf
|
||||||
|
name: config
|
||||||
|
- mountPath: /mosquitto/secrets
|
||||||
|
name: passwd
|
||||||
|
- mountPath: /mosquitto/data/
|
||||||
|
name: data
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: mosquitto-config
|
||||||
|
- name: passwd
|
||||||
|
secret:
|
||||||
|
secretName: mosquitto-passwd
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mosquitto-data
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-ws
|
||||||
|
namespace: mosquitto
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/backend-protocol: "HTTP" # Required for WebSocket
|
||||||
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # Keep connections alive
|
||||||
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: mosquitto.infrastructure.helmholz.cloud
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: mosquitto-ws
|
||||||
|
port:
|
||||||
|
number: 9001
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-passwd
|
||||||
|
namespace: mosquitto
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
passwd: YWRtaW46JDckMTAxJGl6U0tJOHVSazU2QnVOSGMkSEorNXFOSUlVdStFNGo1ZXB0TnpNUWJIZnJvK0ZRQTlBM0NOY2h2YXJoQU1WN25hb3hxYUdaMzBLMkorU2dVeFBBZGdsTnVFN1VqdndacVNQdUtTS3c9PQo=
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
labels:
|
||||||
|
name: mosquitto
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-data
|
||||||
|
namespace: mosquitto
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: longhorn
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-mqtt
|
||||||
|
namespace: mosquitto
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: mosquitto
|
||||||
|
ports:
|
||||||
|
- name: mqtt
|
||||||
|
port: 1883
|
||||||
|
targetPort: 1883
|
||||||
|
protocol: TCP
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-ws
|
||||||
|
namespace: mosquitto
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: mosquitto
|
||||||
|
ports:
|
||||||
|
- port: 9001
|
||||||
Reference in New Issue
Block a user