iac/apps/eav/ugok/backend.yaml
ivan 742a811313 ugok: rebuild all apps as standalone HelmReleases, drop vault-native base
Root cause: apps/*/ugok extended ../base via kustomize patches, but base
is vault-native (Vault Agent Injector annotations + serviceAccount +
command/args wrapper sourcing /vault/secrets/*). The Vault Agent Injector
webhook IS deployed cluster-wide in ugok (infrastructure/vault/ugok), so
it actually intercepted these pods — but no per-app Vault roles/secrets
were ever provisioned there, so every pod hung in Init.

Fix, mirrored from apps/*/wb (which never extends base for these apps):
rebuild every affected app as a standalone HelmRelease per service, with
no serviceAccount/podAnnotations override and no vault-sourcing wrapper
in command/args (dropped entirely, or replaced with the real functional
command where base's wrapper did double duty — e.g. celery invocations,
pm's `python manage.py migrate`, pdf-markings-amqp's `start-amqp-worker`).

Also recreates ConfigMaps that were referenced by name in volumes but
never actually captured into the repo (eav, subscriptions, pm, issues,
django) — copied verbatim from the cluster dump and verified byte-for-byte
against it.

Incidental bugs found and fixed along the way:
- message-hub was still extending base (missed in an earlier pass).
- system-log's patches targeted services.api/services.worker while base
  uses services.backend for both — would have produced duplicate
  Deployments per release, one of them permanently vault-broken.
- contracts' real container port is 8080, not base's default 8000.
- drawings' Service.targetPort (8000) didn't match the real containerPort
  (8080), breaking routing.
- inspections/ugok was missing entirely from this pass.

apps/documentations: intentionally left without a redis Deployment even
though VALKEY_ADDR now points at one — the cluster dump has no redis in
that namespace, so provisioning one is a scope decision, not a bug fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 01:22:21 +05:00

208 lines
5.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
# standalone HelmRelease по образцу apps/eav/wb/backend.yaml — base
# vault-native (secretEnvs через Vault Agent), а в ugok Vault вообще не
# используется ни одним приложением (см. apps/eav/wb — тот же принцип),
# поэтому не наследуем base, а собираем отдельный HelmRelease с обычными
# secretEnvs, без serviceAccount/podAnnotations/vault-обёртки в command/args.
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: backend
namespace: eav
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: 10.4.10.187:80/library/eav:prod_0dcebba6
pullPolicy:
_default: IfNotPresent
deployment:
enabled: true
name:
_default: backend
replicaCount:
_default: 1
port:
_default: 8000
resources:
requests:
cpu:
_default: 25m
memory:
_default: 100Mi
probes:
liveness:
enabled:
_default: true
type:
_default: tcpSocket
tcpSocket:
port:
_default: 8000
initialDelaySeconds:
_default: 20
periodSeconds:
_default: 30
timeoutSeconds:
_default: 3
failureThreshold:
_default: 5
readiness:
enabled:
_default: true
type:
_default: tcpSocket
tcpSocket:
port:
_default: 8000
initialDelaySeconds:
_default: 10
periodSeconds:
_default: 10
timeoutSeconds:
_default: 3
failureThreshold:
_default: 6
service:
enabled: true
name:
_default: backend-svc
type:
_default: ClusterIP
port:
_default: 80
targetPort:
_default: 8000
portName:
_default: http
imagePullSecrets:
enabled:
_default: true
name:
_default: regcred
volumes:
_default:
- name: django-configmap
mountPath:
_default: /server/config/settings/production.py
subPath:
_default: production.py
readOnly:
_default: true
configMap:
name:
_default: django-configmap
items:
- key: production.py
path:
_default: production.py
envs:
- name: KAFKA_ENABLED
value:
_default: "False"
- name: ASSETS_TOPIC
value:
_default: sarex
- name: DJANGO_SETTINGS_MODULE
value:
_default: config.settings.production
- name: DJANGO_POSTGRES_HOST
value:
_default: postgres-service
- name: DJANGO_POSTGRES_DATABASE
value:
_default: eav_db
- name: YC_S3_ENDPOINT_URL
value:
_default: http://minio.minio.svc.cluster.local:9000
- name: YC_S3_BUCKET_NAME
value:
_default: eav
- name: KAFKA_USERNAME
value:
_default: sarex
- name: KAFKA_SSL_CAFILE
value:
_default: /usr/local/share/ca-certificates/kafka.crt
- name: KAFKA_HOST
value:
_default: ugok-prod-kafka-bootstrap.kafka.svc.cluster.local:9093
secretEnvs:
- name: DJANGO_POSTGRES_USER
secretName:
_default: eav-postgresql-secret
secretKey: username
- name: DJANGO_POSTGRES_PASSWORD
secretName:
_default: eav-postgresql-secret
secretKey: password
- name: JWT_PRIVATE_KEY
secretName:
_default: backend-secret
secretKey: ssh_private.key
- name: JWT_PUBLIC_KEY
secretName:
_default: backend-secret
secretKey: ssh_public.key
- name: YC_S3_ACCESS_KEY_ID
secretName:
_default: eav-s3-secret
secretKey: secret_key
- name: YC_S3_SECRET_ACCESS_KEY
secretName:
_default: eav-s3-secret
secretKey: access_key
- name: KAFKA_PASSWORD
secretName:
_default: kafka-cred
secretKey: password
commitSha: ""
gitlabUri: ""
gitlabJobUrl: ""
owner: ""