feat(agent): 支持 AGENT_PHASE_TYPE 注入(对齐 apphost WithPhaseType)

- mixingx-agent-unit: values 加 phaseType 字段,unit.yaml ConfigMap 渲染 AGENT_PHASE_TYPE
- 根 chart _backend.tpl: agent 分支渲染 AGENT_PHASE_TYPE
- 根 chart instances.yaml: 遍历 agents 时透传 phaseType
- 空 phaseType 不渲染(向后兼容)

对应 apphost.cs WithPhaseType 扩展,k8s 部署侧此前缺失此环境变量,
导致 agent 启动读不到工序类型,触发 ultra 阶段6 扫码校验 Fail。
This commit is contained in:
ximenchuifeng committed 2026-07-07 16:43:20 +08:00
1 parent f677ca8206
commit aeb34d1e5b
4 files changed
+10 -1

No files matched your search

@@ -93,6 +93,9 @@ data:
MESSAGING_USERNAME: "{{ .Values.sharedInfra.rabbitmq.username }}"
services__gateway__http__0: "http://gateway-service:8080"
AGENT_SERVICE_ID: "{{ $serviceId }}"
{{- if .Values.phaseType }}
AGENT_PHASE_TYPE: "{{ .Values.phaseType }}"
{{- end }}
OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.sharedInfra.otlp.endpoint }}"
OTEL_EXPORTER_OTLP_PROTOCOL: "{{ .Values.sharedInfra.otlp.protocol }}"
OTEL_SERVICE_NAME: "{{ $name }}"
@@ -6,6 +6,7 @@ role: agent
site: "0"
description: "Agent 实例 0"
serviceId: ""
phaseType: "" # 工序类型(对应 apphost 的 AGENT_PHASE_TYPE,如 DieCasting/Passivation/Machining);空则不注入
database: ""
images:
+3
View File
@@ -138,6 +138,9 @@ data:
{{- if .serviceId }}
{{- if hasPrefix "agent" .name }}
AGENT_SERVICE_ID: "{{ .serviceId }}"
{{- if .phaseType }}
AGENT_PHASE_TYPE: "{{ .phaseType }}"
{{- end }}
{{- else if hasPrefix "edge" .name }}
EDGE_SERVICE_ID: "{{ .serviceId }}"
{{- else if hasPrefix "sso" .name }}
+3 -1
View File
@@ -8,10 +8,12 @@
{{- $site := "" -}}
{{- $nodeName := "" -}}
{{- $pointAffinity := "" -}}
{{- $phaseType := "" -}}
{{- if kindIs "map" $raw -}}
{{- $site = $raw.site | default "" -}}
{{- $nodeName = $raw.nodeName | default "" -}}
{{- $pointAffinity = $raw.nodeAffinity | default "" -}}
{{- $phaseType = $raw.phaseType | default "" -}}
{{- else -}}
{{- $site = $raw | toString -}}
{{- end -}}
@@ -21,7 +23,7 @@
{{- $basePath := printf "/agent-%s" $site }}
{{- $description := printf "Agent 实例 %s" $site }}
# ═══ 实例: {{ $instName }} ({{ $description }}) ═══
{{ include "mixingx.backend" (dict "name" $instName "image" "agent" "role" "agent" "serviceId" $instName "database" $dbName "description" $description "nodeName" $nodeName "pointAffinity" $pointAffinity "root" $) }}
{{ include "mixingx.backend" (dict "name" $instName "image" "agent" "role" "agent" "serviceId" $instName "phaseType" $phaseType "database" $dbName "description" $description "nodeName" $nodeName "pointAffinity" $pointAffinity "root" $) }}
{{ include "mixingx.frontend" (dict "name" $webName "image" "agent-web" "basePath" $basePath "affinity" $instName "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "agent" "root" $) }}
{{ include "mixingx.postgres" (dict "name" $instName "database" $dbName "pgStorage" "5Gi" "affinity" true "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "agent" "root" $) }}
{{- end }}