Files
mixingx.hub.chart/release-charts/mixingx-ultra/templates/_helpers.tpl
T

67 lines
2.5 KiB
Smarty

{{- define "mixingx-ultra.storageClassName" -}}
{{- .Values.storage.className | default "local-path" -}}
{{- end -}}
{{- define "mixingx-ultra.configData" -}}
{{- $root := . -}}
{{- $cfg := $root.Values.ultra -}}
{{- $name := $cfg.name -}}
{{- $role := $cfg.role -}}
{{- $serviceId := $cfg.serviceId -}}
{{- $pgHost := printf "%s-postgres-service" $name -}}
HTTP_PORTS: "8080"
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 "ultra" }}"
AuditMqttPublisher__InstanceId: "{{ $root.Values.audit.publisher.instanceId | default "ultra" }}"
{{- 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-ultra.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 -}}