cw-infra-apps/charts/backend2/templates/_globals.tpl

126 lines
4.5 KiB
Smarty
Executable File

{{/* Global Environment Templates */}}
{{- define "global.env.kafka" -}}
{{- if .Values.global.infrastructure.kafka.enabled -}}
{{- tpl (.Values.global.envTemplates.kafka | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.redis" -}}
{{- if .Values.global.infrastructure.redis.enabled -}}
{{- tpl (.Values.global.envTemplates.redis | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.cassandra" -}}
{{- if .Values.global.infrastructure.cassandra.enabled -}}
{{- tpl (.Values.global.envTemplates.cassandra | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.postgres" -}}
{{- if .Values.global.infrastructure.postgres.enabled -}}
{{- tpl (.Values.global.envTemplates.postgres | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.s3" -}}
{{- if .Values.global.infrastructure.s3.enabled -}}
{{- tpl (.Values.global.envTemplates.s3 | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.s3_upload" -}}
{{- if .Values.global.infrastructure.s3_upload.enabled -}}
{{- tpl (.Values.global.envTemplates.s3_upload | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.general" -}}
{{- if .Values.global.infrastructure.general.enabled -}}
{{- tpl (.Values.global.envTemplates.general | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.auth" -}}
{{- if .Values.global.infrastructure.auth.enabled -}}
{{- tpl (.Values.global.envTemplates.auth | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.call" -}}
{{- if .Values.global.infrastructure.call.enabled -}}
{{- tpl (.Values.global.envTemplates.call | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.callevent" -}}
{{- if .Values.global.infrastructure.callevent.enabled -}}
{{- tpl (.Values.global.envTemplates.callevent | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.elastic" -}}
{{- if .Values.global.infrastructure.elastic.enabled -}}
{{- tpl (.Values.global.envTemplates.elastic | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.imageRepository" -}}
{{- $prefix := .Values.global.dockerRegistryPrefix | default "registry.co-work.ru/" -}}
{{- $name := .Chart.Name | default "unknown" -}}
{{- printf "%s%s" $prefix $name -}}
{{- end -}}
{{- define "global.env.configService" -}}
- name: CONFIG_SERVICE_URL
value: {{ .Values.global.services.configServiceUrl | default "configservice://config-app:9090" | quote }}
{{- end -}}
{{- define "global.env.chatsplitter" -}}
{{- if .Values.global.infrastructure.chatsplitter.enabled -}}
{{- tpl (.Values.global.envTemplates.chatsplitter | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.env.user" -}}
{{- if .Values.global.infrastructure.user.enabled -}}
{{- tpl (.Values.global.envTemplates.user | toYaml) . | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- define "global.serviceUrl" -}}
http://{{ .host }}:{{ .port }}
{{- end -}}
{{- define "global.env.observability" -}}
- name: OTEL_LOGS_EXPORTER
value: {{ .Values.global.observability.exporters.logs | quote }}
- name: OTEL_METRICS_EXPORTER
value: {{ .Values.global.observability.exporters.metrics | quote }}
- name: OTEL_TRACES_EXPORTER
value: {{ .Values.global.observability.exporters.traces | quote }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.global.observability.otlpEndpoint | quote }}
- name: OTEL_BSP_EXPORT_TIMEOUT
value: {{ .Values.global.observability.bsp.exportTimeout | quote }}
- name: OTEL_BLRP_MAX_QUEUE_SIZE
value: {{ .Values.global.observability.blrp.maxQueueSize | quote }}
- name: OTEL_BLRP_MAX_EXPORT_BATCH_SIZE
value: {{ .Values.global.observability.blrp.maxExportBatchSize | quote }}
- name: OTEL_RESOURCE_DETECTORS
value: {{ .Values.global.observability.resourceDetectors | quote }}
- name: HEAP_SIZE_RATIO
value: {{ .Values.global.observability.heapSizeRatio | quote }}
- name: OTEL_SERVICE_NAME
value: {{ include "cw-common.fullname" . | quote }}
- name: PYROSCOPE_APPLICATION_NAME
value: {{ include "cw-common.fullname" . | quote }}
- name: PYROSCOPE_SERVER_ADDRESS
value: {{ .Values.global.observability.pyroscopeEndpoint | quote }}
- name: PYROSCOPE_FORMAT
value: {{ .Values.global.observability.pyroscope.format | quote }}
- name: PYROSCOPE_PROFILER_LOCK
value: {{ .Values.global.observability.pyroscope.profilerLock | quote }}
- name: PYROSCOPE_AGENT_ENABLED
value: {{ .Values.global.observability.pyroscope.enabled | quote }}
{{- end -}}