feat(mixingx-agent-unit): 添加后端配置模板并集成Ultra服务发现
- 新增 `mixingx-unit.backendConfigData` 模板定义,统一管理后端服务配置项 - 在 unit.yaml 中添加配置校验和注解,确保配置变更时触发滚动更新 - 将硬编码的 ConfigMap 配置替换为模板引用,提高维护性 - 添加 Ultra 服务发现配置,默认指向 ultra-service:8080 - 支持多 Ultra 部署场景下的地址覆盖能力
This commit is contained in:
1 parent
6fcb0340ed
commit
f74201a7ef
3 files changed
+33
-18
No files matched your search
@@ -49,3 +49,28 @@ affinity:
|
||||
topologyKey: kubernetes.io/hostname
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mixingx-unit.backendConfigData" -}}
|
||||
{{- $name := include "mixingx-unit.name" . -}}
|
||||
{{- $serviceId := include "mixingx-unit.serviceId" . -}}
|
||||
{{- $pgHost := printf "%s-postgres-service" $name -}}
|
||||
HTTP_PORTS: "{{ .Values.ports.backend }}"
|
||||
REDIS_HOST: "{{ .Values.sharedInfra.redis.host }}"
|
||||
REDIS_PORT: "{{ .Values.sharedInfra.redis.port }}"
|
||||
POSTGRESQL_HOST: "{{ $pgHost }}"
|
||||
POSTGRESQL_PORT: "{{ .Values.sharedInfra.postgres.port }}"
|
||||
POSTGRESQL_USERNAME: "{{ .Values.sharedInfra.postgres.username }}"
|
||||
MESSAGING_HOST: "{{ .Values.sharedInfra.rabbitmq.host }}"
|
||||
MESSAGING_PORT: "{{ .Values.sharedInfra.rabbitmq.port }}"
|
||||
MESSAGING_USERNAME: "{{ .Values.sharedInfra.rabbitmq.username }}"
|
||||
services__gateway__http__0: "http://gateway-service:8080"
|
||||
services__ultra__http__0: "http://{{ .Values.sharedInfra.ultra.host }}:{{ .Values.sharedInfra.ultra.port }}"
|
||||
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 }}"
|
||||
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
|
||||
{{- end -}}
|
||||
Reference in new issue
Block a user