Files
mixingx.hub.chart/release-charts/mixingx-edge-unit/templates/nanomq.yaml
T
ximenchuifeng b0563138f4 feat(chart): 新增 mixingx-mqttx chart + NanoMQ 开启 WebSocket 端口
- 新增 release-charts/mixingx-mqttx:浏览器端 MQTT 客户端 (emqx/mqttx-web),
  Deployment + Service(ClusterIP) + Ingress(host-based),与 sso/gateway 平级,
  供运维通过 Argo CD 随时部署/删除监控各 Edge 的 NanoMQ broker。
- edge-unit/nanomq.yaml:NanoMQ 容器声明 ws containerPort(8083)、Service 加 ws port,
  供 MQTTX Web 等浏览器客户端经 ws 连接。Service 保持 ClusterIP,
  运维需外部调试时手动改 NodePort。
- edge-unit/values.yaml:新增 mqtt.wsPort(默认 8083)。
2026-08-06 15:49:19 +08:00

68 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{- $name := include "mixingx-unit.name" . -}}
{{- $brokerName := include "mixingx-unit.mqttBrokerName" . -}}
{{- $brokerSvcName := include "mixingx-unit.mqttBrokerServiceName" . -}}
{{- $credentialRef := include "mixingx-unit.mqttCredentialRef" . -}}
{{- if .Values.mqtt.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $brokerName }}
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: {{ $brokerName }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: {{ $brokerName }}
template:
metadata:
labels:
app.kubernetes.io/component: {{ $brokerName }}
spec:
{{ include "mixingx-unit.backendScheduling" . | nindent 6 }}
containers:
- name: nanomq
image: "{{ .Values.mqtt.image.repository }}:{{ .Values.mqtt.image.tag }}"
imagePullPolicy: IfNotPresent
ports:
- name: mqtt
containerPort: {{ .Values.mqtt.port }}
protocol: TCP
# WebSocket listener:emqx/nanomq 镜像默认开启 8083(路径 /mqtt)。
# 声明此 containerPort 供 MQTTX Web 等浏览器客户端通过 ws 连接。
# Service 默认 ClusterIP,运维需外部调试时手动改 NodePort。
- name: ws
containerPort: {{ .Values.mqtt.wsPort | default 8083 }}
protocol: TCP
resources:
{{ toYaml .Values.mqtt.resources | default dict | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $brokerSvcName }}
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/component: {{ $brokerName }}
mixingx.io/role: mqtt-broker
mixingx.io/node-id: {{ $name }}
annotations:
mixingx.io/credential-ref: {{ $credentialRef }}
spec:
type: ClusterIP
selector:
app.kubernetes.io/component: {{ $brokerName }}
ports:
- name: mqtt
port: {{ .Values.mqtt.port }}
targetPort: mqtt
protocol: TCP
- name: ws
port: {{ .Values.mqtt.wsPort | default 8083 }}
targetPort: ws
protocol: TCP
{{- end }}