From e3552039d6360b6ca7c724fa1a72d1fabc14e177 Mon Sep 17 00:00:00 2001 From: ximenchuifeng Date: Sun, 11 Oct 2026 14:49:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(gitops):=20Edge=20=E5=AE=9E=E4=BE=8B=20ADS?= =?UTF-8?q?=20Router=20=E8=BA=AB=E4=BB=BD=E9=80=8F=E4=BC=A0(demo/dev=20?= =?UTF-8?q?=E5=A5=91=E7=BA=A6=E5=90=8C=E6=AD=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit environments/{demo,dev}/edges.yaml 实例条目增 adsRouter 身份:demo=10.200.0.17.1.1 / demo-2=10.200.0.18.1.1(前 4 字节互异,第 4 位对齐 idWorkerId 便于记忆;publicAddress= 192.168.1.173 为运维占位,同出口=多 Edge 同出口验收场景,YAML 注释已标)。ApplicationSet values 模板 hasKey 守卫透传 adsRouter 块;实例缺身份时经 chart 渲染守卫显式失败 (no shared default identity)。dev 停用模板契约同步,未启用。远端清单仍由 Edge SQLite/UI 管理,部署 values 不回写覆盖。渲染证据 hub docs/research/evidence/ 2026-10-10-ads-router-impl/W9-*.md --- applications/demo/edges.yaml | 13 +++++++++++++ applications/dev/disabled/edges.yaml | 14 +++++++++++++- environments/demo/edges.yaml | 10 ++++++++++ environments/dev/edges.yaml | 5 +++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/applications/demo/edges.yaml b/applications/demo/edges.yaml index c94d8f9..ebfe3cd 100644 --- a/applications/demo/edges.yaml +++ b/applications/demo/edges.yaml @@ -39,6 +39,19 @@ spec: nodeSelector: mixingx.io/edge-node: "{{ .nodeLabel }}" {{- end }} + {{- /* ADS Router 逐实例身份透传(chart 默认 enabled=true):实例缺 adsRouter + 身份时不在此兜底,由 chart 渲染守卫明确拒绝。 */ -}} + {{- if hasKey . "adsRouter" }} + adsRouter: + localNetId: "{{ .adsRouter.localNetId }}" + publicAddress: "{{ .adsRouter.publicAddress }}" + {{- if hasKey .adsRouter "clientEndPoint" }} + clientEndPoint: "{{ .adsRouter.clientEndPoint }}" + {{- end }} + {{- if hasKey .adsRouter "externalPort" }} + externalPort: {{ .adsRouter.externalPort }} + {{- end }} + {{- end }} - repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git targetRevision: master ref: values diff --git a/applications/dev/disabled/edges.yaml b/applications/dev/disabled/edges.yaml index 8c98bef..b4a7815 100644 --- a/applications/dev/disabled/edges.yaml +++ b/applications/dev/disabled/edges.yaml @@ -35,10 +35,22 @@ spec: site: "{{ .id }}" idWorkerId: {{ .idWorkerId }} description: "{{ .description }}" - {{- if .nodeLabel }} + {{- if hasKey . "nodeLabel" }} nodeSelector: mixingx.io/edge-node: "{{ .nodeLabel }}" {{- end }} + {{- /* ADS Router 逐实例身份透传,契约同 demo(本模板保持停用)。 */ -}} + {{- if hasKey . "adsRouter" }} + adsRouter: + localNetId: "{{ .adsRouter.localNetId }}" + publicAddress: "{{ .adsRouter.publicAddress }}" + {{- if hasKey .adsRouter "clientEndPoint" }} + clientEndPoint: "{{ .adsRouter.clientEndPoint }}" + {{- end }} + {{- if hasKey .adsRouter "externalPort" }} + externalPort: {{ .adsRouter.externalPort }} + {{- end }} + {{- end }} - repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git targetRevision: master ref: values diff --git a/environments/demo/edges.yaml b/environments/demo/edges.yaml index 3d3657d..3f8b495 100644 --- a/environments/demo/edges.yaml +++ b/environments/demo/edges.yaml @@ -2,6 +2,16 @@ edges: - id: demo idWorkerId: 17 description: Demo Edge + # ADS Router 本方身份:显式分配,重启不变,绝不从 Pod IP 推导。 + # localNetId 第 4 字节与 idWorkerId 对齐便于记忆;列表内前 4 字节互异(10.200.0.17 / 10.200.0.18)。 + adsRouter: + localNetId: "10.200.0.17.1.1" + # 运维占位:demo 集群节点出站地址,两 Edge 同出口(多 Edge 同出口验收场景); + # 上线前按现场 PLC 可回程的实际地址核实替换。 + publicAddress: "192.168.1.173" - id: demo-2 idWorkerId: 18 description: Demo Edge 2 + adsRouter: + localNetId: "10.200.0.18.1.1" + publicAddress: "192.168.1.173" # 同 demo:运维占位,两 Edge 同出口 diff --git a/environments/dev/edges.yaml b/environments/dev/edges.yaml index 4a36676..818444a 100644 --- a/environments/dev/edges.yaml +++ b/environments/dev/edges.yaml @@ -3,3 +3,8 @@ edges: idWorkerId: 17 description: Dev Edge nodeLabel: node2 + # ADS Router 本方身份,契约同 demo(本环境模板停用,仅维护契约); + # 第三字节取 1 与 demo 环境(10.200.0.*)区分作用域。 + adsRouter: + localNetId: "10.200.1.17.1.1" + publicAddress: "192.168.1.173" # 运维占位,启用前按现场核实替换