- Добавлен EMQX deployment + WS ingress (адаптирован из sless) - Добавлен iot-operator deployment с RBAC (ServiceAccount, ClusterRole) - Postgres: заменён self-hosted на managed (dc5db45d namespace) - Image: naeel/iot-operator:v0.2.0 (Docker Hub) - Убран imagePullSecrets (Docker Hub публичный)
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
# Создано: 2026-04-12
|
||
# MQTT over WebSocket через Ingress с TLS termination.
|
||
# Причина: порт 1883 заблокирован NSX-T Edge firewall на уровне облака.
|
||
# Решение: EMQX WebSocket listener (8083) проксируется через nginx-ingress с TLS.
|
||
#
|
||
# IoT устройство подключается: wss://iot.kube5s.ru/mqtt
|
||
# IoT Консоль (UI): https://iot.kube5s.ru/console
|
||
#
|
||
# DNS A-запись: iot.kube5s.ru → 185.247.187.147
|
||
# TLS: cert-manager + letsencrypt-prod, secret=iot-kube5s-ru-tls
|
||
#
|
||
# Применение: kubectl apply -f deployments/k8s/emqx-ws-ingress.yaml
|
||
|
||
---
|
||
apiVersion: v1
|
||
kind: Service
|
||
metadata:
|
||
name: emqx-ws
|
||
namespace: sless
|
||
# Отдельный Service — WebSocket порт для Ingress
|
||
spec:
|
||
selector:
|
||
app: emqx
|
||
ports:
|
||
- name: mqtt-ws
|
||
port: 8083
|
||
targetPort: 8083
|
||
protocol: TCP
|
||
---
|
||
apiVersion: networking.k8s.io/v1
|
||
kind: Ingress
|
||
metadata:
|
||
name: emqx-mqtt-websocket
|
||
namespace: sless
|
||
annotations:
|
||
kubernetes.io/ingress.class: nginx
|
||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||
# WebSocket: nginx-ingress добавляет Upgrade/Connection при proxy-http-version=1.1
|
||
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
||
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
|
||
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
||
spec:
|
||
ingressClassName: nginx
|
||
tls:
|
||
- hosts:
|
||
- iot.kube5s.ru
|
||
secretName: iot-kube5s-ru-tls
|
||
rules:
|
||
- host: iot.kube5s.ru
|
||
http:
|
||
paths:
|
||
# MQTT over WebSocket — wss://iot.kube5s.ru/mqtt
|
||
- path: /mqtt
|
||
pathType: Exact
|
||
backend:
|
||
service:
|
||
name: emqx-ws
|
||
port:
|
||
number: 8083
|
||
# IoT Консоль (UI) — https://iot.kube5s.ru/console
|
||
- path: /console
|
||
pathType: Exact
|
||
backend:
|
||
service:
|
||
name: iot-operator
|
||
port:
|
||
number: 9090
|