feat(helm): 统一镜像地址配置规范并更新CI示例

- 添加global.imageRegistry作为统一镜像仓库地址配置项
- 创建通用image模板函数处理镜像地址拼接逻辑
- 更新所有chart使用新的镜像配置结构
- 在README中添加镜像地址约定说明
- 修改CI命令示例以包含必要的镜像配置参数
- 将硬编码的镜像地址改为通过values动态配置
This commit is contained in:
王野 committed 2026-11-03 09:52:35 +08:00
1 parent 0c105e5224
commit d7366869ed
37 files changed
+200 -121

No files matched your search

@@ -22,6 +22,13 @@
{{- printf "/%s-%s" .Values.role (.Values.site | toString) -}}
{{- end -}}
{{- define "mixingx-agent-unit.image" -}}
{{- $registry := required "global.imageRegistry is required" .registry -}}
{{- $repository := required "image.repository is required" .image.repository -}}
{{- $tag := required "image.tag is required" .image.tag -}}
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
{{- end -}}
{{- define "mixingx-unit.storageClassName" -}}
{{- .Values.storage.className | default "local-path" -}}
{{- end -}}
@@ -79,11 +79,7 @@ spec:
readOnly: true
containers:
- name: {{ $name }}
{{ $backendImg := .Values.images.backend }}
{{ $agentImg := .Values.images.agent | default dict }}
{{ $backendRepo := $agentImg.repository | default $backendImg.repository }}
{{ $backendTag := $agentImg.tag | default $backendImg.tag | default .Values.tag | default "latest" }}
image: {{ .Values.registry }}/{{ $backendRepo }}:{{ $backendTag }}
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.agent) | quote }}
imagePullPolicy: IfNotPresent
ports:
- name: http
@@ -193,11 +189,7 @@ spec:
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
containers:
- name: {{ $webName }}
{{ $frontendImg := .Values.images.frontend }}
{{ $agentWebImg := .Values.images.agentWeb | default dict }}
{{ $frontendRepo := $agentWebImg.repository | default $frontendImg.repository }}
{{ $frontendTag := $agentWebImg.tag | default $frontendImg.tag | default .Values.tag | default "latest" }}
image: {{ .Values.registry }}/{{ $frontendRepo }}:{{ $frontendTag }}
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.agentWeb) | quote }}
imagePullPolicy: IfNotPresent
ports:
- name: http
@@ -263,7 +255,7 @@ spec:
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
containers:
- name: postgres
image: {{ .Values.images.postgres.repository }}:{{ .Values.images.postgres.tag | default "latest" }}
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.postgres) | quote }}
imagePullPolicy: IfNotPresent
env:
- name: POSTGRES_PASSWORD