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-platform.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-platform.tierAffinity" -}}
|
||||
{{- $root := .root -}}
|
||||
{{- $role := .role -}}
|
||||
|
||||
@@ -27,7 +27,8 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .role "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
||||
{{ $image := index $root.Values.images .image }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -158,7 +159,8 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
||||
{{ $image := index $root.Values.images .image }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -226,7 +228,7 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: postgres
|
||||
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
|
||||
@@ -22,7 +22,8 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: audit
|
||||
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
||||
{{ $auditImage := index .Values.images .Values.audit.image }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" .Values.global.imageRegistry "image" $auditImage) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -143,7 +144,8 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ .Values.audit.webName }}
|
||||
image: "{{ .Values.registry }}/{{ .Values.audit.webImage }}:{{ .Values.tag | default "latest" }}"
|
||||
{{ $auditWebImage := index .Values.images .Values.audit.webImage }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" .Values.global.imageRegistry "image" $auditWebImage) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
@@ -208,7 +210,7 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: postgres
|
||||
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
|
||||
@@ -33,7 +33,8 @@ spec:
|
||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "sharedDatastores" "root" $root) | nindent 6 }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
image: {{ .image }}
|
||||
{{ $image := index $root.Values.images .image }}
|
||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: tcp
|
||||
|
||||
@@ -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
|
||||
@@ -40,12 +40,26 @@ tier:
|
||||
audit: { mode: required, tiers: [infra] }
|
||||
sharedDatastores: { mode: required, tiers: [infra] }
|
||||
|
||||
images:
|
||||
gateway: { repository: gateway, tag: "" }
|
||||
sso: { repository: sso, tag: "" }
|
||||
ssoWeb: { repository: sso-web, tag: "" }
|
||||
ultra: { repository: ultra, tag: "" }
|
||||
ultraWeb: { repository: ultra-web, tag: "" }
|
||||
audit: { repository: audit, tag: "" }
|
||||
auditWeb: { repository: audit-web, tag: "" }
|
||||
postgres: { repository: postgres, tag: "17" }
|
||||
redis: { repository: redis, tag: "8.6" }
|
||||
mongo: { repository: mongo, tag: "8.3" }
|
||||
rabbitmq: { repository: rabbitmq, tag: "4.3-management" }
|
||||
nanomq: { repository: nanomq, tag: "0.25.2-2" }
|
||||
|
||||
standalones:
|
||||
- name: sso
|
||||
image: sso
|
||||
role: sso
|
||||
webName: sso-web
|
||||
webImage: sso-web
|
||||
webImage: ssoWeb
|
||||
webBasePath: /sso/
|
||||
serviceId: sso
|
||||
database: sso-db
|
||||
@@ -57,7 +71,7 @@ standalones:
|
||||
image: ultra
|
||||
role: ultra
|
||||
webName: ultra-web
|
||||
webImage: ultra-web
|
||||
webImage: ultraWeb
|
||||
webBasePath: /ultra/
|
||||
serviceId: ultra
|
||||
database: ultra-db
|
||||
@@ -77,7 +91,7 @@ audit:
|
||||
port: 5900
|
||||
replicas: 2
|
||||
webName: audit-web
|
||||
webImage: audit-web
|
||||
webImage: auditWeb
|
||||
webBasePath: /audit/
|
||||
webPort: 8900
|
||||
database: audit-db
|
||||
@@ -96,22 +110,22 @@ audit:
|
||||
|
||||
sharedDatastores:
|
||||
- name: redis
|
||||
image: docker.io/library/redis:8.6
|
||||
image: redis
|
||||
port: 6379
|
||||
storage: 2Gi
|
||||
mountPath: /data
|
||||
- name: mongo
|
||||
image: docker.io/library/mongo:8.3
|
||||
image: mongo
|
||||
port: 27017
|
||||
storage: 5Gi
|
||||
mountPath: /data/db
|
||||
- name: messaging
|
||||
image: docker.io/library/rabbitmq:4.3-management
|
||||
image: rabbitmq
|
||||
port: 5672
|
||||
storage: 2Gi
|
||||
mountPath: /var/lib/rabbitmq
|
||||
- name: audit-nanomq
|
||||
image: emqx/nanomq:0.25.2-2
|
||||
image: nanomq
|
||||
port: 1883
|
||||
storage: 1Gi
|
||||
mountPath: /var/lib/nanomq
|
||||
|
||||
Reference in new issue
Block a user