feat(helm): 统一镜像地址配置规范并更新CI示例
- 添加global.imageRegistry作为统一镜像仓库地址配置项 - 创建通用image模板函数处理镜像地址拼接逻辑 - 更新所有chart使用新的镜像配置结构 - 在README中添加镜像地址约定说明 - 修改CI命令示例以包含必要的镜像配置参数 - 将硬编码的镜像地址改为通过values动态配置
This commit is contained in:
1 parent
0c105e5224
commit
d7366869ed
37 files changed
+200
-121
No files matched your search
@@ -2,6 +2,13 @@
|
||||
{{- .Values.storage.className | default "local-path" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mixingx-sso.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-sso.configData" -}}
|
||||
{{- $root := . -}}
|
||||
{{- $name := $root.Values.sso.name -}}
|
||||
|
||||
@@ -30,7 +30,7 @@ spec:
|
||||
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ $name }}
|
||||
image: {{ $root.Values.registry }}/{{ $root.Values.images.sso.repository | default "sso" }}:{{ $root.Values.images.sso.tag | default $root.Values.tag | default "latest" }}
|
||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.sso) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -128,7 +128,7 @@ spec:
|
||||
{{ include "mixingx-sso.tierAffinity" (dict "role" "web" "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ $webName }}
|
||||
image: {{ $root.Values.registry }}/{{ $root.Values.images.ssoWeb.repository | default "sso-web" }}:{{ $root.Values.images.ssoWeb.tag | default $root.Values.tag | default "latest" }}
|
||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.ssoWeb) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -192,7 +192,7 @@ spec:
|
||||
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: postgres
|
||||
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
registry: 192.168.1.105:8888/mixingx
|
||||
tag: latest
|
||||
global:
|
||||
imageRegistry: ""
|
||||
|
||||
timezone: Asia/Shanghai
|
||||
|
||||
storage:
|
||||
@@ -7,7 +8,6 @@ storage:
|
||||
|
||||
sharedInfra:
|
||||
postgres:
|
||||
image: docker.io/library/postgres:17
|
||||
username: postgres
|
||||
password: "Admin12345"
|
||||
port: 5432
|
||||
@@ -42,9 +42,6 @@ audit:
|
||||
brokerUrl: "mqtt://audit-nanomq-service:1883"
|
||||
|
||||
images:
|
||||
sso:
|
||||
repository: sso
|
||||
tag: ""
|
||||
ssoWeb:
|
||||
repository: sso-web
|
||||
tag: ""
|
||||
sso: { repository: sso, tag: "" }
|
||||
ssoWeb: { repository: sso-web, tag: "" }
|
||||
postgres: { repository: postgres, tag: "17" }
|
||||
Reference in new issue
Block a user