- 添加global.imageRegistry作为统一镜像仓库地址配置项 - 创建通用image模板函数处理镜像地址拼接逻辑 - 更新所有chart使用新的镜像配置结构 - 在README中添加镜像地址约定说明 - 修改CI命令示例以包含必要的镜像配置参数 - 将硬编码的镜像地址改为通过values动态配置
74 lines
2.9 KiB
Smarty
74 lines
2.9 KiB
Smarty
{{- define "mixingx-sso.storageClassName" -}}
|
|
{{- .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 -}}
|
|
{{- $role := $root.Values.sso.role -}}
|
|
{{- $serviceId := $root.Values.sso.serviceId -}}
|
|
{{- $pgHost := printf "%s-postgres-service" $name -}}
|
|
{{- $backendPort := $root.Values.sso.port | default 8080 -}}
|
|
HTTP_PORTS: "{{ $backendPort }}"
|
|
REDIS_HOST: "{{ $root.Values.sharedInfra.redis.host }}"
|
|
REDIS_PORT: "{{ $root.Values.sharedInfra.redis.port }}"
|
|
POSTGRESQL_HOST: "{{ $pgHost }}"
|
|
POSTGRESQL_PORT: "{{ $root.Values.sharedInfra.postgres.port }}"
|
|
POSTGRESQL_USERNAME: "{{ $root.Values.sharedInfra.postgres.username }}"
|
|
MESSAGING_HOST: "{{ $root.Values.sharedInfra.rabbitmq.host }}"
|
|
MESSAGING_PORT: "{{ $root.Values.sharedInfra.rabbitmq.port }}"
|
|
MESSAGING_USERNAME: "{{ $root.Values.sharedInfra.rabbitmq.username }}"
|
|
services__gateway__http__0: "http://gateway-service:8080"
|
|
{{ upper $role }}_SERVICE_ID: "{{ $serviceId }}"
|
|
{{- if $root.Values.audit.publisher.enabled }}
|
|
AuditMqttPublisher__BrokerUrl: "{{ $root.Values.audit.publisher.brokerUrl }}"
|
|
AuditMqttPublisher__Service: "{{ $root.Values.audit.publisher.service | default "sso" }}"
|
|
AuditMqttPublisher__InstanceId: "{{ $root.Values.audit.publisher.instanceId | default "sso" }}"
|
|
{{- end }}
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: "{{ $root.Values.sharedInfra.otlp.endpoint }}"
|
|
OTEL_EXPORTER_OTLP_PROTOCOL: "{{ $root.Values.sharedInfra.otlp.protocol }}"
|
|
OTEL_SERVICE_NAME: "{{ $name }}"
|
|
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
|
|
{{- end -}}
|
|
|
|
{{- define "mixingx-sso.tierAffinity" -}}
|
|
{{- $root := .root -}}
|
|
{{- $role := .role -}}
|
|
{{- if and $root.Values.tier $root.Values.tier.enabled -}}
|
|
{{- $service := index $root.Values.tier.services $role -}}
|
|
{{- if $service }}
|
|
affinity:
|
|
nodeAffinity:
|
|
{{- if eq ($service.mode | default "preferred") "required" }}
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: {{ $root.Values.tier.nodeLabel }}
|
|
operator: In
|
|
values:
|
|
{{- range $service.tiers }}
|
|
- {{ . }}
|
|
{{- end }}
|
|
{{- else }}
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
preference:
|
|
matchExpressions:
|
|
- key: {{ $root.Values.tier.nodeLabel }}
|
|
operator: In
|
|
values:
|
|
{{- range $service.tiers }}
|
|
- {{ . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end -}}
|