Compare commits
95 Commits
fix/ugog_w
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17d7a43be7 | ||
|
|
5e43578d4f | ||
|
|
cb3c9fa7e1 | ||
|
|
98274b1858 | ||
|
|
04d9f75d17 | ||
| 0818b65fb6 | |||
|
|
218a59a539 | ||
|
|
ed0fb7a64c | ||
|
|
55bc42ecbb | ||
|
|
d533095b8f | ||
| 4dc99af141 | |||
|
|
39e917aa9e | ||
|
|
f576b1a919 | ||
|
|
78a123b55b | ||
|
|
69c0340cb4 | ||
|
|
1963a3f2d9 | ||
|
|
fe149fcf8b | ||
|
|
8bd8d743e4 | ||
|
|
4f801b48e9 | ||
|
|
3a6214f113 | ||
|
|
9ce09df7b1 | ||
|
|
3420f3e5af | ||
|
|
88e9084833 | ||
|
|
b036f2b644 | ||
|
|
018414a676 | ||
|
|
0f761e6607 | ||
|
|
a12566f5a8 | ||
|
|
cfb61e1c9d | ||
| ff22c6b6d2 | |||
| 372f29560a | |||
| ee836c60f4 | |||
|
|
bb7e7eaba0 | ||
|
|
f5fa1fadb6 | ||
|
|
7fd0b082c8 | ||
| a8f9eac64f | |||
| 6f1de64a49 | |||
| 29833a7e5a | |||
|
|
c89aaab9eb | ||
| 0aafb8a1ea | |||
|
|
46b396c284 | ||
| 1f4a4836c1 | |||
|
|
0d11e9fadf | ||
|
|
608f87b715 | ||
|
|
5fad7d54e8 | ||
|
|
62a1b2746e | ||
|
|
72f9de81c5 | ||
|
|
70729ddb45 | ||
|
|
2862c98202 | ||
|
|
a7be87135c | ||
|
|
c418f1dd46 | ||
|
|
51e41320ec | ||
|
|
98dbc31121 | ||
|
|
c3bc4a3c1a | ||
|
|
1cc9a3738e | ||
|
|
26436489d4 | ||
|
|
c95a0a5025 | ||
|
|
eee76def70 | ||
|
|
619842f5c3 | ||
|
|
0a57f42906 | ||
|
|
c5e677a1fb | ||
|
|
861d096a91 | ||
|
|
8ab0874359 | ||
|
|
79870f05ad | ||
|
|
2036426465 | ||
|
|
36f0fadb2f | ||
|
|
090763162b | ||
|
|
661595f782 | ||
|
|
6b7d461034 | ||
|
|
3ab786c0bd | ||
|
|
c277aca334 | ||
|
|
e46f0b060c | ||
|
|
859546dafb | ||
|
|
842e117365 | ||
|
|
60695926e6 | ||
|
|
70e718b77e | ||
|
|
c50733f6f5 | ||
|
|
be0ad57e6e | ||
|
|
315cbfa604 | ||
|
|
55afb1d495 | ||
|
|
dd82889504 | ||
|
|
37ba18d7c6 | ||
|
|
3f65d3c243 | ||
|
|
f60c96a903 | ||
|
|
05bfd32067 | ||
|
|
6029dd2984 | ||
|
|
0c0dfc460c | ||
|
|
cee4a7c2b4 | ||
|
|
75c6892e0a | ||
|
|
0eb91b6148 | ||
|
|
e2d69d037e | ||
|
|
2e52d00c79 | ||
|
|
27802513d0 | ||
|
|
79cbc5a02f | ||
|
|
6fc991d540 | ||
|
|
096db3d70b |
10
CLAUDE.md
10
CLAUDE.md
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
| Путь | Что |
|
| Путь | Что |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `clusters/` | 17 точек входа Flux + шаблон `contour` — **источник истины «что где раскатано»** |
|
| `clusters/` | Точки входа Flux + шаблон `contour` — **источник истины «что где раскатано»** |
|
||||||
| `infrastructure/` | 44 платформенных компонента |
|
| `infrastructure/` | 44 платформенных компонента |
|
||||||
| `apps/` | 39 прикладных сервисов |
|
| `apps/` | 39 прикладных сервисов |
|
||||||
| `docs/apps/` | 34 mermaid-диаграммы по сервисам + `README.md` с доменной группировкой |
|
| `docs/apps/` | 34 mermaid-диаграммы по сервисам + `README.md` с доменной группировкой |
|
||||||
@ -40,12 +40,12 @@
|
|||||||
|
|
||||||
**Кластер.** `clusters/<cluster>/kustomization.yaml` — плоский список `../../apps/<app>/<cluster>`. Инфраструктура подключается двумя разными способами:
|
**Кластер.** `clusters/<cluster>/kustomization.yaml` — плоский список `../../apps/<app>/<cluster>`. Инфраструктура подключается двумя разными способами:
|
||||||
|
|
||||||
- `d8-ugmk-prod`, `sarex-contour`, `ugok`, `uralkal`, `vad` — прямо в корневом kustomization как `../../infrastructure/<comp>/<c>`;
|
- `d8-ugmk-prod`, `ugok`, `uralkal`, `vad` — прямо в корневом kustomization как `../../infrastructure/<comp>/<c>`;
|
||||||
- `brusnika-prod`, `brusnika-stage`, `vk-infra`, `vk-prod` — через `clusters/<c>/infrastructure/kustomization.yaml`, который ссылается на оверлеи `../../../infrastructure/<comp>/<c>` (`base` + патч HelmRelease + сопутствующие манифесты компонента);
|
- `brusnika-prod`, `brusnika-stage`, `vk-infra`, `vk-prod` — через `clusters/<c>/infrastructure/kustomization.yaml`, который ссылается на оверлеи `../../../infrastructure/<comp>/<c>` (`base` + патч HelmRelease + сопутствующие манифесты компонента);
|
||||||
- `wb`, `yc-cps-prod`, `yc-infra-prod`, `yc-k8s-test-02` — через `clusters/<c>/infrastructure/kustomization.yaml`, который ссылается на `../../../infrastructure/<comp>` (резолвится в `base`), а различия лежат в `clusters/<c>/infrastructure/patches/*.yaml`;
|
- `wb`, `yc-cps-prod`, `yc-infra-prod`, `yc-k8s-test-02` — через `clusters/<c>/infrastructure/kustomization.yaml`, который ссылается на `../../../infrastructure/<comp>` (резолвится в `base`), а различия лежат в `clusters/<c>/infrastructure/patches/*.yaml`;
|
||||||
- `stand` — послойно: `layers.yaml` объявляет Flux-`Kustomization` `00-vault → 10-mesh → 20-data → 30-platform → 40-routing` (каталоги `clusters/stand/<NN>-<layer>/`). Слои ссылаются на оверлеи `infrastructure/<comp>/contour-template`, а значения контура (`${STORAGE_CLASS}`, `${HOST_*}`, `${GATEWAY_REPLICAS}`) Flux подставляет через `postBuild.substituteFrom` из ConfigMap `contour-vars`.
|
- `stand` — послойно: `layers.yaml` объявляет Flux-`Kustomization` `00-vault → 10-mesh → 20-data → 30-platform → 40-routing` (каталоги `clusters/stand/<NN>-<layer>/`). Слои ссылаются на оверлеи `infrastructure/<comp>/contour-template`, а значения контура (`${STORAGE_CLASS}`, `${HOST_*}`, `${GATEWAY_REPLICAS}`) Flux подставляет через `postBuild.substituteFrom` из ConfigMap `contour-vars`.
|
||||||
|
|
||||||
Кластеры с приложениями: `asterus`, `brusnika-prod`, `brusnika-stage`, `d8-ugmk-prod`, `sarex-contour`, `ugok`, `uralkal`, `vad`, `wb`, `yc-ecp`, `yc-k8s-test`. Только инфраструктура: `stand`, `vk-infra`, `vk-prod`, `yc-cps-prod`, `yc-infra-prod`, `yc-k8s-test-02`. Шаблон: `contour`.
|
Кластеры с приложениями: `asterus`, `brusnika-prod`, `brusnika-stage`, `d8-ugmk-prod`, `ugok`, `uralkal`, `vad`, `wb`, `yc-ecp`. Только инфраструктура: `stand`, `vk-infra`, `vk-prod`, `yc-cps-prod`, `yc-infra-prod`, `yc-k8s-test-02`. Шаблон: `contour`.
|
||||||
|
|
||||||
**Приложение.** `apps/<app>/base/` — по одному `.yaml` на процесс (`backend.yaml`, `celery.yaml`, `frontend.yaml`) плюс `namespace.yaml`; оверлеи в `apps/<app>/<cluster>/`. Namespace = имя приложения. Рядом с манифестами лежит документация: `CONFIGURATION.md` (все env-переменные и откуда берутся), `ENDPOINTS.md` (исходящие HTTP-вызовы), `openapi.yaml` (входящий контракт), `.env.example`. Если процессов несколько — файлы с префиксом процесса: `api.ENDPOINTS.md`, `pdm.CONFIGURATION.md`, `frontend.CONFIGURATION.md`.
|
**Приложение.** `apps/<app>/base/` — по одному `.yaml` на процесс (`backend.yaml`, `celery.yaml`, `frontend.yaml`) плюс `namespace.yaml`; оверлеи в `apps/<app>/<cluster>/`. Namespace = имя приложения. Рядом с манифестами лежит документация: `CONFIGURATION.md` (все env-переменные и откуда берутся), `ENDPOINTS.md` (исходящие HTTP-вызовы), `openapi.yaml` (входящий контракт), `.env.example`. Если процессов несколько — файлы с префиксом процесса: `api.ENDPOINTS.md`, `pdm.CONFIGURATION.md`, `frontend.CONFIGURATION.md`.
|
||||||
|
|
||||||
@ -73,7 +73,7 @@
|
|||||||
## Ловушки
|
## Ловушки
|
||||||
|
|
||||||
- **`dsinv/`** — оверлей есть у 25 приложений, но `clusters/dsinv/` не существует. Это материализованный снимок живого контура WB, а не источник деплоя. Развёрнутым не считать.
|
- **`dsinv/`** — оверлей есть у 25 приложений, но `clusters/dsinv/` не существует. Это материализованный снимок живого контура WB, а не источник деплоя. Развёрнутым не считать.
|
||||||
- **Две несовместимые конвенции оверлеев** (`IAC-CATALOG.md` §5.3.4). `d8-ugmk-prod`, `yc-k8s-test`, `vad`, `uralkal`, `sarex-contour`, `dsinv` наследуют `base` и патчат его. `brusnika-prod`, `brusnika-stage`, `yc-ecp`, `asterus` — полные копии HelmRelease, которые молча дрейфуют от base. Правка `base` на них не влияет. **`wb` (4 из 27) и `ugok` (9 из 33) смешанные** — проверяйте `resources:` конкретного оверлея; в `ugok` причина обычно указана комментарием в его `kustomization.yaml`.
|
- **Две несовместимые конвенции оверлеев** (`IAC-CATALOG.md` §5.3.4). `d8-ugmk-prod`, `vad`, `uralkal`, `dsinv` наследуют `base` и патчат его. `brusnika-prod`, `brusnika-stage`, `yc-ecp`, `asterus` — полные копии HelmRelease, которые молча дрейфуют от base. Правка `base` на них не влияет. **`wb` (4 из 27) и `ugok` (9 из 33) смешанные** — проверяйте `resources:` конкретного оверлея; в `ugok` причина обычно указана комментарием в его `kustomization.yaml`.
|
||||||
- **`asterus` подключён почти пустым**: оверлеи есть у 26 приложений, но в `clusters/asterus/kustomization.yaml` активен только `auth-flow`, остальные закомментированы. Инфраструктуры в кластере нет.
|
- **`asterus` подключён почти пустым**: оверлеи есть у 26 приложений, но в `clusters/asterus/kustomization.yaml` активен только `auth-flow`, остальные закомментированы. Инфраструктуры в кластере нет.
|
||||||
- **Слайс публикуется для каждого `clusters/*/kustomization.yaml`** — в том числе для тестовых и инфраструктурных кластеров. Новая папка в `clusters/` с этим файлом автоматически станет слайсом на следующем теге. У `contour` такого файла нет, поэтому для него слайс не собирается.
|
- **Слайс публикуется для каждого `clusters/*/kustomization.yaml`** — в том числе для тестовых и инфраструктурных кластеров. Новая папка в `clusters/` с этим файлом автоматически станет слайсом на следующем теге. У `contour` такого файла нет, поэтому для него слайс не собирается.
|
||||||
- **`IAC-CATALOG.md` — снимок на 05.08.2026** и по составу приложений на контур уже расходится с реальностью (там у `wb` ноль приложений, фактически 26 оверлеев). Всегда сверяться с `clusters/*/kustomization.yaml`.
|
- **`IAC-CATALOG.md` — снимок на 05.08.2026** и по составу приложений на контур уже расходится с реальностью (там у `wb` ноль приложений, фактически 26 оверлеев). Всегда сверяться с `clusters/*/kustomization.yaml`.
|
||||||
@ -82,7 +82,7 @@
|
|||||||
- **Path-роутинг лежит в `infrastructure/istio-config/<c>/` у большинства контуров, но не у WB.** В `clusters/wb/infrastructure/patches/istio-config.yaml` через Istio публикуются только платформенные UI (Gitea, Grafana, OpenObserve, Superset, Vault, GoAlert), а прикладной трафик разводится вне репозитория. В Brusnika схема смешанная: часть путей идёт напрямую в сервисы, остальное — одним правилом в `yet-another-nginx-service.global-ingress`.
|
- **Path-роутинг лежит в `infrastructure/istio-config/<c>/` у большинства контуров, но не у WB.** В `clusters/wb/infrastructure/patches/istio-config.yaml` через Istio публикуются только платформенные UI (Gitea, Grafana, OpenObserve, Superset, Vault, GoAlert), а прикладной трафик разводится вне репозитория. В Brusnika схема смешанная: часть путей идёт напрямую в сервисы, остальное — одним правилом в `yet-another-nginx-service.global-ingress`.
|
||||||
- **`vk-prod` маршрутизирует в namespace с суффиксом `-prod`** (`eav-prod`, `pm-prod`, `inspections-prod`), а приложений из `apps/` в этом кластере нет: сервисы раскатываются не этим репозиторием.
|
- **`vk-prod` маршрутизирует в namespace с суффиксом `-prod`** (`eav-prod`, `pm-prod`, `inspections-prod`), а приложений из `apps/` в этом кластере нет: сервисы раскатываются не этим репозиторием.
|
||||||
- **Имена namespace расходятся между источниками**: `inventory.yaml` и `vk-prod` используют суффикс (`flows-prod`), `apps/` — голое имя (`flows`).
|
- **Имена namespace расходятся между источниками**: `inventory.yaml` и `vk-prod` используют суффикс (`flows-prod`), `apps/` — голое имя (`flows`).
|
||||||
- **66 оверлеев приложений не подключены ни к одному кластеру**: 25 — `dsinv`, 25 — закомментированные в `asterus`, остальные 16 — мёртвый код (в основном `brusnika-prod`, плюс `bi`/`iam` в `wb` и `yc-k8s-test`).
|
- Некоторые оверлеи приложений не подключены к кластерам: например, `dsinv`, закомментированные приложения `asterus` и отдельные оверлеи других контуров. Наличие оверлея само по себе не означает развёртывание.
|
||||||
- **Нет диаграмм** в `docs/apps/` для `ams-sync`, `auth-flow`, `bi`, `iam`, `premises`.
|
- **Нет диаграмм** в `docs/apps/` для `ams-sync`, `auth-flow`, `bi`, `iam`, `premises`.
|
||||||
- **Чистые фронтенды без бэкенда в этом репозитории**: `auth-flow`, `control-interface`, `cross-section`, `document-link`, `prescriptions`, `projects`, `remarks`, `reviews`, `stamp-verification`. Бэкенд `projects` живёт в `planning/projects-backend`.
|
- **Чистые фронтенды без бэкенда в этом репозитории**: `auth-flow`, `control-interface`, `cross-section`, `document-link`, `prescriptions`, `projects`, `remarks`, `reviews`, `stamp-verification`. Бэкенд `projects` живёт в `planning/projects-backend`.
|
||||||
- Самые центральные сервисы по числу входящих ссылок: `documentations` (~85), `processing` / `workflow` (~76), `django` (~53), `eav` (~47), `resources` (~44), `bim` (~39), `flows` (~38). Менять их конфигурацию — дороже всего.
|
- Самые центральные сервисы по числу входящих ссылок: `documentations` (~85), `processing` / `workflow` (~76), `django` (~53), `eav` (~47), `resources` (~44), `bim` (~39), `flows` (~38). Менять их конфигурацию — дороже всего.
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
- Источники: GitLab-группа `infra` (209 проектов, включая подгруппы) + содержимое `infra/iac`.
|
- Источники: GitLab-группа `infra` (209 проектов, включая подгруппы) + содержимое `infra/iac`.
|
||||||
- Дата среза: **2026-08-05**.
|
- Дата среза: **2026-08-05**.
|
||||||
|
- Обновление 2026-11-25: контуры `sarex-contour` и `yc-k8s-test` выведены из эксплуатации, их конфигурации удалены. Упоминания ниже относятся к историческому срезу; `yc-k8s-test-02` сохранён.
|
||||||
- Все ссылки — на `https://gitlab.sarex.io`.
|
- Все ссылки — на `https://gitlab.sarex.io`.
|
||||||
|
|
||||||
Пометки достоверности:
|
Пометки достоверности:
|
||||||
|
|||||||
181
apps/ams-sync/nn-dev/helmrelease.yaml
Normal file
181
apps/ams-sync/nn-dev/helmrelease.yaml
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: ams-sync
|
||||||
|
namespace: ams-sync
|
||||||
|
spec:
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
version: 0.1.9
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
serviceAccount:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: ams-sync-vault
|
||||||
|
secretEnvs: []
|
||||||
|
volumes:
|
||||||
|
_default: []
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 4317,4318,9411,8200,9092
|
||||||
|
vault.hashicorp.com/agent-inject: 'true'
|
||||||
|
vault.hashicorp.com/agent-init-first: 'true'
|
||||||
|
vault.hashicorp.com/agent-pre-populate-only: 'true'
|
||||||
|
vault.hashicorp.com/agent-requests-cpu: 25m
|
||||||
|
vault.hashicorp.com/auth-path: auth/kubernetes
|
||||||
|
vault.hashicorp.com/role: ams-sync
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-kafka: secrets/data/kafka/apps/ams-sync
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/ams-sync" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}"]''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-zitadel: secrets/data/zitadel/setup
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-zitadel: '{{- with
|
||||||
|
secret "secrets/data/zitadel/setup" -}}
|
||||||
|
|
||||||
|
ZITADEL_SERVICE_ACCESS_TOKEN=''{{ index .Data.data "django_zitadel_access_token"
|
||||||
|
}}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-auth: secrets/data/vault/common/django_auth
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-auth: '{{- with secret
|
||||||
|
"secrets/data/vault/common/django_auth" -}}
|
||||||
|
|
||||||
|
AUTH_ADMIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
AUTH_ADMIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-db: secrets/data/apps/django/postgres
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-db: '{{- with secret
|
||||||
|
"secrets/data/apps/django/postgres" -}}
|
||||||
|
|
||||||
|
USER_DB_NAME=''{{ index .Data.data "database" }}''
|
||||||
|
|
||||||
|
USER_DB_USER=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
USER_DB_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
USER_DB_HOST=''{{ index .Data.data "host" }}''
|
||||||
|
|
||||||
|
USER_DB_PORT=''{{ index .Data.data "port" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
sidecar.istio.io/inject: 'true'
|
||||||
|
envs:
|
||||||
|
- name: AMS_SYNC_TOPIC
|
||||||
|
value:
|
||||||
|
_default: ams-sync
|
||||||
|
- name: ENVIRONMENT
|
||||||
|
value:
|
||||||
|
_default: PRODUCTION
|
||||||
|
- name: HOST_ORGANIZATION_ID
|
||||||
|
value:
|
||||||
|
_default: ${ZITADEL_ORG_ID}
|
||||||
|
- name: ALERT_ENABLED
|
||||||
|
value:
|
||||||
|
_default: 'False'
|
||||||
|
- name: VERIFY_USERS
|
||||||
|
value:
|
||||||
|
_default: 'True'
|
||||||
|
- name: USER_SERVER_HOST
|
||||||
|
value:
|
||||||
|
_default: https://${HOST_PLATFORM}
|
||||||
|
- name: AUTH_HOST
|
||||||
|
value:
|
||||||
|
_default: http://backend-svc.django.svc.cluster.local:80
|
||||||
|
- name: RESOURCES_INTERNAL_HOST
|
||||||
|
value:
|
||||||
|
_default: http://iam-backend.iam.svc.cluster.local:8000
|
||||||
|
- name: ZITADEL_HOST
|
||||||
|
value:
|
||||||
|
_default: https://${HOST_LOGIN}
|
||||||
|
- name: KAFKA_SECURITY_PROTOCOL
|
||||||
|
value:
|
||||||
|
_default: SASL_PLAINTEXT
|
||||||
|
- name: KAFKA_SASL_MECHANISM
|
||||||
|
value:
|
||||||
|
_default: SCRAM-SHA-512
|
||||||
|
- name: KAFKA_SSL_CAFILE
|
||||||
|
value:
|
||||||
|
_default: ''
|
||||||
|
- name: TELEGRAM_TOKEN
|
||||||
|
value:
|
||||||
|
_default: 000000:disabled
|
||||||
|
- name: TELEGRAM_GROUP_ID
|
||||||
|
value:
|
||||||
|
_default: '0'
|
||||||
|
- name: PYTHONUNBUFFERED
|
||||||
|
value:
|
||||||
|
_default: '1'
|
||||||
|
- name: HEALTHCHECK_PORT
|
||||||
|
value:
|
||||||
|
_default: '8008'
|
||||||
|
service:
|
||||||
|
enabled: false
|
||||||
|
deployment:
|
||||||
|
port:
|
||||||
|
_default: 8008
|
||||||
|
command:
|
||||||
|
_default:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-kafka
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-zitadel
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-auth
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-db
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec python3 cmd.py run
|
||||||
|
|
||||||
|
'
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
probes:
|
||||||
|
readiness:
|
||||||
|
enabled: true
|
||||||
|
type: &id001
|
||||||
|
_default: tcpSocket
|
||||||
|
tcpSocket: &id002
|
||||||
|
port:
|
||||||
|
_default: 8008
|
||||||
|
periodSeconds:
|
||||||
|
_default: 5
|
||||||
|
timeoutSeconds: &id003
|
||||||
|
_default: 2
|
||||||
|
liveness:
|
||||||
|
enabled: true
|
||||||
|
type: *id001
|
||||||
|
tcpSocket: *id002
|
||||||
|
periodSeconds:
|
||||||
|
_default: 30
|
||||||
|
timeoutSeconds: *id003
|
||||||
|
initialDelaySeconds:
|
||||||
|
_default: 30
|
||||||
36
apps/ams-sync/nn-dev/kustomization.yaml
Normal file
36
apps/ams-sync/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
configMapGenerator:
|
||||||
|
- name: ams-sync-contour-env
|
||||||
|
literals:
|
||||||
|
- USER_SERVER_HOST=https://${HOST_PLATFORM}
|
||||||
|
- AUTH_HOST=http://backend-svc.django.svc.cluster.local:80
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/local-config: "true"
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: ams-sync-contour-env
|
||||||
|
fieldPath: data.USER_SERVER_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: ams-sync
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.backend.envs.[name=USER_SERVER_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: ams-sync-contour-env
|
||||||
|
fieldPath: data.AUTH_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: ams-sync
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.backend.envs.[name=AUTH_HOST].value._default
|
||||||
|
patches:
|
||||||
|
- path: helmrelease.yaml
|
||||||
181
apps/ams-sync/stand/helmrelease.yaml
Normal file
181
apps/ams-sync/stand/helmrelease.yaml
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: ams-sync
|
||||||
|
namespace: ams-sync
|
||||||
|
spec:
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
version: 0.1.9
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
serviceAccount:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: ams-sync-vault
|
||||||
|
secretEnvs: []
|
||||||
|
volumes:
|
||||||
|
_default: []
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 4317,4318,9411,8200,9092
|
||||||
|
vault.hashicorp.com/agent-inject: 'true'
|
||||||
|
vault.hashicorp.com/agent-init-first: 'true'
|
||||||
|
vault.hashicorp.com/agent-pre-populate-only: 'true'
|
||||||
|
vault.hashicorp.com/agent-requests-cpu: 25m
|
||||||
|
vault.hashicorp.com/auth-path: auth/kubernetes
|
||||||
|
vault.hashicorp.com/role: ams-sync
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-kafka: secrets/data/kafka/apps/ams-sync
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/ams-sync" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}"]''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-zitadel: secrets/data/zitadel/setup
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-zitadel: '{{- with
|
||||||
|
secret "secrets/data/zitadel/setup" -}}
|
||||||
|
|
||||||
|
ZITADEL_SERVICE_ACCESS_TOKEN=''{{ index .Data.data "django_zitadel_access_token"
|
||||||
|
}}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-auth: secrets/data/vault/common/django_auth
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-auth: '{{- with secret
|
||||||
|
"secrets/data/vault/common/django_auth" -}}
|
||||||
|
|
||||||
|
AUTH_ADMIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
AUTH_ADMIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-ams-sync-db: secrets/data/apps/django/postgres
|
||||||
|
vault.hashicorp.com/agent-inject-template-ams-sync-db: '{{- with secret
|
||||||
|
"secrets/data/apps/django/postgres" -}}
|
||||||
|
|
||||||
|
USER_DB_NAME=''{{ index .Data.data "database" }}''
|
||||||
|
|
||||||
|
USER_DB_USER=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
USER_DB_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
USER_DB_HOST=''{{ index .Data.data "host" }}''
|
||||||
|
|
||||||
|
USER_DB_PORT=''{{ index .Data.data "port" }}''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
sidecar.istio.io/inject: 'true'
|
||||||
|
envs:
|
||||||
|
- name: AMS_SYNC_TOPIC
|
||||||
|
value:
|
||||||
|
_default: ams-sync
|
||||||
|
- name: ENVIRONMENT
|
||||||
|
value:
|
||||||
|
_default: PRODUCTION
|
||||||
|
- name: HOST_ORGANIZATION_ID
|
||||||
|
value:
|
||||||
|
_default: '397401610885551249'
|
||||||
|
- name: ALERT_ENABLED
|
||||||
|
value:
|
||||||
|
_default: 'False'
|
||||||
|
- name: VERIFY_USERS
|
||||||
|
value:
|
||||||
|
_default: 'True'
|
||||||
|
- name: USER_SERVER_HOST
|
||||||
|
value:
|
||||||
|
_default: https://sarex.${CONTOUR_DOMAIN}
|
||||||
|
- name: AUTH_HOST
|
||||||
|
value:
|
||||||
|
_default: http://backend-svc.django.svc.cluster.local:80
|
||||||
|
- name: RESOURCES_INTERNAL_HOST
|
||||||
|
value:
|
||||||
|
_default: http://iam-backend.iam.svc.cluster.local:8000
|
||||||
|
- name: ZITADEL_HOST
|
||||||
|
value:
|
||||||
|
_default: https://${HOST_LOGIN}
|
||||||
|
- name: KAFKA_SECURITY_PROTOCOL
|
||||||
|
value:
|
||||||
|
_default: SASL_PLAINTEXT
|
||||||
|
- name: KAFKA_SASL_MECHANISM
|
||||||
|
value:
|
||||||
|
_default: SCRAM-SHA-512
|
||||||
|
- name: KAFKA_SSL_CAFILE
|
||||||
|
value:
|
||||||
|
_default: ''
|
||||||
|
- name: TELEGRAM_TOKEN
|
||||||
|
value:
|
||||||
|
_default: 000000:disabled
|
||||||
|
- name: TELEGRAM_GROUP_ID
|
||||||
|
value:
|
||||||
|
_default: '0'
|
||||||
|
- name: PYTHONUNBUFFERED
|
||||||
|
value:
|
||||||
|
_default: '1'
|
||||||
|
- name: HEALTHCHECK_PORT
|
||||||
|
value:
|
||||||
|
_default: '8008'
|
||||||
|
service:
|
||||||
|
enabled: false
|
||||||
|
deployment:
|
||||||
|
port:
|
||||||
|
_default: 8008
|
||||||
|
command:
|
||||||
|
_default:
|
||||||
|
- /bin/sh
|
||||||
|
- -ec
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-kafka
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-zitadel
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-auth
|
||||||
|
|
||||||
|
. /vault/secrets/ams-sync-db
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec python3 cmd.py run
|
||||||
|
|
||||||
|
'
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
probes:
|
||||||
|
readiness:
|
||||||
|
enabled: true
|
||||||
|
type: &id001
|
||||||
|
_default: tcpSocket
|
||||||
|
tcpSocket: &id002
|
||||||
|
port:
|
||||||
|
_default: 8008
|
||||||
|
periodSeconds:
|
||||||
|
_default: 5
|
||||||
|
timeoutSeconds: &id003
|
||||||
|
_default: 2
|
||||||
|
liveness:
|
||||||
|
enabled: true
|
||||||
|
type: *id001
|
||||||
|
tcpSocket: *id002
|
||||||
|
periodSeconds:
|
||||||
|
_default: 30
|
||||||
|
timeoutSeconds: *id003
|
||||||
|
initialDelaySeconds:
|
||||||
|
_default: 30
|
||||||
@ -6,7 +6,7 @@ configMapGenerator:
|
|||||||
- name: ams-sync-contour-env
|
- name: ams-sync-contour-env
|
||||||
literals:
|
literals:
|
||||||
- USER_SERVER_HOST=https://sarex.${CONTOUR_DOMAIN}
|
- USER_SERVER_HOST=https://sarex.${CONTOUR_DOMAIN}
|
||||||
- AUTH_HOST=https://sarex.${CONTOUR_DOMAIN}
|
- AUTH_HOST=http://backend-svc.django.svc.cluster.local:80
|
||||||
options:
|
options:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
annotations:
|
annotations:
|
||||||
@ -32,3 +32,5 @@ replacements:
|
|||||||
name: ams-sync
|
name: ams-sync
|
||||||
fieldPaths:
|
fieldPaths:
|
||||||
- spec.values.services.backend.envs.[name=AUTH_HOST].value._default
|
- spec.values.services.backend.envs.[name=AUTH_HOST].value._default
|
||||||
|
patches:
|
||||||
|
- path: helmrelease.yaml
|
||||||
|
|||||||
@ -30,12 +30,22 @@ spec:
|
|||||||
env: _default
|
env: _default
|
||||||
|
|
||||||
services:
|
services:
|
||||||
backend:
|
attachments:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
tolerations:
|
||||||
|
- key:
|
||||||
|
_default: dedicated
|
||||||
|
operator:
|
||||||
|
_default: Equal
|
||||||
|
value:
|
||||||
|
_default: processing-light
|
||||||
|
effect:
|
||||||
|
_default: NoSchedule
|
||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/att9:dev
|
_default: cr.yandex/crp3ccidau046kdj8g9q/attachments:production_6dbb4dce
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
@ -54,11 +64,30 @@ spec:
|
|||||||
port:
|
port:
|
||||||
_default: 8000
|
_default: 8000
|
||||||
|
|
||||||
|
command:
|
||||||
|
_default: ["/bin/bash", "/opt/attachments/entrypoint.sh"]
|
||||||
|
|
||||||
probes:
|
probes:
|
||||||
liveness:
|
liveness:
|
||||||
enabled: false
|
enabled: false
|
||||||
readiness:
|
readiness:
|
||||||
enabled: false
|
enabled: true
|
||||||
|
httpGet:
|
||||||
|
path:
|
||||||
|
_default: /openapi.json
|
||||||
|
port:
|
||||||
|
_default: 8000
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- name: yc-s3
|
||||||
|
mountPath:
|
||||||
|
_default: /etc/sarex/yc-s3-storage
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
secret:
|
||||||
|
secretName:
|
||||||
|
_default: yc-s3
|
||||||
|
|
||||||
service:
|
service:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
23
apps/attachments/nn-dev/helmrelease.yaml
Normal file
23
apps/attachments/nn-dev/helmrelease.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: attachments
|
||||||
|
namespace: attachments
|
||||||
|
annotations:
|
||||||
|
kustomize.toolkit.fluxcd.io/substitute: disabled
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
attachments:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-template-attachments-s3: |-
|
||||||
|
{{- with secret "secrets/data/minio/apps/attachments" -}}
|
||||||
|
YANDEX_S3_ENDPOINT_URL=minio.storage.svc.cluster.local:9000
|
||||||
|
YANDEX_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
|
||||||
|
YANDEX_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
|
||||||
|
YANDEX_S3_USE_SSL=false
|
||||||
|
YANDEX_S3_REGION=ru-central
|
||||||
|
YANDEX_S3_VERIFY=false
|
||||||
|
BUCKET_NAME=attachments
|
||||||
|
{{- end -}}
|
||||||
@ -3,4 +3,4 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
patches:
|
patches:
|
||||||
- path: glitchtip.yaml
|
- path: helmrelease.yaml
|
||||||
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
- postgresql.yaml
|
|
||||||
patches: []
|
|
||||||
# - path: replicas.yaml
|
|
||||||
# target:
|
|
||||||
# kind: HelmRelease
|
|
||||||
# name: attachments
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: attachments
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: attachments_db
|
|
||||||
user: attachments
|
|
||||||
passwordKey: attachments
|
|
||||||
extensions: []
|
|
||||||
restoreFromDump: true
|
|
||||||
dumpKey: "sanitized_dumps_multi/attachments/288/attachments_company288_20260626T202844Z.tar.gz"
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: attachments
|
|
||||||
namespace: attachments
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
attachments:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 2
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
patches: []
|
|
||||||
# - path: replicas.yaml
|
|
||||||
# target:
|
|
||||||
# kind: HelmRelease
|
|
||||||
# name: frontend
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: frontend
|
|
||||||
namespace: auth-flow
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
frontend:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 1
|
|
||||||
78
apps/bi/nn-dev/kustomization.yaml
Normal file
78
apps/bi/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
configMapGenerator:
|
||||||
|
- name: bi-contour-env
|
||||||
|
literals:
|
||||||
|
- AUTH_HOST=http://backend-svc.django.svc.cluster.local
|
||||||
|
- ISSUES_SERVICE_HOST=http://backend-svc.issues.svc.cluster.local
|
||||||
|
- EAV_SERVICE_HOST=http://backend-svc.eav.svc.cluster.local
|
||||||
|
- PM_SERVICE_HOST=http://backend-svc.pm.svc.cluster.local:8000
|
||||||
|
- SUPERSET_DOCUMENTATION_URL=https://${HOST_PLATFORM}/documentations/
|
||||||
|
- 'KAFKA_BOOTSTRAP_SERVERS=["kafka-kafka-contour.kafka.svc.cluster.local:9092"]'
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/local-config: "true"
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.AUTH_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=AUTH_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.ISSUES_SERVICE_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=ISSUES_SERVICE_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.EAV_SERVICE_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=EAV_SERVICE_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.PM_SERVICE_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=PM_SERVICE_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.SUPERSET_DOCUMENTATION_URL
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=SUPERSET_DOCUMENTATION_URL].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bi-contour-env
|
||||||
|
fieldPath: data.KAFKA_BOOTSTRAP_SERVERS
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: bi-backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.main.envs.[name=KAFKA_BOOTSTRAP_SERVERS].value._default
|
||||||
@ -154,7 +154,7 @@ Slave-2 кластер — те же поля с суффиксом `_3`:
|
|||||||
- `base/backend-deployment.yaml` — Deployment `backend` в namespace `bim`, образ `bim-api`, `containerPort: 8000`, `API_ADDRESS=0.0.0.0:8000`, health-проба `GET /ping`.
|
- `base/backend-deployment.yaml` — Deployment `backend` в namespace `bim`, образ `bim-api`, `containerPort: 8000`, `API_ADDRESS=0.0.0.0:8000`, health-проба `GET /ping`.
|
||||||
- Секреты PostgreSQL инъектируются **из Vault** (аннотации `vault.hashicorp.com/*`, роль `bim`, путь `secrets/data/postgresql/apps/bim`) в файл `/vault/secrets/bim-postgresql`, который экспортируется в окружение перед запуском (`set -a; . /vault/secrets/bim-postgresql; set +a; exec ./httpserver`). Шаблон Vault задаёт `POSTGRES_ADDRESS[_2../_4]`, `POSTGRES_PORT*`, `POSTGRES_DB*` (все указывают на `postgresql.bim.svc.cluster.local:5432`, БД `bim_db`) и `POSTGRES_USER*`/`POSTGRES_PASSWORD*` из Vault.
|
- Секреты PostgreSQL инъектируются **из Vault** (аннотации `vault.hashicorp.com/*`, роль `bim`, путь `secrets/data/postgresql/apps/bim`) в файл `/vault/secrets/bim-postgresql`, который экспортируется в окружение перед запуском (`set -a; . /vault/secrets/bim-postgresql; set +a; exec ./httpserver`). Шаблон Vault задаёт `POSTGRES_ADDRESS[_2../_4]`, `POSTGRES_PORT*`, `POSTGRES_DB*` (все указывают на `postgresql.bim.svc.cluster.local:5432`, БД `bim_db`) и `POSTGRES_USER*`/`POSTGRES_PASSWORD*` из Vault.
|
||||||
- Прочие env заданы прямо в манифесте: `LAST_MASTER_BIM`, `LAST_MASTER_BIM_V3`, `LAST_SLAVE_1_BIM`, `POSTGRES_POOL_SIZE`, `DB_CERT_PATH_2/3/4`, `DJANGO_HOST` (`http://backend.django.svc.cluster.local:8000`), `ENABLE_SQL_QUERY=0`, `ENABLE_SSL=0`.
|
- Прочие env заданы прямо в манифесте: `LAST_MASTER_BIM`, `LAST_MASTER_BIM_V3`, `LAST_SLAVE_1_BIM`, `POSTGRES_POOL_SIZE`, `DB_CERT_PATH_2/3/4`, `DJANGO_HOST` (`http://backend.django.svc.cluster.local:8000`), `ENABLE_SQL_QUERY=0`, `ENABLE_SSL=0`.
|
||||||
- Оверлеи `brusnika-prod`, `brusnika-stage`, `yc-k8s-test` патчат base (реплики, образ, postgresql).
|
- Оверлеи `brusnika-prod`, `brusnika-stage` патчат base (реплики, образ, postgresql).
|
||||||
|
|
||||||
## Переменные в CI (`.gitlab-ci.yml`)
|
## Переменные в CI (`.gitlab-ci.yml`)
|
||||||
|
|
||||||
|
|||||||
23
apps/bim/nn-dev/kustomization.yaml
Normal file
23
apps/bim/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
configMapGenerator:
|
||||||
|
- name: bim-contour-env
|
||||||
|
literals:
|
||||||
|
- POSTGRES_POOL_SIZE=5
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/local-config: "true"
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bim-contour-env
|
||||||
|
fieldPath: data.POSTGRES_POOL_SIZE
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.backend.envs.[name=POSTGRES_POOL_SIZE].value._default
|
||||||
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
- postgresql.yaml
|
|
||||||
patches:
|
|
||||||
- path: replicas.yaml
|
|
||||||
target:
|
|
||||||
kind: HelmRelease
|
|
||||||
name: backend
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: bim
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
strategy: uninstall
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: bim_db
|
|
||||||
user: bim
|
|
||||||
passwordKey: bim
|
|
||||||
extensions:
|
|
||||||
- ltree
|
|
||||||
- timescaledb
|
|
||||||
- uuid-ossp
|
|
||||||
- pg_partman
|
|
||||||
restoreFromDump: false
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
namespace: bim
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
backend:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 1
|
|
||||||
@ -202,7 +202,7 @@
|
|||||||
|
|
||||||
В `iac/apps/cde` секреты доставляются не через `secretEnvs` чарта, а через **Vault Agent Injector**: аннотации подов монтируют секрет `secrets/data/vault/apps/cde` в файл `/vault/secrets/cde-env`, который экспортируется перед запуском (`source /vault/secrets/cde-env`, затем `exec /http` или `/worker`). Дополнительно контейнерам задаётся `S3_IS_CONTOUR=true` (примечание: в коде используется переменная `IS_CONTOUR`).
|
В `iac/apps/cde` секреты доставляются не через `secretEnvs` чарта, а через **Vault Agent Injector**: аннотации подов монтируют секрет `secrets/data/vault/apps/cde` в файл `/vault/secrets/cde-env`, который экспортируется перед запуском (`source /vault/secrets/cde-env`, затем `exec /http` или `/worker`). Дополнительно контейнерам задаётся `S3_IS_CONTOUR=true` (примечание: в коде используется переменная `IS_CONTOUR`).
|
||||||
|
|
||||||
Оверлеи: `base` (общие манифесты), `brusnika-stage`, `brusnika-prod`, `yc-k8s-test`.
|
Оверлеи: `base` (общие манифесты), `brusnika-stage`, `brusnika-prod`.
|
||||||
|
|
||||||
## Замечания и потенциальные проблемы
|
## Замечания и потенциальные проблемы
|
||||||
|
|
||||||
|
|||||||
139
apps/cde/nn-dev/kustomization.yaml
Normal file
139
apps/cde/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
- serviceaccount.yaml
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde/deployment/resources
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-flowscallback
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-flowscallback/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-flowscallback/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-splitpdf
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-splitpdf/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-splitpdf/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-alert
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-alert/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-alert/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-copy
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-copy/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-copy/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-copyv2
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-copyv2/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-copyv2/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-create-versions
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-create-versions/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-create-versions/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-create-versionsv2
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-create-versionsv2/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-create-versionsv2/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-markings
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-markings/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-markings/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-markingsv2
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-markingsv2/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-markingsv2/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-sign
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-sign/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-sign/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-signv2
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-signv2/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-signv2/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-worker-update-bundles
|
||||||
|
patch: |
|
||||||
|
- op: remove
|
||||||
|
path: /spec/values/services/cde-worker-update-bundles/deployment/resources
|
||||||
|
- op: replace
|
||||||
|
path: /spec/values/services/cde-worker-update-bundles/serviceAccount/enabled/_default
|
||||||
|
value: false
|
||||||
|
configMapGenerator:
|
||||||
|
- name: cde-contour-env
|
||||||
|
literals:
|
||||||
|
- SAREX_BACKEND_BASE_URL=http://backend-svc.django.svc.cluster.local:80
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/local-config: "true"
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: cde-contour-env
|
||||||
|
fieldPath: data.SAREX_BACKEND_BASE_URL
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.cde.envs.[name=SAREX_BACKEND_BASE_URL].value._default
|
||||||
5
apps/cde/nn-dev/serviceaccount.yaml
Normal file
5
apps/cde/nn-dev/serviceaccount.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: cde-vault
|
||||||
|
namespace: cde
|
||||||
@ -55,3 +55,20 @@ patches:
|
|||||||
target:
|
target:
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
name: cde
|
name: cde
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: cde-(worker-.*|flowscallback|splitpdf)
|
||||||
|
patch: |-
|
||||||
|
- op: add
|
||||||
|
path: /spec/postRenderers
|
||||||
|
value:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment|StatefulSet
|
||||||
|
patch: |-
|
||||||
|
- op: add
|
||||||
|
path: /spec/replicas
|
||||||
|
value: 0
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
patches: []
|
|
||||||
# - path: replicas.yaml
|
|
||||||
# target:
|
|
||||||
# kind: Deployment
|
|
||||||
# name: frontend
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
namespace: cde
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
33
apps/checklists/nn-dev/jwt-access.yaml
Normal file
33
apps/checklists/nn-dev/jwt-access.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: checklists
|
||||||
|
namespace: checklists
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
checklists:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-checklists-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-checklists-jwt-public: '{{-
|
||||||
|
with secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/checklists-db ] && . /vault/secrets/checklists-db
|
||||||
|
|
||||||
|
[ -f /vault/secrets/checklists-jwt-public ] && export JWT_AUTH_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/checklists-jwt-public)"
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec ./entrypoint.sh
|
||||||
|
|
||||||
|
'
|
||||||
@ -3,4 +3,4 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
patches:
|
patches:
|
||||||
- path: camunda.yaml
|
- path: jwt-access.yaml
|
||||||
33
apps/checklists/stand/jwt-access.yaml
Normal file
33
apps/checklists/stand/jwt-access.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: checklists
|
||||||
|
namespace: checklists
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
checklists:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-checklists-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-checklists-jwt-public: '{{-
|
||||||
|
with secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/checklists-db ] && . /vault/secrets/checklists-db
|
||||||
|
|
||||||
|
[ -f /vault/secrets/checklists-jwt-public ] && export JWT_AUTH_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/checklists-jwt-public)"
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec ./entrypoint.sh
|
||||||
|
|
||||||
|
'
|
||||||
@ -2,3 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
|
patches:
|
||||||
|
- path: jwt-access.yaml
|
||||||
|
|||||||
@ -1,124 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: checklists
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: checklists_db
|
|
||||||
user: checklists
|
|
||||||
passwordKey: checklists
|
|
||||||
extensions:
|
|
||||||
- pg_stat_statements
|
|
||||||
- uuid-ossp
|
|
||||||
restoreFromDump: true
|
|
||||||
dumpKey: "sanitized_dumps_multi/checklists/288/checklists_company288_20260626T202844Z.tar.gz"
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
## Развёртывание через Kustomize (этот репозиторий, `apps/comparisons`)
|
## Развёртывание через Kustomize (этот репозиторий, `apps/comparisons`)
|
||||||
|
|
||||||
Структура: `base` (общие манифесты) и оверлеи `brusnika-stage`, `brusnika-prod`, `yc-k8s-test`. Секреты БД и публичный JWT-ключ подтягиваются из **HashiCorp Vault** (аннотации `vault.hashicorp.com/*` в `base/backend-deployment.yaml`), а не из k8s-секретов.
|
Структура: `base` (общие манифесты) и оверлеи `brusnika-stage`, `brusnika-prod`. Секреты БД и публичный JWT-ключ подтягиваются из **HashiCorp Vault** (аннотации `vault.hashicorp.com/*` в `base/backend-deployment.yaml`), а не из k8s-секретов.
|
||||||
|
|
||||||
> **Важно: расхождение схем переменных.** Манифест `base/backend-deployment.yaml` использует другой (более новый) набор имён переменных, чем Go-код из `comparisons-backend` (`config/config.go`): напр. `HTTP_PORT`, `LOGGER_LOG_LEVEL`, `DATABASE_NAME`, `DOCUMENTATIONS_INTERNAL_HOST`, `DOCUMENTATIONS_EXTERNAL_HOST`, `WORKFLOWS_HOST`, `WORKFLOWS_DJANGO_HOST`, `WORKFLOWS_BIMV2_INTERNAL_HOST`, `WORKSPACES_HOST`, `EAV_HOST`, `APP_NAME`, `AUTH_PUBLIC_KEY`, `WORKFLOWS_CONFIG_FILEPATH` и др., а также `/ping` в health-проверках и образ `comparisons_backend_prod`. Такой схемы нет в Go-репозитории. Перед использованием этих файлов стоит убедиться, какой именно образ бэкенда деплоится оверлеем: если это Go-сервис из `comparisons-backend`, набор env нужно привести к именам из таблиц выше.
|
> **Важно: расхождение схем переменных.** Манифест `base/backend-deployment.yaml` использует другой (более новый) набор имён переменных, чем Go-код из `comparisons-backend` (`config/config.go`): напр. `HTTP_PORT`, `LOGGER_LOG_LEVEL`, `DATABASE_NAME`, `DOCUMENTATIONS_INTERNAL_HOST`, `DOCUMENTATIONS_EXTERNAL_HOST`, `WORKFLOWS_HOST`, `WORKFLOWS_DJANGO_HOST`, `WORKFLOWS_BIMV2_INTERNAL_HOST`, `WORKSPACES_HOST`, `EAV_HOST`, `APP_NAME`, `AUTH_PUBLIC_KEY`, `WORKFLOWS_CONFIG_FILEPATH` и др., а также `/ping` в health-проверках и образ `comparisons_backend_prod`. Такой схемы нет в Go-репозитории. Перед использованием этих файлов стоит убедиться, какой именно образ бэкенда деплоится оверлеем: если это Go-сервис из `comparisons-backend`, набор env нужно привести к именам из таблиц выше.
|
||||||
|
|
||||||
|
|||||||
@ -1,122 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: comparisons
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: comparisons_db
|
|
||||||
user: comparisons
|
|
||||||
passwordKey: comparisons
|
|
||||||
extensions: []
|
|
||||||
restoreFromDump: true
|
|
||||||
dumpKey: "sanitized_dumps_multi/comparisons/288/comparisons_company288_20260626T202844Z.tar.gz"
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
namespace: comparisons
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
backend:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 1
|
|
||||||
39
apps/contracts/nn-dev/jwt-access.yaml
Normal file
39
apps/contracts/nn-dev/jwt-access.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: contracts
|
||||||
|
namespace: contracts
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
contracts:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-contracts-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-contracts-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-db ] && . /vault/secrets/contracts-db
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-jwt-public ] && export PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/contracts-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-rabbitmq ] && . /vault/secrets/contracts-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-s3 ] && . /vault/secrets/contracts-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-kafka ] && . /vault/secrets/contracts-kafka
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec /usr/local/bin/http
|
||||||
|
|
||||||
|
'
|
||||||
@ -3,4 +3,4 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
patches:
|
patches:
|
||||||
- path: dashboard.yaml
|
- path: jwt-access.yaml
|
||||||
39
apps/contracts/stand/jwt-access.yaml
Normal file
39
apps/contracts/stand/jwt-access.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: contracts
|
||||||
|
namespace: contracts
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
contracts:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-contracts-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-contracts-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-db ] && . /vault/secrets/contracts-db
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-jwt-public ] && export PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/contracts-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-rabbitmq ] && . /vault/secrets/contracts-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-s3 ] && . /vault/secrets/contracts-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/contracts-kafka ] && . /vault/secrets/contracts-kafka
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec /usr/local/bin/http
|
||||||
|
|
||||||
|
'
|
||||||
@ -2,3 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
|
patches:
|
||||||
|
- path: jwt-access.yaml
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
- postgresql.yaml
|
|
||||||
patches: []
|
|
||||||
# - path: replicas.yaml
|
|
||||||
# target:
|
|
||||||
# kind: Deployment
|
|
||||||
# name: backend
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: contracts
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: contracts_db
|
|
||||||
user: contracts
|
|
||||||
passwordKey: contracts
|
|
||||||
extensions:
|
|
||||||
- btree_gist
|
|
||||||
- ltree
|
|
||||||
- pg_stat_statements
|
|
||||||
- uuid-ossp
|
|
||||||
restoreFromDump: true
|
|
||||||
dumpKey: "sanitized_dumps_multi/contracts/288/contracts_company288_20260626T202844Z.tar.gz"
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
94
apps/control-interface/brusnika-stage/admin-frontend.yaml
Normal file
94
apps/control-interface/brusnika-stage/admin-frontend.yaml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: admin-frontend
|
||||||
|
namespace: django
|
||||||
|
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: "0.1.7"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
|
||||||
|
services:
|
||||||
|
admin-frontend:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/admin-frontend:uralkal_4d0a3684
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend
|
||||||
|
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 100m
|
||||||
|
memory:
|
||||||
|
_default: 100Mi
|
||||||
|
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend-svc
|
||||||
|
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 8080
|
||||||
|
|
||||||
|
targetPort:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
|
||||||
|
commitSha: ""
|
||||||
|
gitlabUri: ""
|
||||||
|
gitlabJobUrl: ""
|
||||||
|
owner: ""
|
||||||
@ -35,7 +35,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/srx-admin:prod_feb59026
|
_default: cr.yandex/crp3ccidau046kdj8g9q/srx-admin:prod_6526c293
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -4,3 +4,4 @@ kind: Kustomization
|
|||||||
namespace: django
|
namespace: django
|
||||||
resources:
|
resources:
|
||||||
- helmrelease.yaml
|
- helmrelease.yaml
|
||||||
|
- admin-frontend.yaml
|
||||||
|
|||||||
79
apps/control-interface/nn-dev/admin-frontend.yaml
Normal file
79
apps/control-interface/nn-dev/admin-frontend.yaml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: admin-frontend
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: 0.1.9
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
services:
|
||||||
|
admin-frontend:
|
||||||
|
enabled: true
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/admin-frontend:uralkal_4d0a3684
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: admin-frontend
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
port:
|
||||||
|
_default: 80
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: admin-frontend-svc
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
port:
|
||||||
|
_default: 8080
|
||||||
|
targetPort:
|
||||||
|
_default: 80
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
commitSha: ''
|
||||||
|
gitlabUri: ''
|
||||||
|
gitlabJobUrl: ''
|
||||||
|
owner: ''
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
5
apps/control-interface/nn-dev/kustomization.yaml
Normal file
5
apps/control-interface/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
- admin-frontend.yaml
|
||||||
79
apps/control-interface/stand/admin-frontend.yaml
Normal file
79
apps/control-interface/stand/admin-frontend.yaml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: admin-frontend
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: 0.1.9
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
services:
|
||||||
|
admin-frontend:
|
||||||
|
enabled: true
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/admin-frontend:uralkal_4d0a3684
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: admin-frontend
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
port:
|
||||||
|
_default: 80
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: admin-frontend-svc
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
port:
|
||||||
|
_default: 8080
|
||||||
|
targetPort:
|
||||||
|
_default: 80
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
commitSha: ''
|
||||||
|
gitlabUri: ''
|
||||||
|
gitlabJobUrl: ''
|
||||||
|
owner: ''
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
|
- admin-frontend.yaml
|
||||||
|
|||||||
94
apps/control-interface/uralkal/admin-frontend.yaml
Normal file
94
apps/control-interface/uralkal/admin-frontend.yaml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: admin-frontend
|
||||||
|
namespace: control-interface
|
||||||
|
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: "0.1.7"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
|
||||||
|
services:
|
||||||
|
admin-frontend:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/admin-frontend:uralkal_4d0a3684
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend
|
||||||
|
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 100m
|
||||||
|
memory:
|
||||||
|
_default: 100Mi
|
||||||
|
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend-svc
|
||||||
|
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 8080
|
||||||
|
|
||||||
|
targetPort:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
|
||||||
|
commitSha: ""
|
||||||
|
gitlabUri: ""
|
||||||
|
gitlabJobUrl: ""
|
||||||
|
owner: ""
|
||||||
@ -3,5 +3,6 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
|
- admin-frontend.yaml
|
||||||
- psql-tools-debug.yaml
|
- psql-tools-debug.yaml
|
||||||
- ams-sync.yaml
|
- ams-sync.yaml
|
||||||
|
|||||||
94
apps/control-interface/wb/admin-frontend.yaml
Normal file
94
apps/control-interface/wb/admin-frontend.yaml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: admin-frontend
|
||||||
|
namespace: control-interface
|
||||||
|
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: "0.1.7"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
|
||||||
|
services:
|
||||||
|
admin-frontend:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/admin-frontend:uralkal_4d0a3684
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend
|
||||||
|
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 100m
|
||||||
|
memory:
|
||||||
|
_default: 100Mi
|
||||||
|
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
name:
|
||||||
|
_default: admin-frontend-svc
|
||||||
|
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
|
||||||
|
port:
|
||||||
|
_default: 8080
|
||||||
|
|
||||||
|
targetPort:
|
||||||
|
_default: 80
|
||||||
|
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: dockerhub
|
||||||
|
|
||||||
|
commitSha: ""
|
||||||
|
gitlabUri: ""
|
||||||
|
gitlabJobUrl: ""
|
||||||
|
owner: ""
|
||||||
@ -1,7 +1,6 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: control-interface
|
namespace: control-interface
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
|
- admin-frontend.yaml
|
||||||
@ -2,5 +2,3 @@ apiVersion: v1
|
|||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: control-interface
|
name: control-interface
|
||||||
labels:
|
|
||||||
istio-injection: enabled
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namespace: django
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
patches:
|
|
||||||
- path: replicas.yaml
|
|
||||||
target:
|
|
||||||
kind: HelmRelease
|
|
||||||
name: srx-admin
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: srx-admin
|
|
||||||
namespace: django
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
frontend:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 1
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
patches:
|
|
||||||
- path: replicas.yaml
|
|
||||||
target:
|
|
||||||
kind: HelmRelease
|
|
||||||
name: cross-section-static
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: cross-section-static
|
|
||||||
namespace: cross-section
|
|
||||||
spec:
|
|
||||||
values:
|
|
||||||
services:
|
|
||||||
frontend:
|
|
||||||
deployment:
|
|
||||||
replicaCount:
|
|
||||||
_default: 1
|
|
||||||
@ -288,7 +288,7 @@ Module Federation) конфигурируется отдельно на этап
|
|||||||
## Конфигурация в кластере (Kubernetes)
|
## Конфигурация в кластере (Kubernetes)
|
||||||
|
|
||||||
Манифесты приложения — в этом же каталоге (`base/`, оверлеи `brusnika-stage`,
|
Манифесты приложения — в этом же каталоге (`base/`, оверлеи `brusnika-stage`,
|
||||||
`brusnika-prod`, `yc-k8s-test`). Секреты монтируются через **Vault Agent Injector**
|
`brusnika-prod`). Секреты монтируются через **Vault Agent Injector**
|
||||||
(аннотации `vault.hashicorp.com/*` на Deployment `backend` и `celery`). Файлы
|
(аннотации `vault.hashicorp.com/*` на Deployment `backend` и `celery`). Файлы
|
||||||
секретов в контейнере и их содержимое:
|
секретов в контейнере и их содержимое:
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_7d0ec48b
|
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_18e5ac1e
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_7d0ec48b
|
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_18e5ac1e
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:contour_5.22.3
|
_default: cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:contour_5.37.0
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
60
apps/django/nn-dev/backend.yaml
Normal file
60
apps/django/nn-dev/backend.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-s3: '{{- with secret
|
||||||
|
"secrets/data/minio/apps/django" }}
|
||||||
|
|
||||||
|
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
|
S3_HOST=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
|
S3_BUCKET={{ index .Data.data "bucket" }}
|
||||||
|
|
||||||
|
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
|
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
||||||
|
|
||||||
|
AWS_S3_ACCESS_KEY_ID={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
|
AWS_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_access_key" }}
|
||||||
|
|
||||||
|
AWS_STORAGE_BUCKET_NAME={{ index .Data.data "bucket" }}
|
||||||
|
|
||||||
|
{{- end }}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-common: '{{- with secret
|
||||||
|
"secrets/data/zitadel/setup" -}}
|
||||||
|
|
||||||
|
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token"
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-kafka: secrets/data/kafka/apps/iam
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/iam" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ with index .Data.data "auth" }}{{ index
|
||||||
|
. "bootstrap_servers" }}{{ else }}{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}{{ end }}"]''
|
||||||
|
|
||||||
|
KAFKA_SECURITY_PROTOCOL=''SASL_PLAINTEXT''
|
||||||
|
|
||||||
|
KAFKA_SASL_MECHANISM=''SCRAM-SHA-512''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
KAFKA_SSL_CAFILE=''''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 8200,9092
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
54
apps/django/nn-dev/celery.yaml
Normal file
54
apps/django/nn-dev/celery.yaml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: celery
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
celery:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-s3: '{{- with secret
|
||||||
|
"secrets/data/minio/apps/django" }}
|
||||||
|
|
||||||
|
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
|
S3_HOST=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
|
S3_BUCKET={{ index .Data.data "bucket" }}
|
||||||
|
|
||||||
|
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
|
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
||||||
|
|
||||||
|
{{- end }}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-common: '{{- with secret
|
||||||
|
"secrets/data/zitadel/setup" -}}
|
||||||
|
|
||||||
|
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token"
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-kafka: secrets/data/kafka/apps/iam
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/iam" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ with index .Data.data "auth" }}{{ index
|
||||||
|
. "bootstrap_servers" }}{{ else }}{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}{{ end }}"]''
|
||||||
|
|
||||||
|
KAFKA_SECURITY_PROTOCOL=''SASL_PLAINTEXT''
|
||||||
|
|
||||||
|
KAFKA_SASL_MECHANISM=''SCRAM-SHA-512''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
KAFKA_SSL_CAFILE=''''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 8200,9092
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
88
apps/django/nn-dev/export-project.yaml
Normal file
88
apps/django/nn-dev/export-project.yaml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: export-project
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: 0.1.9
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
enabled: true
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/export-project:prod_ef8aa756
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: export-project
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
stage: 1
|
||||||
|
preprod: 3
|
||||||
|
production: 3
|
||||||
|
port:
|
||||||
|
_default: 8000
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: export-project-service
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
port:
|
||||||
|
_default: 8000
|
||||||
|
targetPort:
|
||||||
|
_default: 8000
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
labels:
|
||||||
|
monitoring: prometheus
|
||||||
|
envs:
|
||||||
|
- name: TIMEOUT
|
||||||
|
value:
|
||||||
|
_default: '180'
|
||||||
|
commitSha: ''
|
||||||
|
gitlabUri: ''
|
||||||
|
gitlabJobUrl: ''
|
||||||
|
owner: ''
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
265
apps/django/nn-dev/jwt-access.yaml
Normal file
265
apps/django/nn-dev/jwt-access.yaml
Normal file
@ -0,0 +1,265 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-private: secrets/data/vault/apps/django/jwt_private
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-private: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_private" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "private_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
checksum/jwt-runtime: 58bae88d1d81ac414b2cac6ff81e0f441dc9a8f05a42d9d3d11bdfa97d38772b
|
||||||
|
vault.hashicorp.com/agent-inject-secret-jwt-signer-client: secrets/data/vault/apps/django/jwt_signer_client
|
||||||
|
vault.hashicorp.com/agent-inject-template-jwt-signer-client: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_signer_client" -}}
|
||||||
|
|
||||||
|
JWT_SIGNER_CLIENT_TOKEN={{ index .Data.data "token" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/role: django-backend
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-postgresql ] && . /vault/secrets/django-postgresql
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-rabbitmq ] && . /vault/secrets/django-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-s3 ] && . /vault/secrets/django-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-kafka ] && . /vault/secrets/django-kafka
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-private ] && export JWT_PRIVATE_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-private)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-public ] && export JWT_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/jwt-signer-client ] && . /vault/secrets/jwt-signer-client
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec /opt/sarex/entrypoint.sh
|
||||||
|
|
||||||
|
'
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /jwt-config/original-production.py
|
||||||
|
name: django-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: uwsgi.ini
|
||||||
|
path:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
name:
|
||||||
|
_default: uwsgi-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/uwsgi.ini
|
||||||
|
name: uwsgi-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
- name: jwt-runtime-production
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-client
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_client.py
|
||||||
|
subPath:
|
||||||
|
_default: client.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: client.py
|
||||||
|
path:
|
||||||
|
_default: client.py
|
||||||
|
- name: jwt-runtime-urls
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_urls.py
|
||||||
|
subPath:
|
||||||
|
_default: urls.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: urls.py
|
||||||
|
path:
|
||||||
|
_default: urls.py
|
||||||
|
postRenderers:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
patch: "- op: add\n path: /spec/template/spec/serviceAccountName\n value:\
|
||||||
|
\ django-backend-vault\n- op: add\n path: /spec/template/spec/containers/0/env/-\n\
|
||||||
|
\ value:\n name: JWT_SIGNER_MODE\n value: server\n"
|
||||||
|
---
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: celery
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
celery:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-private: null
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-private: null
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
checksum/jwt-runtime: 58bae88d1d81ac414b2cac6ff81e0f441dc9a8f05a42d9d3d11bdfa97d38772b
|
||||||
|
vault.hashicorp.com/agent-inject-secret-jwt-signer-client: secrets/data/vault/apps/django/jwt_signer_client
|
||||||
|
vault.hashicorp.com/agent-inject-template-jwt-signer-client: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_signer_client" -}}
|
||||||
|
|
||||||
|
JWT_SIGNER_CLIENT_TOKEN={{ index .Data.data "token" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/role: django-celery
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-postgresql ] && . /vault/secrets/django-postgresql
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-rabbitmq ] && . /vault/secrets/django-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-s3 ] && . /vault/secrets/django-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-kafka ] && . /vault/secrets/django-kafka
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-public ] && export JWT_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/jwt-signer-client ] && . /vault/secrets/jwt-signer-client
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec celery -A config worker -B -l info -E -Q default -n default_worker.%h
|
||||||
|
--concurrency=2
|
||||||
|
|
||||||
|
'
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /jwt-config/original-production.py
|
||||||
|
name: django-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-production
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-client
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_client.py
|
||||||
|
subPath:
|
||||||
|
_default: client.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: client.py
|
||||||
|
path:
|
||||||
|
_default: client.py
|
||||||
|
postRenderers:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment
|
||||||
|
name: celery
|
||||||
|
patch: "- op: add\n path: /spec/template/spec/volumes/-\n value:\n name:\
|
||||||
|
\ jwt-runtime-patch\n configMap:\n name: jwt-runtime\n- op: add\n\
|
||||||
|
\ path: /spec/template/spec/initContainers\n value:\n - name: jwt-delegation-code\n\
|
||||||
|
\ image: cr.yandex/crp3ccidau046kdj8g9q/backend:production_18e5ac1e\n\
|
||||||
|
\ command:\n - python\n - /jwt-source/patch.py\n volumeMounts:\n\
|
||||||
|
\ - name: jwt-runtime-patch\n mountPath: /jwt-source\n readOnly:\
|
||||||
|
\ true\n - name: jwt-patched\n mountPath: /jwt-patched\n resources:\n\
|
||||||
|
\ requests:\n cpu: 25m\n memory: 64Mi\n- op: add\n path:\
|
||||||
|
\ /spec/template/spec/volumes/-\n value:\n name: jwt-patched\n emptyDir:\
|
||||||
|
\ {}\n- op: add\n path: /spec/template/spec/containers/0/volumeMounts/-\n\
|
||||||
|
\ value:\n name: jwt-patched\n mountPath: /opt/sarex/sarex/base/tasks.py\n\
|
||||||
|
\ subPath: tasks.py\n readOnly: true\n- op: add\n path: /spec/template/spec/containers/0/volumeMounts/-\n\
|
||||||
|
\ value:\n name: jwt-patched\n mountPath: /opt/sarex/sarex/services/mixin.py\n\
|
||||||
|
\ subPath: mixin.py\n readOnly: true\n- op: add\n path: /spec/template/spec/containers/0/env/-\n\
|
||||||
|
\ value:\n name: JWT_SIGNER_URL\n value: http://backend-svc.django.svc.cluster.local:80/internal/jwt/access-token/\n\
|
||||||
|
- op: add\n path: /spec/template/spec/serviceAccountName\n value: django-celery-vault\n"
|
||||||
11
apps/django/nn-dev/jwt-serviceaccount.yaml
Normal file
11
apps/django/nn-dev/jwt-serviceaccount.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: django-backend-vault
|
||||||
|
namespace: django
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: django-celery-vault
|
||||||
|
namespace: django
|
||||||
31
apps/django/nn-dev/jwt/client.py
Normal file
31
apps/django/nn-dev/jwt/client.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
from urllib.error import HTTPError, URLError
|
||||||
|
from urllib.request import Request, urlopen
|
||||||
|
|
||||||
|
|
||||||
|
def issue_access_token(user_id):
|
||||||
|
endpoint = os.environ["JWT_SIGNER_URL"]
|
||||||
|
credential = os.environ["JWT_SIGNER_CLIENT_TOKEN"]
|
||||||
|
request = Request(
|
||||||
|
endpoint,
|
||||||
|
data=json.dumps({"user_id": int(user_id)}).encode(),
|
||||||
|
headers={"Authorization": "Bearer " + credential, "Content-Type": "application/json"},
|
||||||
|
method="POST",
|
||||||
|
)
|
||||||
|
for attempt in range(3):
|
||||||
|
try:
|
||||||
|
with urlopen(request, timeout=5) as response:
|
||||||
|
payload = json.load(response)
|
||||||
|
token = payload.get("access")
|
||||||
|
if not isinstance(token, str) or not token:
|
||||||
|
raise RuntimeError("JWT signer returned an invalid response")
|
||||||
|
return token
|
||||||
|
except HTTPError as error:
|
||||||
|
if error.code < 500 or attempt == 2:
|
||||||
|
raise RuntimeError("JWT signer rejected the request: HTTP %d" % error.code) from None
|
||||||
|
except URLError:
|
||||||
|
if attempt == 2:
|
||||||
|
raise RuntimeError("JWT signer is unavailable") from None
|
||||||
|
time.sleep(attempt + 1)
|
||||||
15
apps/django/nn-dev/jwt/patch.py
Normal file
15
apps/django/nn-dev/jwt/patch.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
cases = [
|
||||||
|
("/opt/sarex/sarex/base/tasks.py", "tasks.py", "str(TokenObtainPairSerializer.get_token(user).access_token)", 2),
|
||||||
|
("/opt/sarex/sarex/services/mixin.py", "mixin.py", "str(CustomRefreshToken.for_user(user).access_token)", 1),
|
||||||
|
]
|
||||||
|
for source, destination, expression, expected in cases:
|
||||||
|
original = Path(source).read_text()
|
||||||
|
if original.count(expression) != expected:
|
||||||
|
raise RuntimeError("JWT delegation patch does not match the application image: " + source)
|
||||||
|
modified = "from config.jwt_signer_client import issue_access_token\n" + original.replace(
|
||||||
|
expression, "issue_access_token(user.id)"
|
||||||
|
)
|
||||||
|
compile(modified, source, "exec")
|
||||||
|
Path("/jwt-patched", destination).write_text(modified)
|
||||||
14
apps/django/nn-dev/jwt/production.py
Normal file
14
apps/django/nn-dev/jwt/production.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import os as _jwt_os
|
||||||
|
|
||||||
|
_jwt_has_private = bool(_jwt_os.environ.get("JWT_PRIVATE_KEY"))
|
||||||
|
if not _jwt_has_private:
|
||||||
|
_jwt_os.environ["JWT_PRIVATE_KEY"] = ""
|
||||||
|
with open("/jwt-config/original-production.py") as _jwt_source:
|
||||||
|
exec(compile(_jwt_source.read(), "/jwt-config/original-production.py", "exec"), globals())
|
||||||
|
if not _jwt_has_private:
|
||||||
|
_jwt_os.environ.pop("JWT_PRIVATE_KEY", None)
|
||||||
|
SIMPLE_JWT["SIGNING_KEY"] = ""
|
||||||
|
if _jwt_os.environ.get("JWT_SIGNER_MODE") == "server":
|
||||||
|
ROOT_URLCONF = "config.jwt_signer_urls"
|
||||||
|
DEBUG = False
|
||||||
|
del _jwt_has_private, _jwt_source
|
||||||
64
apps/django/nn-dev/jwt/urls.py
Normal file
64
apps/django/nn-dev/jwt/urls.py
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import hmac
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
from django.http import JsonResponse
|
||||||
|
from django.urls import path
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
from django.views.decorators.debug import sensitive_variables
|
||||||
|
|
||||||
|
from config import urls as original_urls
|
||||||
|
from sarex.core.serializers.token import CustomTokenSerializer
|
||||||
|
|
||||||
|
|
||||||
|
@csrf_exempt
|
||||||
|
@sensitive_variables("credential", "supplied", "token")
|
||||||
|
def issue_access_token(request):
|
||||||
|
if request.method != "POST":
|
||||||
|
return JsonResponse({"detail": "Method not allowed"}, status=405)
|
||||||
|
credential = os.environ.get("JWT_SIGNER_CLIENT_TOKEN", "")
|
||||||
|
supplied = request.headers.get("Authorization", "")
|
||||||
|
if not credential or not hmac.compare_digest(supplied.encode(), ("Bearer " + credential).encode()):
|
||||||
|
return JsonResponse({"detail": "Unauthorized"}, status=401)
|
||||||
|
if len(request.body) > 1024:
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
try:
|
||||||
|
value = json.loads(request.body)
|
||||||
|
user_id = value["user_id"]
|
||||||
|
if isinstance(user_id, bool) or not isinstance(user_id, int) or not 0 < user_id <= 9223372036854775807:
|
||||||
|
raise ValueError()
|
||||||
|
except (ValueError, TypeError, KeyError):
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
user = get_user_model().objects.filter(pk=user_id, is_active=True).first()
|
||||||
|
if user is None:
|
||||||
|
return JsonResponse({"detail": "User not found"}, status=404)
|
||||||
|
token = str(CustomTokenSerializer.get_token(user).access_token)
|
||||||
|
return JsonResponse({"access": token}, headers={"Cache-Control": "no-store"})
|
||||||
|
|
||||||
|
|
||||||
|
@sensitive_variables("credential", "token")
|
||||||
|
def issue_legacy_access_token(request, pk):
|
||||||
|
credential = os.environ.get("JWT_SIGNER_CLIENT_TOKEN", "")
|
||||||
|
if not credential or not hmac.compare_digest(
|
||||||
|
request.headers.get("Authorization", "").encode(), ("Bearer " + credential).encode()
|
||||||
|
):
|
||||||
|
return JsonResponse({"detail": "Unauthorized"}, status=401)
|
||||||
|
if request.method != "GET":
|
||||||
|
return JsonResponse({"detail": "Method not allowed"}, status=405)
|
||||||
|
if not 0 < pk <= 9223372036854775807:
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
user = get_user_model().objects.filter(pk=pk, is_active=True).first()
|
||||||
|
if user is None:
|
||||||
|
return JsonResponse({"detail": "User not found"}, status=404)
|
||||||
|
token = str(CustomTokenSerializer.get_token(user).access_token)
|
||||||
|
return JsonResponse(token, safe=False, headers={"Cache-Control": "no-store"})
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("internal/jwt/access-token/", issue_access_token),
|
||||||
|
path("internal/client/token/<int:pk>/", issue_legacy_access_token),
|
||||||
|
] + original_urls.urlpatterns
|
||||||
|
for name in ("handler400", "handler403", "handler404", "handler500"):
|
||||||
|
if hasattr(original_urls, name):
|
||||||
|
globals()[name] = getattr(original_urls, name)
|
||||||
102
apps/django/nn-dev/kustomization.yaml
Normal file
102
apps/django/nn-dev/kustomization.yaml
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
- jwt-serviceaccount.yaml
|
||||||
|
- export-project.yaml
|
||||||
|
patches:
|
||||||
|
- path: jwt-access.yaml
|
||||||
|
- path: backend.yaml
|
||||||
|
- path: celery.yaml
|
||||||
|
- path: s3-proxy.yaml
|
||||||
|
- path: zitadel-configmap.yaml
|
||||||
|
- patch: |
|
||||||
|
$patch: delete
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: srx-admin-frontend
|
||||||
|
namespace: django
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: backend
|
||||||
|
patch: |
|
||||||
|
- op: add
|
||||||
|
path: /spec/values/services/backend/envs/-
|
||||||
|
value:
|
||||||
|
name: DJANGO_HOST
|
||||||
|
value:
|
||||||
|
_default: https://${HOST_PLATFORM}
|
||||||
|
configMapGenerator:
|
||||||
|
- name: jwt-runtime
|
||||||
|
namespace: django
|
||||||
|
files:
|
||||||
|
- production.py=jwt/production.py
|
||||||
|
- client.py=jwt/client.py
|
||||||
|
- urls.py=jwt/urls.py
|
||||||
|
- patch.py=jwt/patch.py
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
- name: django-contour-env
|
||||||
|
literals:
|
||||||
|
- SAREX_HOST=https://${HOST_PLATFORM}
|
||||||
|
- ZITADEL_HOST=https://${HOST_LOGIN}
|
||||||
|
- WORKFLOWS_HOST=http://backend-svc.processing.svc.cluster.local:80
|
||||||
|
- WORKFLOWS_BASE_HOST=http://backend-svc.django.svc.cluster.local:80
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/local-config: "true"
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: django-contour-env
|
||||||
|
fieldPath: data.SAREX_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.backend.envs.[name=SERVER_HOST].value._default
|
||||||
|
- spec.values.services.backend.envs.[name=SERVER_API_HOST].value._default
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: celery
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.celery.envs.[name=SERVER_HOST].value._default
|
||||||
|
- spec.values.services.celery.envs.[name=SERVER_API_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: django-contour-env
|
||||||
|
fieldPath: data.ZITADEL_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: backend
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.backend.envs.[name=ZITADEL_HOST].value._default
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: celery
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.celery.envs.[name=ZITADEL_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: django-contour-env
|
||||||
|
fieldPath: data.WORKFLOWS_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: celery
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.celery.envs.[name=WORKFLOWS_HOST].value._default
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: django-contour-env
|
||||||
|
fieldPath: data.WORKFLOWS_BASE_HOST
|
||||||
|
targets:
|
||||||
|
- select:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: celery
|
||||||
|
fieldPaths:
|
||||||
|
- spec.values.services.celery.envs.[name=WORKFLOWS_BASE_HOST].value._default
|
||||||
18
apps/django/nn-dev/s3-proxy.yaml
Normal file
18
apps/django/nn-dev/s3-proxy.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: s3-proxy
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
s3-proxy:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-template-s3: |
|
||||||
|
{{- with secret "secrets/data/minio/apps/django" }}
|
||||||
|
AWS_API_ENDPOINT=http://${MINIO_ENDPOINT}
|
||||||
|
AWS_S3_BUCKET={{ index .Data.data "bucket" }}
|
||||||
|
AWS_ACCESS_KEY_ID={{ index .Data.data "access_key_id" }}
|
||||||
|
AWS_SECRET_ACCESS_KEY={{ index .Data.data "secret_access_key" }}
|
||||||
|
{{- end }}
|
||||||
82
apps/django/nn-dev/service-user-job.yaml
Normal file
82
apps/django/nn-dev/service-user-job.yaml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: django-service-user
|
||||||
|
namespace: django
|
||||||
|
annotations:
|
||||||
|
kustomize.toolkit.fluxcd.io/substitute: disabled
|
||||||
|
kustomize.toolkit.fluxcd.io/force: enabled
|
||||||
|
spec:
|
||||||
|
backoffLimit: 6
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
sidecar.istio.io/inject: "false"
|
||||||
|
vault.hashicorp.com/agent-inject: "true"
|
||||||
|
vault.hashicorp.com/agent-pre-populate-only: "true"
|
||||||
|
vault.hashicorp.com/auth-path: auth/kubernetes
|
||||||
|
vault.hashicorp.com/role: django
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-postgresql: secrets/data/apps/django/postgres
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-postgresql: |-
|
||||||
|
{{- with secret "secrets/data/apps/django/postgres" -}}
|
||||||
|
DJANGO_POSTGRES_HOST={{ index .Data.data "host" }}
|
||||||
|
DJANGO_POSTGRES_PORTS={{ index .Data.data "port" }}
|
||||||
|
DJANGO_POSTGRES_DATABASE={{ index .Data.data "database" }}
|
||||||
|
DJANGO_POSTGRES_USER={{ index .Data.data "username" }}
|
||||||
|
DJANGO_POSTGRES_PASSWORD={{ index .Data.data "password" }}
|
||||||
|
{{- end -}}
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: |-
|
||||||
|
{{- with secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
{{- end -}}
|
||||||
|
vault.hashicorp.com/agent-inject-secret-service-user: secrets/data/vault/common/django_auth
|
||||||
|
vault.hashicorp.com/agent-inject-template-service-user: |-
|
||||||
|
{{- with secret "secrets/data/vault/common/django_auth" -}}
|
||||||
|
SERVICE_USERNAME={{ index .Data.data "username" }}
|
||||||
|
SERVICE_PASSWORD={{ index .Data.data "password" }}
|
||||||
|
{{- end -}}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: django-vault
|
||||||
|
restartPolicy: Never
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: service-user
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/backend:production_7d0ec48b
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
workingDir: /opt/sarex
|
||||||
|
command: ["/bin/sh", "-ec"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
set -a
|
||||||
|
. /vault/secrets/service-user
|
||||||
|
set +a
|
||||||
|
exec python manage.py shell -c '
|
||||||
|
import os
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
name = os.environ["SERVICE_USERNAME"]
|
||||||
|
user, created = get_user_model().objects.get_or_create(username=name)
|
||||||
|
user.set_password(os.environ["SERVICE_PASSWORD"])
|
||||||
|
user.is_active = True
|
||||||
|
user.is_staff = True
|
||||||
|
user.is_superuser = True
|
||||||
|
user.save()
|
||||||
|
print("service user", name, "created" if created else "updated")
|
||||||
|
'
|
||||||
|
env:
|
||||||
|
- name: DJANGO_SETTINGS_MODULE
|
||||||
|
value: config.settings.production
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 256Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: django-configmap
|
||||||
|
mountPath: /opt/sarex/config/settings/production.py
|
||||||
|
subPath: production.py
|
||||||
|
readOnly: true
|
||||||
|
volumes:
|
||||||
|
- name: django-configmap
|
||||||
|
configMap:
|
||||||
|
name: django-configmap
|
||||||
14
apps/django/nn-dev/zitadel-configmap.yaml
Normal file
14
apps/django/nn-dev/zitadel-configmap.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: zitadel-configmap
|
||||||
|
namespace: django
|
||||||
|
data:
|
||||||
|
config.json: |
|
||||||
|
{
|
||||||
|
"auth_type": "zitadel",
|
||||||
|
"zitadel": {
|
||||||
|
"client_id": "${ZITADEL_CLIENT_ID}",
|
||||||
|
"host": "https://${HOST_LOGIN}"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- ../base
|
|
||||||
patches:
|
|
||||||
- path: nginx-configmap.yaml
|
|
||||||
target:
|
|
||||||
kind: ConfigMap
|
|
||||||
name: nginx-configmap
|
|
||||||
@ -1,160 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: nginx-configmap
|
|
||||||
namespace: django
|
|
||||||
data:
|
|
||||||
nginx.conf: |
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
pid /var/run/nginx.pid;
|
|
||||||
|
|
||||||
events {
|
|
||||||
use epoll;
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
|
|
||||||
# Basic Settings
|
|
||||||
large_client_header_buffers 8 128k;
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
keepalive_timeout 300;
|
|
||||||
types_hash_max_size 2048;
|
|
||||||
client_max_body_size 5000M;
|
|
||||||
client_header_buffer_size 5M;
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
# Logging Settings
|
|
||||||
access_log /var/log/nginx/access.log;
|
|
||||||
error_log /var/log/nginx/error.log;
|
|
||||||
|
|
||||||
# GZIP Settings
|
|
||||||
gzip on;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_proxied any;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_buffers 16 8k;
|
|
||||||
gzip_http_version 1.1;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
root /opt/react_client/;
|
|
||||||
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
||||||
add_header 'Access-Control-Allow-Methods' '*' always;
|
|
||||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
|
||||||
|
|
||||||
location = /static/index.bundle.js {
|
|
||||||
add_header Cache-Control 'no-store no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
if_modified_since off;
|
|
||||||
expires off;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location ~^/api/pm/ {
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Connection "";
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_pass http://backend-svc.pm.svc.cluster.local:8000;
|
|
||||||
# }
|
|
||||||
|
|
||||||
# location ~^/api/v1/documents/ {
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_pass http://backend-filestream-svc.documentations.svc.cluster.local:80;
|
|
||||||
# }
|
|
||||||
|
|
||||||
location ~^/(api|admin)/ {
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass http://backend-svc.django.svc.cluster.local:80;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /static/pdf-runtime/assets/mupdf-wasm.wasm {
|
|
||||||
alias /opt/react_client/static/pdf-runtime/assets/mupdf-wasm.wasm;
|
|
||||||
add_header Content-Type application/wasm always;
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
||||||
add_header Access-Control-Allow-Origin "*" always;
|
|
||||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
|
||||||
add_header Access-Control-Allow-Headers "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /workspaces-v2/worker/static/viewer-pdf/mupdf-wasm.js {
|
|
||||||
alias /opt/react_client/static/viewer-pdf/mupdf-wasm.js;
|
|
||||||
add_header Content-Type application/javascript always;
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
||||||
add_header Access-Control-Allow-Origin "*" always;
|
|
||||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
|
||||||
add_header Access-Control-Allow-Headers "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /workspaces-v2/worker/mupdf.worker-3.3.9.js {
|
|
||||||
alias /opt/react_client/static/pdf-runtime/mupdf.worker-3.3.9.js;
|
|
||||||
add_header Content-Type application/javascript always;
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
||||||
add_header Access-Control-Allow-Origin "*" always;
|
|
||||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
|
||||||
add_header Access-Control-Allow-Headers "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /workspaces-v2/worker/static/viewer-pdf/mupdf.js {
|
|
||||||
alias /opt/react_client/static/viewer-pdf/mupdf.js;
|
|
||||||
add_header Content-Type application/javascript always;
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
||||||
add_header Access-Control-Allow-Origin "*" always;
|
|
||||||
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
|
|
||||||
add_header Access-Control-Allow-Headers "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /workspaces-v2/worker/static/viewer-pdf/mupdf-wasm.wasm {
|
|
||||||
add_header Content-Type application/wasm always;
|
|
||||||
alias /opt/react_client/static/viewer-pdf/mupdf-wasm.wasm;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~^/workspaces-v2/(.+).js {
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
rewrite /workspaces-v2/(.+) /$1 break;
|
|
||||||
proxy_pass http://frontend-svc.workspaces.svc.cluster.local:80;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~^/workspaces-v2/(.+)\.wasm$ {
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
rewrite ^/workspaces-v2/(.+) /$1 break;
|
|
||||||
proxy_pass http://frontend-svc.workspaces.svc.cluster.local:80;
|
|
||||||
}
|
|
||||||
|
|
||||||
location @index {
|
|
||||||
add_header Cache-Control 'no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
if_modified_since off;
|
|
||||||
expires off;
|
|
||||||
try_files /static/index.html =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location ~^/workflows/(.+).js {
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Connection "";
|
|
||||||
# rewrite /workflows/(.+) /$1 break;
|
|
||||||
# proxy_pass http://frontend-svc.processing.svc.cluster.local:80;
|
|
||||||
# }
|
|
||||||
|
|
||||||
location /service-worker.js {
|
|
||||||
try_files /static/$uri @index;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri @index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -9,21 +9,52 @@ spec:
|
|||||||
backend:
|
backend:
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
_default:
|
_default:
|
||||||
vault.hashicorp.com/agent-inject-template-django-s3: |-
|
vault.hashicorp.com/agent-inject-template-django-s3: '{{- with secret
|
||||||
{{- with secret "secrets/data/minio/apps/django" }}
|
"secrets/data/minio/apps/django" }}
|
||||||
|
|
||||||
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
S3_HOST=http://${MINIO_ENDPOINT}
|
S3_HOST=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
S3_BUCKET={{ index .Data.data "bucket" }}
|
S3_BUCKET={{ index .Data.data "bucket" }}
|
||||||
|
|
||||||
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
||||||
|
|
||||||
AWS_S3_ACCESS_KEY_ID={{ index .Data.data "access_key_id" }}
|
AWS_S3_ACCESS_KEY_ID={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
AWS_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_access_key" }}
|
AWS_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_access_key" }}
|
||||||
|
|
||||||
AWS_STORAGE_BUCKET_NAME={{ index .Data.data "bucket" }}
|
AWS_STORAGE_BUCKET_NAME={{ index .Data.data "bucket" }}
|
||||||
{{- end }}
|
|
||||||
|
{{- end }}'
|
||||||
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
||||||
vault.hashicorp.com/agent-inject-template-django-common: |-
|
vault.hashicorp.com/agent-inject-template-django-common: '{{- with secret
|
||||||
{{- with secret "secrets/data/zitadel/setup" -}}
|
"secrets/data/zitadel/setup" -}}
|
||||||
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token" }}
|
|
||||||
{{- end -}}
|
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token"
|
||||||
vault.hashicorp.com/agent-inject-secret-django-kafka: null
|
}}
|
||||||
vault.hashicorp.com/agent-inject-template-django-kafka: null
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-kafka: secrets/data/kafka/apps/iam
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/iam" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ with index .Data.data "auth" }}{{ index
|
||||||
|
. "bootstrap_servers" }}{{ else }}{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}{{ end }}"]''
|
||||||
|
|
||||||
|
KAFKA_SECURITY_PROTOCOL=''SASL_PLAINTEXT''
|
||||||
|
|
||||||
|
KAFKA_SASL_MECHANISM=''SCRAM-SHA-512''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
KAFKA_SSL_CAFILE=''''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 8200,9092
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
|
|||||||
@ -9,18 +9,46 @@ spec:
|
|||||||
celery:
|
celery:
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
_default:
|
_default:
|
||||||
vault.hashicorp.com/agent-inject-template-django-s3: |-
|
vault.hashicorp.com/agent-inject-template-django-s3: '{{- with secret
|
||||||
{{- with secret "secrets/data/minio/apps/django" }}
|
"secrets/data/minio/apps/django" }}
|
||||||
|
|
||||||
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
AWS_S3_ENDPOINT_URL=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
S3_HOST=http://${MINIO_ENDPOINT}
|
S3_HOST=http://${MINIO_ENDPOINT}
|
||||||
|
|
||||||
S3_BUCKET={{ index .Data.data "bucket" }}
|
S3_BUCKET={{ index .Data.data "bucket" }}
|
||||||
|
|
||||||
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
S3_LOGIN={{ index .Data.data "access_key_id" }}
|
||||||
|
|
||||||
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
S3_PASSWORD={{ index .Data.data "secret_access_key" }}
|
||||||
{{- end }}
|
|
||||||
|
{{- end }}'
|
||||||
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
vault.hashicorp.com/agent-inject-secret-django-common: secrets/data/zitadel/setup
|
||||||
vault.hashicorp.com/agent-inject-template-django-common: |-
|
vault.hashicorp.com/agent-inject-template-django-common: '{{- with secret
|
||||||
{{- with secret "secrets/data/zitadel/setup" -}}
|
"secrets/data/zitadel/setup" -}}
|
||||||
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token" }}
|
|
||||||
{{- end -}}
|
ZITADEL_ACCESS_TOKEN={{ index .Data.data "django_zitadel_access_token"
|
||||||
vault.hashicorp.com/agent-inject-secret-django-kafka: null
|
}}
|
||||||
vault.hashicorp.com/agent-inject-template-django-kafka: null
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-kafka: secrets/data/kafka/apps/iam
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-kafka: '{{- with secret
|
||||||
|
"secrets/data/kafka/apps/iam" -}}
|
||||||
|
|
||||||
|
KAFKA_BOOTSTRAP_SERVERS=''["{{ with index .Data.data "auth" }}{{ index
|
||||||
|
. "bootstrap_servers" }}{{ else }}{{ index .Data.data "bootstrap_servers"
|
||||||
|
}}{{ end }}"]''
|
||||||
|
|
||||||
|
KAFKA_SECURITY_PROTOCOL=''SASL_PLAINTEXT''
|
||||||
|
|
||||||
|
KAFKA_SASL_MECHANISM=''SCRAM-SHA-512''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_USERNAME=''{{ index .Data.data "username" }}''
|
||||||
|
|
||||||
|
KAFKA_SASL_PLAIN_PASSWORD=''{{ index .Data.data "password" }}''
|
||||||
|
|
||||||
|
KAFKA_SSL_CAFILE=''''
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
traffic.sidecar.istio.io/excludeOutboundPorts: 8200,9092
|
||||||
|
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts":true}'
|
||||||
|
|||||||
88
apps/django/stand/export-project.yaml
Normal file
88
apps/django/stand/export-project.yaml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: export-project
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: universal-chart
|
||||||
|
version: 0.1.9
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 10m
|
||||||
|
install:
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
upgrade:
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
env: _default
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
enabled: true
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/export-project:prod_ef8aa756
|
||||||
|
pullPolicy:
|
||||||
|
_default: IfNotPresent
|
||||||
|
deployment:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: export-project
|
||||||
|
replicaCount:
|
||||||
|
_default: 1
|
||||||
|
stage: 1
|
||||||
|
preprod: 3
|
||||||
|
production: 3
|
||||||
|
port:
|
||||||
|
_default: 8000
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
enabled: false
|
||||||
|
readiness:
|
||||||
|
enabled: false
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu:
|
||||||
|
_default: 25m
|
||||||
|
memory:
|
||||||
|
_default: 128Mi
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
name:
|
||||||
|
_default: export-project-service
|
||||||
|
type:
|
||||||
|
_default: ClusterIP
|
||||||
|
port:
|
||||||
|
_default: 8000
|
||||||
|
targetPort:
|
||||||
|
_default: 8000
|
||||||
|
portName:
|
||||||
|
_default: http
|
||||||
|
imagePullSecrets:
|
||||||
|
enabled:
|
||||||
|
_default: true
|
||||||
|
name:
|
||||||
|
_default: regcred
|
||||||
|
labels:
|
||||||
|
monitoring: prometheus
|
||||||
|
envs:
|
||||||
|
- name: TIMEOUT
|
||||||
|
value:
|
||||||
|
_default: '180'
|
||||||
|
commitSha: ''
|
||||||
|
gitlabUri: ''
|
||||||
|
gitlabJobUrl: ''
|
||||||
|
owner: ''
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
sidecar.istio.io/proxyCPU: 25m
|
||||||
|
sidecar.istio.io/proxyMemory: 128Mi
|
||||||
|
sidecar.istio.io/proxyCPULimit: '2'
|
||||||
|
sidecar.istio.io/proxyMemoryLimit: 1Gi
|
||||||
265
apps/django/stand/jwt-access.yaml
Normal file
265
apps/django/stand/jwt-access.yaml
Normal file
@ -0,0 +1,265 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-private: secrets/data/vault/apps/django/jwt_private
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-private: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_private" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "private_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
checksum/jwt-runtime: 58bae88d1d81ac414b2cac6ff81e0f441dc9a8f05a42d9d3d11bdfa97d38772b
|
||||||
|
vault.hashicorp.com/agent-inject-secret-jwt-signer-client: secrets/data/vault/apps/django/jwt_signer_client
|
||||||
|
vault.hashicorp.com/agent-inject-template-jwt-signer-client: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_signer_client" -}}
|
||||||
|
|
||||||
|
JWT_SIGNER_CLIENT_TOKEN={{ index .Data.data "token" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/role: django-backend
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-postgresql ] && . /vault/secrets/django-postgresql
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-rabbitmq ] && . /vault/secrets/django-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-s3 ] && . /vault/secrets/django-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-kafka ] && . /vault/secrets/django-kafka
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-private ] && export JWT_PRIVATE_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-private)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-public ] && export JWT_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/jwt-signer-client ] && . /vault/secrets/jwt-signer-client
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec /opt/sarex/entrypoint.sh
|
||||||
|
|
||||||
|
'
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /jwt-config/original-production.py
|
||||||
|
name: django-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: uwsgi.ini
|
||||||
|
path:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
name:
|
||||||
|
_default: uwsgi-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/uwsgi.ini
|
||||||
|
name: uwsgi-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
- name: jwt-runtime-production
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-client
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_client.py
|
||||||
|
subPath:
|
||||||
|
_default: client.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: client.py
|
||||||
|
path:
|
||||||
|
_default: client.py
|
||||||
|
- name: jwt-runtime-urls
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_urls.py
|
||||||
|
subPath:
|
||||||
|
_default: urls.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: urls.py
|
||||||
|
path:
|
||||||
|
_default: urls.py
|
||||||
|
postRenderers:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
patch: "- op: add\n path: /spec/template/spec/serviceAccountName\n value:\
|
||||||
|
\ django-backend-vault\n- op: add\n path: /spec/template/spec/containers/0/env/-\n\
|
||||||
|
\ value:\n name: JWT_SIGNER_MODE\n value: server\n"
|
||||||
|
---
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: celery
|
||||||
|
namespace: django
|
||||||
|
spec:
|
||||||
|
values:
|
||||||
|
services:
|
||||||
|
celery:
|
||||||
|
podAnnotations:
|
||||||
|
_default:
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-private: null
|
||||||
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-private: null
|
||||||
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: '{{- with
|
||||||
|
secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
|
|
||||||
|
{{ index .Data.data "public_key" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
checksum/jwt-runtime: 58bae88d1d81ac414b2cac6ff81e0f441dc9a8f05a42d9d3d11bdfa97d38772b
|
||||||
|
vault.hashicorp.com/agent-inject-secret-jwt-signer-client: secrets/data/vault/apps/django/jwt_signer_client
|
||||||
|
vault.hashicorp.com/agent-inject-template-jwt-signer-client: '{{- with
|
||||||
|
secret "secrets/data/vault/apps/django/jwt_signer_client" -}}
|
||||||
|
|
||||||
|
JWT_SIGNER_CLIENT_TOKEN={{ index .Data.data "token" }}
|
||||||
|
|
||||||
|
{{- end -}}'
|
||||||
|
vault.hashicorp.com/role: django-celery
|
||||||
|
deployment:
|
||||||
|
args:
|
||||||
|
_default:
|
||||||
|
- 'set -a
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-postgresql ] && . /vault/secrets/django-postgresql
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-rabbitmq ] && . /vault/secrets/django-rabbitmq
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-s3 ] && . /vault/secrets/django-s3
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-kafka ] && . /vault/secrets/django-kafka
|
||||||
|
|
||||||
|
[ -f /vault/secrets/django-jwt-public ] && export JWT_PUBLIC_KEY="$(cat
|
||||||
|
/vault/secrets/django-jwt-public)"
|
||||||
|
|
||||||
|
[ -f /vault/secrets/jwt-signer-client ] && . /vault/secrets/jwt-signer-client
|
||||||
|
|
||||||
|
set +a
|
||||||
|
|
||||||
|
exec celery -A config worker -B -l info -E -Q default -n default_worker.%h
|
||||||
|
--concurrency=2
|
||||||
|
|
||||||
|
'
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- configMap:
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /jwt-config/original-production.py
|
||||||
|
name: django-configmap
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-production
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: jwt-runtime-client
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/jwt_signer_client.py
|
||||||
|
subPath:
|
||||||
|
_default: client.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: jwt-runtime
|
||||||
|
items:
|
||||||
|
- key: client.py
|
||||||
|
path:
|
||||||
|
_default: client.py
|
||||||
|
postRenderers:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment
|
||||||
|
name: celery
|
||||||
|
patch: "- op: add\n path: /spec/template/spec/volumes/-\n value:\n name:\
|
||||||
|
\ jwt-runtime-patch\n configMap:\n name: jwt-runtime\n- op: add\n\
|
||||||
|
\ path: /spec/template/spec/initContainers\n value:\n - name: jwt-delegation-code\n\
|
||||||
|
\ image: cr.yandex/crp3ccidau046kdj8g9q/backend:production_18e5ac1e\n\
|
||||||
|
\ command:\n - python\n - /jwt-source/patch.py\n volumeMounts:\n\
|
||||||
|
\ - name: jwt-runtime-patch\n mountPath: /jwt-source\n readOnly:\
|
||||||
|
\ true\n - name: jwt-patched\n mountPath: /jwt-patched\n resources:\n\
|
||||||
|
\ requests:\n cpu: 25m\n memory: 64Mi\n- op: add\n path:\
|
||||||
|
\ /spec/template/spec/volumes/-\n value:\n name: jwt-patched\n emptyDir:\
|
||||||
|
\ {}\n- op: add\n path: /spec/template/spec/containers/0/volumeMounts/-\n\
|
||||||
|
\ value:\n name: jwt-patched\n mountPath: /opt/sarex/sarex/base/tasks.py\n\
|
||||||
|
\ subPath: tasks.py\n readOnly: true\n- op: add\n path: /spec/template/spec/containers/0/volumeMounts/-\n\
|
||||||
|
\ value:\n name: jwt-patched\n mountPath: /opt/sarex/sarex/services/mixin.py\n\
|
||||||
|
\ subPath: mixin.py\n readOnly: true\n- op: add\n path: /spec/template/spec/containers/0/env/-\n\
|
||||||
|
\ value:\n name: JWT_SIGNER_URL\n value: http://backend-svc.django.svc.cluster.local:80/internal/jwt/access-token/\n\
|
||||||
|
- op: add\n path: /spec/template/spec/serviceAccountName\n value: django-celery-vault\n"
|
||||||
11
apps/django/stand/jwt-serviceaccount.yaml
Normal file
11
apps/django/stand/jwt-serviceaccount.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: django-backend-vault
|
||||||
|
namespace: django
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: django-celery-vault
|
||||||
|
namespace: django
|
||||||
31
apps/django/stand/jwt/client.py
Normal file
31
apps/django/stand/jwt/client.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
from urllib.error import HTTPError, URLError
|
||||||
|
from urllib.request import Request, urlopen
|
||||||
|
|
||||||
|
|
||||||
|
def issue_access_token(user_id):
|
||||||
|
endpoint = os.environ["JWT_SIGNER_URL"]
|
||||||
|
credential = os.environ["JWT_SIGNER_CLIENT_TOKEN"]
|
||||||
|
request = Request(
|
||||||
|
endpoint,
|
||||||
|
data=json.dumps({"user_id": int(user_id)}).encode(),
|
||||||
|
headers={"Authorization": "Bearer " + credential, "Content-Type": "application/json"},
|
||||||
|
method="POST",
|
||||||
|
)
|
||||||
|
for attempt in range(3):
|
||||||
|
try:
|
||||||
|
with urlopen(request, timeout=5) as response:
|
||||||
|
payload = json.load(response)
|
||||||
|
token = payload.get("access")
|
||||||
|
if not isinstance(token, str) or not token:
|
||||||
|
raise RuntimeError("JWT signer returned an invalid response")
|
||||||
|
return token
|
||||||
|
except HTTPError as error:
|
||||||
|
if error.code < 500 or attempt == 2:
|
||||||
|
raise RuntimeError("JWT signer rejected the request: HTTP %d" % error.code) from None
|
||||||
|
except URLError:
|
||||||
|
if attempt == 2:
|
||||||
|
raise RuntimeError("JWT signer is unavailable") from None
|
||||||
|
time.sleep(attempt + 1)
|
||||||
15
apps/django/stand/jwt/patch.py
Normal file
15
apps/django/stand/jwt/patch.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
cases = [
|
||||||
|
("/opt/sarex/sarex/base/tasks.py", "tasks.py", "str(TokenObtainPairSerializer.get_token(user).access_token)", 2),
|
||||||
|
("/opt/sarex/sarex/services/mixin.py", "mixin.py", "str(CustomRefreshToken.for_user(user).access_token)", 1),
|
||||||
|
]
|
||||||
|
for source, destination, expression, expected in cases:
|
||||||
|
original = Path(source).read_text()
|
||||||
|
if original.count(expression) != expected:
|
||||||
|
raise RuntimeError("JWT delegation patch does not match the application image: " + source)
|
||||||
|
modified = "from config.jwt_signer_client import issue_access_token\n" + original.replace(
|
||||||
|
expression, "issue_access_token(user.id)"
|
||||||
|
)
|
||||||
|
compile(modified, source, "exec")
|
||||||
|
Path("/jwt-patched", destination).write_text(modified)
|
||||||
14
apps/django/stand/jwt/production.py
Normal file
14
apps/django/stand/jwt/production.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import os as _jwt_os
|
||||||
|
|
||||||
|
_jwt_has_private = bool(_jwt_os.environ.get("JWT_PRIVATE_KEY"))
|
||||||
|
if not _jwt_has_private:
|
||||||
|
_jwt_os.environ["JWT_PRIVATE_KEY"] = ""
|
||||||
|
with open("/jwt-config/original-production.py") as _jwt_source:
|
||||||
|
exec(compile(_jwt_source.read(), "/jwt-config/original-production.py", "exec"), globals())
|
||||||
|
if not _jwt_has_private:
|
||||||
|
_jwt_os.environ.pop("JWT_PRIVATE_KEY", None)
|
||||||
|
SIMPLE_JWT["SIGNING_KEY"] = ""
|
||||||
|
if _jwt_os.environ.get("JWT_SIGNER_MODE") == "server":
|
||||||
|
ROOT_URLCONF = "config.jwt_signer_urls"
|
||||||
|
DEBUG = False
|
||||||
|
del _jwt_has_private, _jwt_source
|
||||||
64
apps/django/stand/jwt/urls.py
Normal file
64
apps/django/stand/jwt/urls.py
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import hmac
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
from django.http import JsonResponse
|
||||||
|
from django.urls import path
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
from django.views.decorators.debug import sensitive_variables
|
||||||
|
|
||||||
|
from config import urls as original_urls
|
||||||
|
from sarex.core.serializers.token import CustomTokenSerializer
|
||||||
|
|
||||||
|
|
||||||
|
@csrf_exempt
|
||||||
|
@sensitive_variables("credential", "supplied", "token")
|
||||||
|
def issue_access_token(request):
|
||||||
|
if request.method != "POST":
|
||||||
|
return JsonResponse({"detail": "Method not allowed"}, status=405)
|
||||||
|
credential = os.environ.get("JWT_SIGNER_CLIENT_TOKEN", "")
|
||||||
|
supplied = request.headers.get("Authorization", "")
|
||||||
|
if not credential or not hmac.compare_digest(supplied.encode(), ("Bearer " + credential).encode()):
|
||||||
|
return JsonResponse({"detail": "Unauthorized"}, status=401)
|
||||||
|
if len(request.body) > 1024:
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
try:
|
||||||
|
value = json.loads(request.body)
|
||||||
|
user_id = value["user_id"]
|
||||||
|
if isinstance(user_id, bool) or not isinstance(user_id, int) or not 0 < user_id <= 9223372036854775807:
|
||||||
|
raise ValueError()
|
||||||
|
except (ValueError, TypeError, KeyError):
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
user = get_user_model().objects.filter(pk=user_id, is_active=True).first()
|
||||||
|
if user is None:
|
||||||
|
return JsonResponse({"detail": "User not found"}, status=404)
|
||||||
|
token = str(CustomTokenSerializer.get_token(user).access_token)
|
||||||
|
return JsonResponse({"access": token}, headers={"Cache-Control": "no-store"})
|
||||||
|
|
||||||
|
|
||||||
|
@sensitive_variables("credential", "token")
|
||||||
|
def issue_legacy_access_token(request, pk):
|
||||||
|
credential = os.environ.get("JWT_SIGNER_CLIENT_TOKEN", "")
|
||||||
|
if not credential or not hmac.compare_digest(
|
||||||
|
request.headers.get("Authorization", "").encode(), ("Bearer " + credential).encode()
|
||||||
|
):
|
||||||
|
return JsonResponse({"detail": "Unauthorized"}, status=401)
|
||||||
|
if request.method != "GET":
|
||||||
|
return JsonResponse({"detail": "Method not allowed"}, status=405)
|
||||||
|
if not 0 < pk <= 9223372036854775807:
|
||||||
|
return JsonResponse({"detail": "Invalid request"}, status=400)
|
||||||
|
user = get_user_model().objects.filter(pk=pk, is_active=True).first()
|
||||||
|
if user is None:
|
||||||
|
return JsonResponse({"detail": "User not found"}, status=404)
|
||||||
|
token = str(CustomTokenSerializer.get_token(user).access_token)
|
||||||
|
return JsonResponse(token, safe=False, headers={"Cache-Control": "no-store"})
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("internal/jwt/access-token/", issue_access_token),
|
||||||
|
path("internal/client/token/<int:pk>/", issue_legacy_access_token),
|
||||||
|
] + original_urls.urlpatterns
|
||||||
|
for name in ("handler400", "handler403", "handler404", "handler500"):
|
||||||
|
if hasattr(original_urls, name):
|
||||||
|
globals()[name] = getattr(original_urls, name)
|
||||||
@ -2,8 +2,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
- service-user-job.yaml
|
- jwt-serviceaccount.yaml
|
||||||
|
- export-project.yaml
|
||||||
patches:
|
patches:
|
||||||
|
- path: jwt-access.yaml
|
||||||
- path: backend.yaml
|
- path: backend.yaml
|
||||||
- path: celery.yaml
|
- path: celery.yaml
|
||||||
- path: s3-proxy.yaml
|
- path: s3-proxy.yaml
|
||||||
@ -26,6 +28,15 @@ patches:
|
|||||||
value:
|
value:
|
||||||
_default: https://sarex.${CONTOUR_DOMAIN}
|
_default: https://sarex.${CONTOUR_DOMAIN}
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
|
- name: jwt-runtime
|
||||||
|
namespace: django
|
||||||
|
files:
|
||||||
|
- production.py=jwt/production.py
|
||||||
|
- client.py=jwt/client.py
|
||||||
|
- urls.py=jwt/urls.py
|
||||||
|
- patch.py=jwt/patch.py
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
- name: django-contour-env
|
- name: django-contour-env
|
||||||
literals:
|
literals:
|
||||||
- SAREX_HOST=https://sarex.${CONTOUR_DOMAIN}
|
- SAREX_HOST=https://sarex.${CONTOUR_DOMAIN}
|
||||||
|
|||||||
@ -25,14 +25,9 @@ spec:
|
|||||||
DJANGO_POSTGRES_USER={{ index .Data.data "username" }}
|
DJANGO_POSTGRES_USER={{ index .Data.data "username" }}
|
||||||
DJANGO_POSTGRES_PASSWORD={{ index .Data.data "password" }}
|
DJANGO_POSTGRES_PASSWORD={{ index .Data.data "password" }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
vault.hashicorp.com/agent-inject-secret-django-jwt-private: secrets/data/vault/common/rsa_keys
|
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/jwt_public
|
||||||
vault.hashicorp.com/agent-inject-template-django-jwt-private: |-
|
|
||||||
{{- with secret "secrets/data/vault/common/rsa_keys" -}}
|
|
||||||
{{ index .Data.data "private_key" }}
|
|
||||||
{{- end -}}
|
|
||||||
vault.hashicorp.com/agent-inject-secret-django-jwt-public: secrets/data/vault/common/rsa_keys
|
|
||||||
vault.hashicorp.com/agent-inject-template-django-jwt-public: |-
|
vault.hashicorp.com/agent-inject-template-django-jwt-public: |-
|
||||||
{{- with secret "secrets/data/vault/common/rsa_keys" -}}
|
{{- with secret "secrets/data/vault/common/jwt_public" -}}
|
||||||
{{ index .Data.data "public_key" }}
|
{{ index .Data.data "public_key" }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
vault.hashicorp.com/agent-inject-secret-service-user: secrets/data/vault/common/django_auth
|
vault.hashicorp.com/agent-inject-secret-service-user: secrets/data/vault/common/django_auth
|
||||||
|
|||||||
243
apps/django/uralkal/activities-tasks-configmap.yaml
Normal file
243
apps/django/uralkal/activities-tasks-configmap.yaml
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: activities-tasks-configmap
|
||||||
|
namespace: django
|
||||||
|
data:
|
||||||
|
tasks.py: |
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
from enum import Enum
|
||||||
|
from typing import Optional, Dict, Any, Union
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
from config.celery import app
|
||||||
|
from sarex.activities.choices import ACTION_CHOICES
|
||||||
|
from sarex.activities.models import Action
|
||||||
|
from sarex.services import services
|
||||||
|
from sarex.services.gateway.intefaces import SystemLogInterface
|
||||||
|
|
||||||
|
User = get_user_model()
|
||||||
|
|
||||||
|
|
||||||
|
class MethodEnum(str, Enum):
|
||||||
|
get = 'GET'
|
||||||
|
post = 'POST'
|
||||||
|
put = "PUT"
|
||||||
|
patch = "PATCH"
|
||||||
|
delete = "DELETE"
|
||||||
|
|
||||||
|
|
||||||
|
class ActionInterface(BaseModel):
|
||||||
|
method: MethodEnum
|
||||||
|
timestamp: datetime
|
||||||
|
uri: str
|
||||||
|
verbose_name: Optional[Any] = None
|
||||||
|
model_name: Optional[str] = None
|
||||||
|
status_code: int
|
||||||
|
succeded: bool
|
||||||
|
ip_address: str
|
||||||
|
user_id: Optional[int] = None
|
||||||
|
id: Optional[Union[int, str]] = None
|
||||||
|
modified: bool
|
||||||
|
request_body: Optional[dict | list] = None
|
||||||
|
response_body: Optional[Dict] = None
|
||||||
|
|
||||||
|
|
||||||
|
def validate_action(message: Dict) -> ActionInterface:
|
||||||
|
return ActionInterface(**message)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_systemlog(message: Dict) -> SystemLogInterface:
|
||||||
|
return SystemLogInterface(**message)
|
||||||
|
|
||||||
|
|
||||||
|
def convert_uuids_to_str(data: Union[dict, list]) -> Union[dict, list]:
|
||||||
|
if isinstance(data, dict):
|
||||||
|
for key, value in data.items():
|
||||||
|
if isinstance(value, uuid.UUID):
|
||||||
|
data[key] = str(value)
|
||||||
|
elif isinstance(value, (dict, list)):
|
||||||
|
convert_uuids_to_str(value)
|
||||||
|
elif isinstance(data, list):
|
||||||
|
for index, item in enumerate(data):
|
||||||
|
if isinstance(item, uuid.UUID):
|
||||||
|
data[index] = str(item)
|
||||||
|
elif isinstance(item, (dict, list)):
|
||||||
|
convert_uuids_to_str(item)
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
@app.task(name="send_to_django_action")
|
||||||
|
def send_to_django_action(message: Dict) -> None:
|
||||||
|
action_data = validate_action(message)
|
||||||
|
|
||||||
|
if action_data.method == "POST":
|
||||||
|
action_type = ACTION_CHOICES.create
|
||||||
|
action_type_name = "создано"
|
||||||
|
elif action_data.method in ("PUT", "PATCH"):
|
||||||
|
action_type = ACTION_CHOICES.update
|
||||||
|
action_type_name = "изменено"
|
||||||
|
elif action_data.method == "DELETE":
|
||||||
|
action_type = ACTION_CHOICES.delete
|
||||||
|
action_type_name = "удалено"
|
||||||
|
elif action_data.uri == "/api/login/" or action_data.uri.startswith("/api/token"):
|
||||||
|
action_type = ACTION_CHOICES.auth
|
||||||
|
action_type_name = 'Успешно авторизовался'
|
||||||
|
|
||||||
|
if action_data.succeded:
|
||||||
|
action_data.verbose_name = 'Успешно авторизовался'
|
||||||
|
else:
|
||||||
|
action_data.verbose_name = 'Попытался авторизоваться'
|
||||||
|
else:
|
||||||
|
action_type = ACTION_CHOICES.undefined
|
||||||
|
action_type_name = ""
|
||||||
|
|
||||||
|
if not action_data.user_id:
|
||||||
|
action_data.user_id = User.objects.get(username='AnonymousUser').id
|
||||||
|
|
||||||
|
if action_data.model_name:
|
||||||
|
try:
|
||||||
|
target_content_type = ContentType.objects.get(model=action_data.model_name.lower())
|
||||||
|
target_object_id = action_data.id
|
||||||
|
except ContentType.DoesNotExist:
|
||||||
|
target_content_type = None
|
||||||
|
target_object_id = None
|
||||||
|
else:
|
||||||
|
target_content_type = None
|
||||||
|
target_object_id = None
|
||||||
|
if action_data.id:
|
||||||
|
msg = f"{action_type_name} {action_data.verbose_name}:{action_data.id}"
|
||||||
|
else:
|
||||||
|
msg = f"{action_data.verbose_name}: {action_data.user_id}"
|
||||||
|
|
||||||
|
if settings.SERVERSETTINGS.logingg_body_action:
|
||||||
|
request_body = convert_uuids_to_str(action_data.request_body)
|
||||||
|
response_body = convert_uuids_to_str(action_data.response_body)
|
||||||
|
else:
|
||||||
|
request_body = None
|
||||||
|
response_body = None
|
||||||
|
item = Action(
|
||||||
|
actor_id=action_data.user_id,
|
||||||
|
action_type=action_type,
|
||||||
|
verb=msg,
|
||||||
|
ip_address=action_data.ip_address,
|
||||||
|
succeded=action_data.modified,
|
||||||
|
timestamp=action_data.timestamp,
|
||||||
|
target_content_type=target_content_type,
|
||||||
|
target_object_id=target_object_id,
|
||||||
|
data={
|
||||||
|
"uri": action_data.uri,
|
||||||
|
"request_body": request_body,
|
||||||
|
"response_body": response_body,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
item.save()
|
||||||
|
|
||||||
|
if settings.SERVERSETTINGS.changelog_rotation:
|
||||||
|
now = datetime.now() - timedelta(days=settings.SERVERSETTINGS.changelog_period_in_days)
|
||||||
|
Action.objects.filter(timestamp__lte=now).delete()
|
||||||
|
|
||||||
|
|
||||||
|
@app.task(name="send_to_system_log")
|
||||||
|
def send_to_system_log(message: Dict) -> None:
|
||||||
|
action_data = validate_action(message)
|
||||||
|
multiple_deletion_entity = []
|
||||||
|
is_admin_request = False
|
||||||
|
|
||||||
|
if settings.SERVERSETTINGS.donstroi_style:
|
||||||
|
is_admin_request = "/admin/" in action_data.uri
|
||||||
|
|
||||||
|
if action_data.method == "POST":
|
||||||
|
if is_admin_request and "/change/" in action_data.uri:
|
||||||
|
action_type = "update"
|
||||||
|
action_type_name = "изменено"
|
||||||
|
|
||||||
|
elif (is_admin_request and action_data.response_body is not None
|
||||||
|
and "delete_selected" in action_data.response_body.get("action", [])):
|
||||||
|
|
||||||
|
multiple_deletion_entity.extend(action_data.response_body.get('_selected_action', []))
|
||||||
|
action_type = "delete"
|
||||||
|
action_type_name = "удалено"
|
||||||
|
|
||||||
|
elif is_admin_request and "/delete/" in action_data.uri:
|
||||||
|
action_type = "delete"
|
||||||
|
action_type_name = "удалено"
|
||||||
|
else:
|
||||||
|
action_type = "create"
|
||||||
|
action_type_name = "создано"
|
||||||
|
|
||||||
|
elif action_data.method in ("PUT", "PATCH"):
|
||||||
|
action_type = "update"
|
||||||
|
action_type_name = "изменено"
|
||||||
|
elif action_data.method == "DELETE":
|
||||||
|
action_type = "delete"
|
||||||
|
action_type_name = "удалено"
|
||||||
|
elif action_data.uri == "/api/login/":
|
||||||
|
action_type = "auth"
|
||||||
|
action_type_name = 'Успешно авторизовался'
|
||||||
|
|
||||||
|
if action_data.succeded:
|
||||||
|
action_data.verbose_name = 'Успешно авторизовался'
|
||||||
|
else:
|
||||||
|
action_data.verbose_name = 'Попытался авторизоваться'
|
||||||
|
else:
|
||||||
|
action_type = "undefined"
|
||||||
|
action_type_name = ""
|
||||||
|
|
||||||
|
if action_data.id:
|
||||||
|
msg = f"{action_type_name} {action_data.verbose_name}:{action_data.id}"
|
||||||
|
elif settings.SERVERSETTINGS.donstroi_style and multiple_deletion_entity:
|
||||||
|
str_ids_delete_entitys = " ".join(multiple_deletion_entity)
|
||||||
|
msg = f"{action_type_name} {action_data.verbose_name}:{str_ids_delete_entitys}"
|
||||||
|
else:
|
||||||
|
msg = f"{action_data.verbose_name}: {action_data.user_id}"
|
||||||
|
|
||||||
|
if action_data.id and action_data.id.isdigit():
|
||||||
|
instance_id_filed = "instance_id"
|
||||||
|
else:
|
||||||
|
instance_id_filed = "instance_uuid"
|
||||||
|
|
||||||
|
if action_data.succeded:
|
||||||
|
status = "successful"
|
||||||
|
else:
|
||||||
|
status = "unsuccessful"
|
||||||
|
|
||||||
|
timestamp_iso = action_data.timestamp.isoformat()
|
||||||
|
formatted_timestamp = datetime.strptime(timestamp_iso, '%Y-%m-%dT%H:%M:%S.%f').strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
|
||||||
|
metadata = {
|
||||||
|
"id": action_data.id,
|
||||||
|
"model_name": action_data.model_name,
|
||||||
|
"ip_address": action_data.ip_address,
|
||||||
|
"instance_id_filed": action_data.id,
|
||||||
|
}
|
||||||
|
if settings.SERVERSETTINGS.donstroi_style and is_admin_request:
|
||||||
|
metadata['from_admin_panel'] = True
|
||||||
|
if not settings.SERVERSETTINGS.logingg_body_action:
|
||||||
|
metadata['request_body'] = action_data.request_body
|
||||||
|
metadata['response_body'] = action_data.response_body
|
||||||
|
|
||||||
|
if action_data.model_name:
|
||||||
|
action_data.model_name = action_data.model_name.lower()
|
||||||
|
|
||||||
|
system_log_data = validate_systemlog(
|
||||||
|
{
|
||||||
|
"actor_id": action_data.user_id,
|
||||||
|
"event_name": action_type,
|
||||||
|
"model_name": action_data.model_name,
|
||||||
|
instance_id_filed: action_data.id,
|
||||||
|
"registered_at": formatted_timestamp,
|
||||||
|
"metadata": metadata,
|
||||||
|
"message": msg,
|
||||||
|
"status": status,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
services.gateway.send_system_log(system_log_data)
|
||||||
@ -8,11 +8,58 @@ spec:
|
|||||||
values:
|
values:
|
||||||
services:
|
services:
|
||||||
backend:
|
backend:
|
||||||
|
image:
|
||||||
|
name:
|
||||||
|
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_6f5ad8ab
|
||||||
deployment:
|
deployment:
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: null
|
cpu: null
|
||||||
memory: null
|
memory: null
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- name: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: uwsgi-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/uwsgi.ini
|
||||||
|
subPath:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: uwsgi-configmap
|
||||||
|
items:
|
||||||
|
- key: uwsgi.ini
|
||||||
|
path:
|
||||||
|
_default: uwsgi.ini
|
||||||
|
- name: activities-tasks
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/sarex/activities/tasks.py
|
||||||
|
subPath:
|
||||||
|
_default: tasks.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: activities-tasks-configmap
|
||||||
|
items:
|
||||||
|
- key: tasks.py
|
||||||
|
path:
|
||||||
|
_default: tasks.py
|
||||||
envs:
|
envs:
|
||||||
- name: DJANGO_HOST
|
- name: DJANGO_HOST
|
||||||
value:
|
value:
|
||||||
@ -23,7 +70,7 @@ spec:
|
|||||||
_default: "*"
|
_default: "*"
|
||||||
- name: SERVER_USE_CHANGELOG
|
- name: SERVER_USE_CHANGELOG
|
||||||
value:
|
value:
|
||||||
_default: "0"
|
_default: "True"
|
||||||
- name: SERVER_ZITADEL_ENABLED
|
- name: SERVER_ZITADEL_ENABLED
|
||||||
value:
|
value:
|
||||||
_default: "True"
|
_default: "True"
|
||||||
@ -36,6 +83,12 @@ spec:
|
|||||||
- name: CELERY_REDIS_PORT
|
- name: CELERY_REDIS_PORT
|
||||||
value:
|
value:
|
||||||
_default: "6379"
|
_default: "6379"
|
||||||
|
- name: CACHE_HOST
|
||||||
|
value:
|
||||||
|
_default: redis
|
||||||
|
- name: CACHE_PORT
|
||||||
|
value:
|
||||||
|
_default: "6379"
|
||||||
- name: DJANGO_REDIS_HOST
|
- name: DJANGO_REDIS_HOST
|
||||||
value:
|
value:
|
||||||
_default: redis
|
_default: redis
|
||||||
@ -63,6 +116,9 @@ spec:
|
|||||||
- name: KC_SYNC_ENABLE
|
- name: KC_SYNC_ENABLE
|
||||||
value:
|
value:
|
||||||
_default: "0"
|
_default: "0"
|
||||||
|
- name: GATEWAY_HOST
|
||||||
|
value:
|
||||||
|
_default: http://pdm-svc.documentations.svc.cluster.local
|
||||||
- name: MEASUREMENTS_HOST
|
- name: MEASUREMENTS_HOST
|
||||||
value:
|
value:
|
||||||
_default: http://measurements-service.measurements.svc.cluster.local:8000/api
|
_default: http://measurements-service.measurements.svc.cluster.local:8000/api
|
||||||
@ -111,6 +167,18 @@ spec:
|
|||||||
- name: SERVER_CHANGELOG_MODE
|
- name: SERVER_CHANGELOG_MODE
|
||||||
value:
|
value:
|
||||||
_default: "0"
|
_default: "0"
|
||||||
|
- name: SERVER_CHANGELOG_MODE_CELERY
|
||||||
|
value:
|
||||||
|
_default: "True"
|
||||||
|
- name: SERVER_CHANGELOG_ROTATION
|
||||||
|
value:
|
||||||
|
_default: "True"
|
||||||
|
- name: SERVER_LOGINGG_BODY_ACTION
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_CHANGELOG_PERIOD_IN_DAYS
|
||||||
|
value:
|
||||||
|
_default: "14"
|
||||||
- name: SERVER_DJANGO_URLS
|
- name: SERVER_DJANGO_URLS
|
||||||
value:
|
value:
|
||||||
_default: "1"
|
_default: "1"
|
||||||
|
|||||||
@ -13,3 +13,178 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
cpu: null
|
cpu: null
|
||||||
memory: null
|
memory: null
|
||||||
|
volumes:
|
||||||
|
_default:
|
||||||
|
- name: django-configmap
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/config/settings/production.py
|
||||||
|
subPath:
|
||||||
|
_default: production.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: django-configmap
|
||||||
|
items:
|
||||||
|
- key: production.py
|
||||||
|
path:
|
||||||
|
_default: production.py
|
||||||
|
- name: activities-tasks
|
||||||
|
mountPath:
|
||||||
|
_default: /opt/sarex/sarex/activities/tasks.py
|
||||||
|
subPath:
|
||||||
|
_default: tasks.py
|
||||||
|
readOnly:
|
||||||
|
_default: true
|
||||||
|
configMap:
|
||||||
|
name:
|
||||||
|
_default: activities-tasks-configmap
|
||||||
|
items:
|
||||||
|
- key: tasks.py
|
||||||
|
path:
|
||||||
|
_default: tasks.py
|
||||||
|
envs:
|
||||||
|
- name: ALLOWED_HOSTS
|
||||||
|
value:
|
||||||
|
_default: "*"
|
||||||
|
- name: SERVER_USE_CHANGELOG
|
||||||
|
value:
|
||||||
|
_default: "True"
|
||||||
|
- name: SERVER_ZITADEL_ENABLED
|
||||||
|
value:
|
||||||
|
_default: "False"
|
||||||
|
- name: DJANGO_SETTINGS_MODULE
|
||||||
|
value:
|
||||||
|
_default: config.settings.production
|
||||||
|
- name: CELERY_REDIS_HOST
|
||||||
|
value:
|
||||||
|
_default: redis
|
||||||
|
- name: CELERY_REDIS_PORT
|
||||||
|
value:
|
||||||
|
_default: "6379"
|
||||||
|
- name: CACHE_HOST
|
||||||
|
value:
|
||||||
|
_default: redis
|
||||||
|
- name: CACHE_PORT
|
||||||
|
value:
|
||||||
|
_default: "6379"
|
||||||
|
- name: DJANGO_REDIS_HOST
|
||||||
|
value:
|
||||||
|
_default: redis
|
||||||
|
- name: DJANGO_REDIS_PORT
|
||||||
|
value:
|
||||||
|
_default: "6379"
|
||||||
|
- name: BIMV2_INTERNAL_HOST
|
||||||
|
value:
|
||||||
|
_default: http://bim-backend-v2-service.bim-api
|
||||||
|
- name: BIMV2_TIMEOUT
|
||||||
|
value:
|
||||||
|
_default: "60"
|
||||||
|
- name: JWT_KID
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: PDM_SYNC
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: KC_SYNC_ENABLE
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: GATEWAY_HOST
|
||||||
|
value:
|
||||||
|
_default: http://pdm-svc.documentations.svc.cluster.local
|
||||||
|
- name: MEASUREMENTS_HOST
|
||||||
|
value:
|
||||||
|
_default: http://measurements-service.measurements.svc.cluster.local:8000/api
|
||||||
|
- name: MEASUREMENTS_USE_MEASUREMENTS
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_API_HOST
|
||||||
|
value:
|
||||||
|
_default: https://sarex.local.uralkali.com
|
||||||
|
- name: SERVER_HOST
|
||||||
|
value:
|
||||||
|
_default: https://sarex.local.uralkali.com
|
||||||
|
- name: WORKFLOWS_HOST
|
||||||
|
value:
|
||||||
|
_default: http://backend-svc.processing.svc.cluster.local:80
|
||||||
|
- name: WORKFLOWS_BASE_HOST
|
||||||
|
value:
|
||||||
|
_default: http://backend-svc.django.svc.cluster.local:80
|
||||||
|
- name: WORKFLOWS_PREFIX
|
||||||
|
value:
|
||||||
|
_default: /internal/v1
|
||||||
|
- name: WORKFLOWS_USE
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_S3_STREAM_IMPORT
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_SAVE_DIFF_DEM
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_USE_CLICKHOUSE
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_USE_CREATE_COMPARED_GEOTIFF_TASK
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_USE_DJANGO_STORAGE
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_USE_METASHAPE
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_CHANGELOG_MODE_SYSTEM_LOG
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_CHANGELOG_MODE
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_CHANGELOG_MODE_CELERY
|
||||||
|
value:
|
||||||
|
_default: "True"
|
||||||
|
- name: SERVER_CHANGELOG_ROTATION
|
||||||
|
value:
|
||||||
|
_default: "True"
|
||||||
|
- name: SERVER_LOGINGG_BODY_ACTION
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_CHANGELOG_PERIOD_IN_DAYS
|
||||||
|
value:
|
||||||
|
_default: "14"
|
||||||
|
- name: SERVER_DJANGO_URLS
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: CHECK_IMPORT_HASH
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: EAV_ENABLE
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_CHECK_IMPORT_HASH
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: SERVER_CHUNKED_PATH
|
||||||
|
value:
|
||||||
|
_default: /tmp/chunked_uploads/%Y/%m/%d
|
||||||
|
- name: SERVER_HIDE_USER_SCROLL_PERMISSIONS
|
||||||
|
value:
|
||||||
|
_default: "0"
|
||||||
|
- name: SERVER_USE_WRORKFLOW_STATUS
|
||||||
|
value:
|
||||||
|
_default: "1"
|
||||||
|
- name: ZITADEL_HOST
|
||||||
|
value:
|
||||||
|
_default: https://login.sarex.local.uralkali.com
|
||||||
|
- name: SERVER_KAFKA_ENABLED
|
||||||
|
value:
|
||||||
|
_default: "False"
|
||||||
|
- name: KAFKA_TOPICS
|
||||||
|
value:
|
||||||
|
_default: '{"planning": "message-hub-stage", "ams-sync": "ams-sync"}'
|
||||||
|
- name: KAFKA_SSL_CAFILE
|
||||||
|
value:
|
||||||
|
_default: /usr/local/share/ca-certificates/kafka.crt
|
||||||
|
- name: KC_USE_REDIRECT_LOGOUT
|
||||||
|
value:
|
||||||
|
_default: "False"
|
||||||
|
|||||||
341
apps/django/uralkal/django-configmap.yaml
Normal file
341
apps/django/uralkal/django-configmap.yaml
Normal file
@ -0,0 +1,341 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: django-configmap
|
||||||
|
namespace: django
|
||||||
|
data:
|
||||||
|
production.py: |
|
||||||
|
import ast
|
||||||
|
import os
|
||||||
|
from .base import *
|
||||||
|
from logging.handlers import SysLogHandler
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
|
def _load_env_file(path):
|
||||||
|
try:
|
||||||
|
with open(path, "r", encoding="utf-8") as f:
|
||||||
|
for raw_line in f:
|
||||||
|
line = raw_line.strip()
|
||||||
|
if not line or line.startswith("#") or "=" not in line:
|
||||||
|
continue
|
||||||
|
key, value = line.split("=", 1)
|
||||||
|
key = key.strip()
|
||||||
|
value = value.strip()
|
||||||
|
if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):
|
||||||
|
try:
|
||||||
|
value = ast.literal_eval(value)
|
||||||
|
except (ValueError, SyntaxError):
|
||||||
|
value = value[1:-1]
|
||||||
|
if key and key not in os.environ:
|
||||||
|
os.environ[key] = value
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _read_secret_file(path, default=""):
|
||||||
|
try:
|
||||||
|
with open(path, "r", encoding="utf-8") as f:
|
||||||
|
return f.read().strip()
|
||||||
|
except FileNotFoundError:
|
||||||
|
return default
|
||||||
|
|
||||||
|
# Fallback for manage.py launched via `kubectl exec` (outside entrypoint),
|
||||||
|
# so Django can still read DB/JWT values from Vault-injected files.
|
||||||
|
_load_env_file("/vault/secrets/django-postgresql")
|
||||||
|
_load_env_file("/vault/secrets/django-rabbitmq")
|
||||||
|
_load_env_file("/vault/secrets/django-s3")
|
||||||
|
_load_env_file("/vault/secrets/django-kafka")
|
||||||
|
_load_env_file("/vault/secrets/django-common")
|
||||||
|
|
||||||
|
if not os.environ.get("JWT_PRIVATE_KEY"):
|
||||||
|
os.environ["JWT_PRIVATE_KEY"] = _read_secret_file("/vault/secrets/django-jwt-private")
|
||||||
|
if not os.environ.get("JWT_PUBLIC_KEY"):
|
||||||
|
os.environ["JWT_PUBLIC_KEY"] = _read_secret_file("/vault/secrets/django-jwt-public")
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
FILE_UPLOAD_PERMISSIONS = 0o644
|
||||||
|
DEBUG = False
|
||||||
|
CSRF_COOKIE_SECURE = True
|
||||||
|
CSRF_TRUSTED_ORIGINS = ["https://sarex.contour.infra.sarex.tech", "http://sarex.contour.infra.sarex.tech"]
|
||||||
|
SESSION_COOKIE_SECURE = True
|
||||||
|
SECURE_SSL_REDIRECT = False
|
||||||
|
|
||||||
|
SECRET_KEY = 't2=9+($2f%7ptsdy4!rby$)mcfl1l%o2e@vs^d(g&(wwi&%k1v'
|
||||||
|
|
||||||
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
SERVERSETTINGS.cache_enabled = True
|
||||||
|
INSTALLED_APPS = list(INSTALLED_APPS) + ['corsheaders']
|
||||||
|
|
||||||
|
CORS_ALLOW_METHODS = (
|
||||||
|
'DELETE',
|
||||||
|
'GET',
|
||||||
|
'OPTIONS',
|
||||||
|
'PATCH',
|
||||||
|
'POST',
|
||||||
|
'PUT',
|
||||||
|
)
|
||||||
|
BASIC_USER_ID = 2
|
||||||
|
|
||||||
|
CORS_ALLOW_HEADERS = (
|
||||||
|
'accept',
|
||||||
|
'accept-encoding',
|
||||||
|
'authorization',
|
||||||
|
'content-type',
|
||||||
|
'user-agent',
|
||||||
|
'x-csrftoken',
|
||||||
|
'x-requested-with',
|
||||||
|
'x-token',
|
||||||
|
'Bearer',
|
||||||
|
)
|
||||||
|
|
||||||
|
HOST = os.environ.get("DJANGO_HOST", "https://sarex.contour.infra.sarex.tech")
|
||||||
|
|
||||||
|
POSTGRES_DATABASE = os.environ.get('DJANGO_POSTGRES_DATABASE')
|
||||||
|
POSTGRES_USER = os.environ.get('DJANGO_POSTGRES_USER')
|
||||||
|
POSTGRES_PASSWORD = os.environ.get('DJANGO_POSTGRES_PASSWORD')
|
||||||
|
POSTGRES_HOST = os.environ.get('DJANGO_POSTGRES_HOST')
|
||||||
|
POSTGRES_PORTS = os.environ.get('DJANGO_POSTGRES_PORTS', "5432")
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django_prometheus.db.backends.postgresql',
|
||||||
|
'NAME': POSTGRES_DATABASE,
|
||||||
|
'USER': POSTGRES_USER,
|
||||||
|
'PASSWORD': POSTGRES_PASSWORD,
|
||||||
|
'HOST': POSTGRES_HOST,
|
||||||
|
'PORT': POSTGRES_PORTS,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MEASUREMENTSETTINGS = MeasurementSettings()
|
||||||
|
WORKFLOWSSETTINGS = WorkFlowsSettings()
|
||||||
|
S3SETTINGS = S3Settings()
|
||||||
|
GATEWAYSETTINGS = GateWaySetttings()
|
||||||
|
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'filters': {
|
||||||
|
'require_debug_false': {
|
||||||
|
'()': 'django.utils.log.RequireDebugFalse',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'formatters': {
|
||||||
|
'verbose': {
|
||||||
|
'format': '[contactor] %(levelname)s %(asctime)s %(message)s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'handlers': {
|
||||||
|
'console': {
|
||||||
|
'level': 'DEBUG',
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
|
'sentry': {
|
||||||
|
'level': 'ERROR',
|
||||||
|
'filters': ['require_debug_false'],
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'': {
|
||||||
|
'handlers': ['console', 'sentry'],
|
||||||
|
'level': 'INFO',
|
||||||
|
'propagate': False,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
COMPARATOR_JWT = os.environ.get("COMPARATOR_JWT", "default_jwt")
|
||||||
|
COMPARATOR_URL = os.environ.get("COMPARATOR_URL", "https://wb.sarex.io/comparator")
|
||||||
|
COMPARATOR_SECTION = os.environ.get("COMPARATOR_SECTION", "sarex-production-storage")
|
||||||
|
|
||||||
|
SIMPLE_JWT = {
|
||||||
|
'ACCESS_TOKEN_LIFETIME': timedelta(hours=1),
|
||||||
|
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
|
||||||
|
'ROTATE_REFRESH_TOKENS': False,
|
||||||
|
'BLACKLIST_AFTER_ROTATION': True,
|
||||||
|
'UPDATE_LAST_LOGIN': False,
|
||||||
|
'ALGORITHM': 'RS512',
|
||||||
|
'SIGNING_KEY': os.environ.get("JWT_PRIVATE_KEY", "").replace("\\n", "\n"),
|
||||||
|
'VERIFYING_KEY': os.environ.get("JWT_PUBLIC_KEY", "").replace("\\n", "\n"),
|
||||||
|
'AUDIENCE': None,
|
||||||
|
'ISSUER': os.environ.get('SIMPLE_JWT_ISSUER', 'default_issuer'),
|
||||||
|
'AUTH_HEADER_TYPES': ('Bearer',),
|
||||||
|
'AUTH_HEADER_NAME': 'HTTP_AUTHORIZATION',
|
||||||
|
'USER_ID_FIELD': 'id',
|
||||||
|
'USER_ID_CLAIM': 'user_id',
|
||||||
|
'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken',),
|
||||||
|
'TOKEN_TYPE_CLAIM': 'token_type',
|
||||||
|
'JTI_CLAIM': 'jti',
|
||||||
|
'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp',
|
||||||
|
'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5),
|
||||||
|
'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1),
|
||||||
|
}
|
||||||
|
|
||||||
|
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
|
||||||
|
DEFAULT_FILE_STORAGE = 'sarex.core.storages.CustomS3Boto3Storage'
|
||||||
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 268435456
|
||||||
|
|
||||||
|
if not os.environ.get('ISOLATED', False):
|
||||||
|
import sentry_sdk
|
||||||
|
from sentry_sdk.integrations.django import DjangoIntegration
|
||||||
|
|
||||||
|
sentry_sdk.init(
|
||||||
|
dsn="https://3df2f4b8d3d14595a06c92e9d7c562cb@sentry.io/1501541",
|
||||||
|
integrations=[DjangoIntegration()],
|
||||||
|
environment=os.environ.get('SENTRY_ENVIRONMENT', 'production'),
|
||||||
|
send_default_pii=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
COMPARISON_API_URL = f"{os.environ.get('WORKFLOWSSETTINGS_HOST')}/comparisons"
|
||||||
|
DOCUMENTATION_API_URL = f"{os.environ.get('WORKFLOWSSETTINGS_HOST')}/documentations"
|
||||||
|
PDM_FILES_API_URL = f"{os.environ.get('WORKFLOWSSETTINGS_HOST')}/files"
|
||||||
|
|
||||||
|
WORKFLOWS_TASKS = {
|
||||||
|
"update_orthomosaic_data": {
|
||||||
|
"image": f"{os.environ.get('WORKFLOWSSETTINGS_REGISTRY')}/update-orthomosaic-data:dev",
|
||||||
|
"service_requests": ["django-auth"],
|
||||||
|
"backoff_limit": 3,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': (
|
||||||
|
'rest_framework.pagination.LimitOffsetPagination' ),
|
||||||
|
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
|
||||||
|
'PAGE_SIZE': 1000, 'DEFAULT_FILTER_BACKENDS': [
|
||||||
|
'django_filters.rest_framework.DjangoFilterBackend' ],
|
||||||
|
'DEFAULT_AUTHENTICATION_CLASSES': [
|
||||||
|
'sarex.authentication.backends.ZitadelJWTAuthentication',
|
||||||
|
'rest_framework.authentication.RemoteUserAuthentication',
|
||||||
|
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
||||||
|
'rest_framework.authentication.BasicAuthentication',
|
||||||
|
'rest_framework.authentication.SessionAuthentication',
|
||||||
|
'sarex.authentication.backends.JWTAuthentication' ],
|
||||||
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
|
'rest_framework.permissions.IsAuthenticated', ] }
|
||||||
|
|
||||||
|
AUTHENTICATION_BACKENDS = [
|
||||||
|
'sarex.authentication.backends.CustomRemoteUserBackend',
|
||||||
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
|
'guardian.backends.ObjectPermissionBackend',
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE = [
|
||||||
|
'django_prometheus.middleware.PrometheusBeforeMiddleware',
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
#'django_keycloak.middlewares.AuthorizationHeaderMiddleware',
|
||||||
|
#'django_keycloak.middlewares.KeycloakSessionMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
#'django.contrib.auth.middleware.RemoteUserMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'django_user_agents.middleware.UserAgentMiddleware',
|
||||||
|
'simple_history.middleware.HistoryRequestMiddleware',
|
||||||
|
'sarex.activities.middlewares.ActivityMiddleware',
|
||||||
|
'django_prometheus.middleware.PrometheusAfterMiddleware', ]
|
||||||
|
|
||||||
|
|
||||||
|
class KeyCloakSettings(BaseSettings):
|
||||||
|
client_id: str = "client_id"
|
||||||
|
client_secret: str = "client_secret"
|
||||||
|
discovery_url: str = "https://login.wb.sarex.io/realms/sarex/.well-known/openid-configuration"
|
||||||
|
staff: Optional[str] = "Sarex staff"
|
||||||
|
superuser: Optional[str] = "Sarex superusers"
|
||||||
|
sync_with_django: bool = True
|
||||||
|
sync_admin: bool = False
|
||||||
|
group_prefix: str = 'Sarex-Role'
|
||||||
|
company_prefix: str = 'Sarex-Company'
|
||||||
|
department_prefix: str = 'Sarex-Department'
|
||||||
|
position_prefix: str = 'Sarex-Position'
|
||||||
|
separator: str = '__'
|
||||||
|
sync_user_groups: bool = False
|
||||||
|
sync_user_positions: bool = False
|
||||||
|
sync_user_departments: bool = False
|
||||||
|
sync_user_companies: bool = False
|
||||||
|
use_redirect_logout: bool = False
|
||||||
|
logout_redirect_uri: str = "/"
|
||||||
|
default_group_name: Optional[str] = 'Тест'
|
||||||
|
default_company_name: Optional[str] = 'Брусника'
|
||||||
|
trusted_uri: List[str] = ['/api/core/orthophotos/', '/api/token', '/api/token/me']
|
||||||
|
trusted_uri: List[str] = []
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
env_prefix = "KC_"
|
||||||
|
|
||||||
|
|
||||||
|
KEYCLOAKSETTINGS = KeyCloakSettings()
|
||||||
|
|
||||||
|
REMOTE_USER_DEFAULT_COMPANY_ID = 1
|
||||||
|
SAREX_MODULES = [
|
||||||
|
{
|
||||||
|
"name": "Замечания",
|
||||||
|
"uri": "/remarks"
|
||||||
|
},
|
||||||
|
# {
|
||||||
|
# "name": "Управление проектами",
|
||||||
|
# "uri": "/management/projects",
|
||||||
|
# },
|
||||||
|
{
|
||||||
|
"name": "Замечания V2",
|
||||||
|
"uri": "/issues"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Документация",
|
||||||
|
"uri": "/documentations",
|
||||||
|
},
|
||||||
|
# {
|
||||||
|
# "name": "Согласование документов",
|
||||||
|
# "uri": "/reviews"
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "name": "Рабочие процессы",
|
||||||
|
# "uri": "/processes"
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "name": "Запросы",
|
||||||
|
# "uri": "/rfi"
|
||||||
|
# z},
|
||||||
|
# {
|
||||||
|
# "name": "Аналитика",
|
||||||
|
# "uri": "/analytics"
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "name": "Управление проектами",
|
||||||
|
# "uri": "/management/projects"
|
||||||
|
# },
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Справочники",
|
||||||
|
"uri": "/assets"
|
||||||
|
},
|
||||||
|
|
||||||
|
# {
|
||||||
|
# "name": "Обзор",
|
||||||
|
# "uri": "/projects"
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "name": "Передача документации",
|
||||||
|
# "uri": "/transmittal"
|
||||||
|
# },
|
||||||
|
]
|
||||||
|
AUTH_SETTINGS = {
|
||||||
|
"refresh_token": False,
|
||||||
|
"refresh_token_uri": "/api/token/me",
|
||||||
|
"refresh_oauth_token": True,
|
||||||
|
"refresh_oauth_token_uri": "/oauth/token",
|
||||||
|
"refresh_time": 240,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DEBUG=True
|
||||||
|
WEB_APP_AUTH_MODE='jwt-session-based'
|
||||||
|
|
||||||
|
|
||||||
|
SAREX_MODULES_SETTINGS = {
|
||||||
|
"aero": {
|
||||||
|
"enable_new_media": True
|
||||||
|
},
|
||||||
|
"sso_logout_redirect": True
|
||||||
|
}
|
||||||
@ -7,7 +7,12 @@ resources:
|
|||||||
- zitadel-action-configmap.yaml
|
- zitadel-action-configmap.yaml
|
||||||
- zitadel-action-job.yaml
|
- zitadel-action-job.yaml
|
||||||
- upload-oblako-job.yaml
|
- upload-oblako-job.yaml
|
||||||
|
- activities-tasks-configmap.yaml
|
||||||
patches:
|
patches:
|
||||||
|
- path: django-configmap.yaml
|
||||||
|
target:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: django-configmap
|
||||||
- path: nginx-configmap.yaml
|
- path: nginx-configmap.yaml
|
||||||
target:
|
target:
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|||||||
@ -36,7 +36,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_7d0ec48b
|
_default: cr.yandex/crp3ccidau046kdj8g9q/backend:production_6f5ad8ab
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:contour_5.22.3
|
_default: cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:contour_5.43.0
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ spec:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
name:
|
name:
|
||||||
_default: cr.yandex/crp3ccidau046kdj8g9q/srx-admin:prod_ee0a6717
|
_default: cr.yandex/crp3ccidau046kdj8g9q/srx-admin:prod_de4fb6d8
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
_default: IfNotPresent
|
_default: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@ -1,124 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: postgresql
|
|
||||||
namespace: django
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
timeout: 2h
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: postgresql-contour
|
|
||||||
version: "13.0.15"
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: yc-oci-charts
|
|
||||||
namespace: flux-system
|
|
||||||
|
|
||||||
install:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
timeout: 2h
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
values:
|
|
||||||
global:
|
|
||||||
security:
|
|
||||||
allowInsecureImages: true
|
|
||||||
defaultStorageClass: local-path
|
|
||||||
postgresql:
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
auth:
|
|
||||||
username: ""
|
|
||||||
database: ""
|
|
||||||
secretKeys:
|
|
||||||
userPasswordKey: "postgres-password"
|
|
||||||
image:
|
|
||||||
registry: cr.yandex/crp3ccidau046kdj8g9q
|
|
||||||
repository: contour/postgresql
|
|
||||||
tag: 13.0.15
|
|
||||||
pullPolicy: Always
|
|
||||||
metrics:
|
|
||||||
enabled: false
|
|
||||||
prometheusRule:
|
|
||||||
enabled: false
|
|
||||||
primary:
|
|
||||||
containerSecurityContext:
|
|
||||||
readOnlyRootFilesystem: false
|
|
||||||
persistence:
|
|
||||||
storageClass: local-path
|
|
||||||
size: 20Gi
|
|
||||||
customLivenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customReadinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
customStartupProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- exec pg_isready -U "postgres" -d postgres -h 127.0.0.1 -p 5432
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
successThreshold: 1
|
|
||||||
failureThreshold: 6
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
nodeSelector:
|
|
||||||
dedicated: db
|
|
||||||
tolerations:
|
|
||||||
- key: dedicated
|
|
||||||
operator: Equal
|
|
||||||
value: db
|
|
||||||
effect: NoSchedule
|
|
||||||
contour:
|
|
||||||
enabled: true
|
|
||||||
adminUser: "postgres"
|
|
||||||
sharedPreloadLibraries: ""
|
|
||||||
vault:
|
|
||||||
enabled: true
|
|
||||||
role: postgresql
|
|
||||||
authPath: auth/kubernetes
|
|
||||||
secretPath: secrets/data/postgresql/admin
|
|
||||||
secretKey: postgres-password
|
|
||||||
usersSecretPath: secrets/data/postgresql/users
|
|
||||||
databases:
|
|
||||||
- name: sarex_db
|
|
||||||
user: sarex
|
|
||||||
passwordKey: sarex
|
|
||||||
extensions:
|
|
||||||
- ltree
|
|
||||||
- pg_stat_statements
|
|
||||||
restoreFromDump: true
|
|
||||||
dumpKey: "sanitized_dumps_multi/sarex_db/288/sarex_db_company288_20260626T202844Z.tar.gz"
|
|
||||||
s3-proxy:
|
|
||||||
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
|
||||||
@ -63,7 +63,6 @@
|
|||||||
| `base` | kustomize (`Deployment` + `Service` + `Namespace`) | namespace `document-link` c `istio-injection: enabled`; `Deployment/frontend` |
|
| `base` | kustomize (`Deployment` + `Service` + `Namespace`) | namespace `document-link` c `istio-injection: enabled`; `Deployment/frontend` |
|
||||||
| `brusnika-stage` | FluxCD `HelmRelease` → `universal-chart` `0.1.7` | `replicaCount`: stage `1`; probes выключены |
|
| `brusnika-stage` | FluxCD `HelmRelease` → `universal-chart` `0.1.7` | `replicaCount`: stage `1`; probes выключены |
|
||||||
| `brusnika-prod` | FluxCD `HelmRelease` → `universal-chart` `0.1.7` | `replicaCount`: preprod/production `3`; probes выключены |
|
| `brusnika-prod` | FluxCD `HelmRelease` → `universal-chart` `0.1.7` | `replicaCount`: preprod/production `3`; probes выключены |
|
||||||
| `yc-k8s-test` | kustomize (`../base`) | тестовый контур |
|
|
||||||
|
|
||||||
Порты сервиса: в `universal-chart` — `service.port 8080` → `targetPort 3000` (`portName: http`); в `base/service.yaml` — `port 80` → `targetPort 80`.
|
Порты сервиса: в `universal-chart` — `service.port 8080` → `targetPort 3000` (`portName: http`); в `base/service.yaml` — `port 80` → `targetPort 80`.
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user