- 新增 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)。
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
{{- $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 }}
|