133 lines
7.8 KiB
YAML
133 lines
7.8 KiB
YAML
{{- if .Values.app.image }}
|
||
{{- fail "app.image переехал в image.hrbox (см. CHANGELOG, миграция 2.x -> 3.0)" }}
|
||
{{- end }}
|
||
{{- if .Values.app.chatbox.image }}
|
||
{{- fail "app.chatbox.image переехал в image.chatbox" }}
|
||
{{- end }}
|
||
{{- if .Values.app.goworker.image }}
|
||
{{- fail "app.goworker.image переехал в image.goworker" }}
|
||
{{- end }}
|
||
{{- if .Values.app.kedoca.image }}
|
||
{{- fail "app.kedoca.image переехал в image.kedoca" }}
|
||
{{- end }}
|
||
{{- if .Values.app.file_processor }}
|
||
{{- fail "app.file_processor переименован в app.fileProcessor, а образ переехал в image.fileProcessor" }}
|
||
{{- end }}
|
||
{{- if .Values.app.custom_policy }}
|
||
{{- fail "app.custom_policy переименован в app.customPolicy" }}
|
||
{{- end }}
|
||
{{- if .Values.app.replicas.websocket }}
|
||
{{- fail "app.replicas.websocket переименован в app.replicas.chatbox ещё в версии 2.0" }}
|
||
{{- end }}
|
||
{{- if .Values.resources.websocket }}
|
||
{{- fail "resources.websocket переименован в resources.chatbox ещё в версии 2.0" }}
|
||
{{- end }}
|
||
{{- if .Values.nats.image }}
|
||
{{- fail "nats.image переехал в image.nats" }}
|
||
{{- end }}
|
||
|
||
{{- if not .Values.ingress.host }}
|
||
{{- fail "Заполните ingress.host — домен, по которому открывается HRBox" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.defaultTenantHostname }}
|
||
{{- fail "Заполните app.defaultTenantHostname (обычно совпадает с ingress.host)" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.postgres.password }}
|
||
{{- fail "Заполните app.postgres.password" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.s3.key }}
|
||
{{- fail "Заполните app.s3.key — без хранилища файлов HRBox не работает" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.s3.secret }}
|
||
{{- fail "Заполните app.s3.secret" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.hub.token }}
|
||
{{- fail "Заполните app.hub.token — токен выдают сотрудники HRBox" }}
|
||
{{- end }}
|
||
{{- if not .Values.secrets.existingSecret }}
|
||
{{- if not .Values.secrets.cookieValidationKey }}
|
||
{{- fail "Заполните secrets.cookieValidationKey (openssl rand -hex 16)" }}
|
||
{{- end }}
|
||
{{- if not .Values.secrets.encryptionKey }}
|
||
{{- fail "Заполните secrets.encryptionKey (openssl rand -base64 48). Потеря ключа делает зашифрованные данные нечитаемыми" }}
|
||
{{- end }}
|
||
{{- if not .Values.secrets.servicesInternalSecret }}
|
||
{{- fail "Заполните secrets.servicesInternalSecret (openssl rand -base64 48)" }}
|
||
{{- end }}
|
||
{{- if not .Values.app.chatbox.wrappingKey }}
|
||
{{- fail "Заполните app.chatbox.wrappingKey (openssl rand -hex 16)" }}
|
||
{{- end }}
|
||
{{- end }}
|
||
{{- if .Values.ingress.tls.enabled }}
|
||
{{- if not .Values.ingress.tls.secretName }}
|
||
{{- fail "При ingress.tls.enabled нужен ingress.tls.secretName с TLS-сертификатом" }}
|
||
{{- end }}
|
||
{{- end }}
|
||
|
||
{{- if and (not .Values.dragonfly.enabled) (not .Values.app.redis.host) }}
|
||
{{- fail "dragonfly.enabled: false требует app.redis.host — иначе приложение обратится к сервису, которого нет в релизе" }}
|
||
{{- end }}
|
||
{{- if and (not .Values.nats.enabled) (not .Values.app.nats.url) }}
|
||
{{- fail "nats.enabled: false требует app.nats.url — иначе приложение обратится к брокеру, которого нет в релизе" }}
|
||
{{- end }}
|
||
|
||
{{- if and .Values.nats.enabled .Values.nats.cluster.enabled }}
|
||
{{- if ne (.Values.nats.replicas | int) (.Values.nats.cluster.replicas | int) }}
|
||
{{- fail (printf "nats.replicas (%d) и nats.cluster.replicas (%d) должны совпадать: иначе часть нод не войдёт в кластер, а реплики JetStream-стримов будут посчитаны неверно" (.Values.nats.replicas | int) (.Values.nats.cluster.replicas | int)) }}
|
||
{{- end }}
|
||
{{- end }}
|
||
|
||
{{- $player := .Values.app.nanabushPlayer }}
|
||
{{- if and $player.enabled (not $player.deployment.enabled) }}
|
||
{{- fail "app.nanabushPlayer.enabled требует deployment.enabled: HRBox нельзя переключить на плеер, которого нет в кластере" }}
|
||
{{- end }}
|
||
{{- if and $player.enabled (not $player.ingress.enabled) }}
|
||
{{- fail "app.nanabushPlayer.enabled требует ingress.enabled: иначе HRBox выдаст ссылку на недоступный адрес" }}
|
||
{{- end }}
|
||
{{- if and $player.ingress.enabled (not $player.deployment.enabled) }}
|
||
{{- fail "app.nanabushPlayer.ingress.enabled требует deployment.enabled: маршрут вёл бы в несуществующий Service" }}
|
||
{{- end }}
|
||
{{- if and $player.ingress.enabled (not .Values.ingress.enabled) }}
|
||
{{- fail "Путь плеера публикуется на основном Ingress, поэтому нужен ingress.enabled: true" }}
|
||
{{- end }}
|
||
{{- if $player.deployment.enabled }}
|
||
{{- $basePath := $player.basePath | default "/nanabush-player" }}
|
||
{{- if eq (trimSuffix "/" $basePath) "" }}
|
||
{{- fail "app.nanabushPlayer.basePath не может быть корнем: корень домена занят самим HRBox" }}
|
||
{{- end }}
|
||
{{- if not (hasPrefix "/" $basePath) }}
|
||
{{- fail "app.nanabushPlayer.basePath должен начинаться со слэша, например /nanabush-player" }}
|
||
{{- end }}
|
||
{{- if not (include "hrbox.imageTag" .Values.image.nanabushPlayer) }}
|
||
{{- fail "image.nanabushPlayer должен содержать явный тег версии, например nanabush-player:1.0.11 — из него выводится версия плеера в launch-тикете" }}
|
||
{{- end }}
|
||
{{- if not $player.deployment.binaryCapabilities.basePath }}
|
||
{{- fail "On-premise монтирует плеер под путём, поэтому нужен образ с поддержкой base path. Проверьте сборку и верните deployment.binaryCapabilities.basePath: true" }}
|
||
{{- end }}
|
||
{{- if not $player.deployment.existingSecret.name }}
|
||
{{- fail "Заполните app.nanabushPlayer.deployment.existingSecret.name" }}
|
||
{{- end }}
|
||
{{- if $player.deployment.existingSecret.create }}
|
||
{{- if not $player.keys.ticketHs256 }}
|
||
{{- fail "Заполните app.nanabushPlayer.keys.ticketHs256 (openssl rand -base64 48)" }}
|
||
{{- end }}
|
||
{{- if not $player.keys.sessionHs256 }}
|
||
{{- fail "Заполните app.nanabushPlayer.keys.sessionHs256 (openssl rand -base64 48)" }}
|
||
{{- end }}
|
||
{{- if eq $player.keys.ticketHs256 $player.keys.sessionHs256 }}
|
||
{{- fail "app.nanabushPlayer.keys.ticketHs256 и sessionHs256 должны отличаться: это ключи разных контуров" }}
|
||
{{- end }}
|
||
{{- if and $player.deployment.existingSecret.keys.ticketKeys (not $player.keys.ticketKeys) }}
|
||
{{- fail "Указано имя ключа ticketKeys в секрете, но само кольцо app.nanabushPlayer.keys.ticketKeys пустое" }}
|
||
{{- end }}
|
||
{{- end }}
|
||
{{- if and $player.deployment.redis.urlFromExistingSecret $player.deployment.existingSecret.create }}
|
||
{{- fail "redis.urlFromExistingSecret: true требует existingSecret.create: false — Secret, создаваемый чартом, не содержит URL Redis" }}
|
||
{{- end }}
|
||
{{- if $player.deployment.metrics.enabled }}
|
||
{{- if eq ($player.deployment.metrics.port | int) ($player.service.port | int) }}
|
||
{{- fail "Порт метрик плеера должен отличаться от публичного порта сервиса, иначе метрики окажутся доступны содержимому курсов" }}
|
||
{{- end }}
|
||
{{- end }}
|
||
{{- end }}
|