---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend
  namespace: django
spec:
  replicas: 2
  template:
    spec:
      containers:
      - name: backend
        image: cr.yandex/crp3ccidau046kdj8g9q/backend:production_c0c6bbb1
        env:
        - name: GK_ENCRYPTION_KEY
          value: zfDjuszywHSbAhY8KJQbESbpUYN74XTs
        - name: SERVER_DONSTROI_STYLE
          value: 'True'
        - name: SERVER_API_HOST
          value: https://sarex.dsinv.ru
        - name: SERVER_VERIFY_SSL
          value: 'False'
        - name: SERVER_SUPERSET_HOST
          value: https://bi.sarex.dsinv.ru
        - name: GATEWAY_HOST
          value: http://pdm-api.documentations.svc.cluster.local:8080
        - name: KC_DEFAULT_COMPANY_NAME
          value: Донстрой
        - name: KC_SYNC_USER_GROUPS
          value: '0'
        - name: SERVER_ZITADEL_ENABLED
          value: 'False'
        - name: KC_SYNC_USER_POSITIONS
          value: '0'
        - name: KC_SYNC_USER_DEPARTMENTS
          value: '0'
        - name: SERVER_CHANGELOG_MODE_CELERY
          value: 'True'
        - name: SERVER_CHANGELOG_MODE_SYSTEM_LOG
          value: 'True'
        - name: DJANGO_SETTINGS_MODULE
          value: config.settings.production
        - name: CC_PATH
          value: /usr/local/bin/CloudCompare
        - name: CC_COMPARISONS_BASE_DIR
          value: /tmp
        - name: PCVT_PATH
          value: /usr/local/bin/PotreeConverter
        - name: POTREE_CONVERTER_PATH
          value: /usr/local/bin/PotreeConverter
        - name: WORKFLOWS_BASE_HOST
          value: http://backend.django.svc.cluster.local:8000
        - name: WORKFLOWS_HOST
          value: http://workflows-service.workflow.svc.cluster.local:8000
        - name: WORKFLOWS_PREFIX
          value: /api/v1
        - name: SERVER_HOST
          value: https://sarex.dsinv.ru
        - name: S3_HOST
          value: http://minio-service.minio.svc.cluster.local:9000
        - name: AWS_S3_ENDPOINT_URL
          value: http://minio-service.minio.svc.cluster.local:9000
        - name: MEASUREMENTS_USE_MEASUREMENTS
          value: '1'
        - name: MEASUREMENTS_HOST
          value: http://measurement-service.measurements.svc.cluster.local:8000/api
        - name: SERVER_USE_DJANGO_STORAGE
          value: '1'
        - name: SERVER_DJANGO_URLS
          value: '1'
        - name: SERVER_S3_STREAM_IMPORT
          value: '1'
        - name: WORKFLOWS_USE
          value: '1'
        - name: SERVER_KAFKA_ENABLED
          value: 'True'
        - name: KAFKA_TOPICS
          value: '{"planning": "message-hub-stage", "ams-sync": "ams-sync"}'
        - name: KAFKA_BOOTSTRAP_SERVERS
          value: '["donstroi-kafka-bootstrap.kafka.svc.cluster.local:9093"]'
        - name: KAFKA_SECURITY_PROTOCOL
          value: SSL
        - name: KAFKA_SASL_MECHANISM
          value: SCRAM-SHA-512
        - name: KAFKA_SSL_CAFILE
          value: /etc/ca-certificates/Yandex/YandexInternalRootCA.crt
        - name: WORKFLOWS_REGISTRY
          value: cr.yandex/crp3ccidau046kdj8g9q
        - name: DJANGO_REDIS_HOST
          value: redis-service.django.svc.cluster.local
        - name: DJANGO_RABBIT_HOSTNAME
          value: rabbitmq-service.django.svc.cluster.local
        - name: CELERY_RABBITMQ_HOST
          value: rabbitmq-service.django.svc.cluster.local
        - name: DJANGO_POSTGRES_HOST
          value: postgres-service
        - name: DJANGO_POSTGRES_PORTS
          value: '5432'
        - name: ALLOWED_HOSTS
          value: '*'
        - name: USE_SSL_FOR_URL_SERIALIZATION
          value: '0'
        - name: SERVER_REPLACE_HOST
          value: '1'
        - name: SERVER_JWT_PROXY
          value: '0'
        - name: PDM_SYNC
          value: '1'
        - name: CELERY_REDIS_HOST
          value: redis-service
