apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: istio-config
  namespace: default
spec:
  dependsOn: []
  interval: 5m
  timeout: 10m
  values:
    global:
      env: d8-ugmk-prod
    environments:
      d8-ugmk-prod:
        istio:
          gateways:
            camunda:
              name: camunda-gateway
              namespace: default
              selector:
                istio.deckhouse.io/ingress-gateway-class: istio
              servers:
                - hosts:
                    - camunda-keycloak.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
                - hosts:
                    - camunda-identity.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
                - hosts:
                    - camunda-operate.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
                - hosts:
                    - camunda-tasklist.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
                - hosts:
                    - camunda-optimize.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
            rabbitmq:
              name: rabbitmq-gateway
              namespace: default
              selector:
                istio.deckhouse.io/ingress-gateway-class: istio
              servers:
                - hosts:
                    - rabbitmq.sarex-k8s.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
            zitadel:
              name: zitadel-gateway
              namespace: default
              selector:
                istio.deckhouse.io/ingress-gateway-class: istio
              servers:
                - hosts:
                    - sarex-login.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
            platform:
              name: platform-gateway
              namespace: default
              selector:
                istio.deckhouse.io/ingress-gateway-class: istio
              servers:
                - hosts:
                    - sarex.uralmine.com
                  tls:
                    credentialName: istio-ingress-tls
          virtualServices:
            platform:
              name: sarex-frontend-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /admin/
                  service: backend-svc.django.svc.cluster.local
                  port: 80

                - path:
                    prefix: /api/
                  service: backend-svc.django.svc.cluster.local
                  port: 80

                - path:
                    prefix: /
                  service: frontend-svc.django.svc.cluster.local
                  port: 80
            filestream-api:
              name: documentations-filestream-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /files/api/
                  rewrite: /api/
                  service: backend-filestream-svc.documentations.svc.cluster.local
                  port: 80
            iam-api:
              name: iam-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /iam/api/
                  rewrite: /external/api/
                  service: iam-backend.iam.svc.cluster.local
                  port: 8000
            documentations-frontend:
              name: documentations-frontend-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /documentations/static/
                  rewrite: /
                  service: frontend-svc.documentations.svc.cluster.local
                  port: 80
            documentations-api:
              name: documentations-api-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /documentations/api/
                  rewrite: /api/
                  service: backend-api-svc.documentations.svc.cluster.local
                  port: 80
            gateway-platform:
              name: pdm-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /gateway/
                  rewrite: /
                  service: pdm-svc.documentations.svc.cluster.local
                  port: 80
            srx-admin-frontend:
              name: srx-admin-frontend-virt-service
              namespace: default
              hosts:
                - sarex.uralmine.com
              gateways:
                - default/platform-gateway
              routes:
                - path:
                    prefix: /control-interface/
                  rewrite: /
                  service: frontend-svc.control-interface.svc.cluster.local
                  port: 8080
            camunda-keycloak:
              namespace: default
              hosts:
                - camunda-keycloak.sarex-k8s.uralmine.com
              gateways:
                - default/camunda-gateway
              routes:
                - path:
                    prefix: /
                  service: camunda-keycloak.camunda.svc.cluster.local
                  port: 80
            camunda-identity:
              namespace: default
              hosts:
                - camunda-identity.sarex-k8s.uralmine.com
              gateways:
                - default/camunda-gateway
              routes:
                - path:
                    prefix: /
                  service: camunda-identity.camunda.svc.cluster.local
                  port: 80
            camunda-operate:
              namespace: default
              hosts:
                - camunda-operate.sarex-k8s.uralmine.com
              gateways:
                - default/camunda-gateway
              routes:
                - path:
                    prefix: /
                  service: camunda-operate.camunda.svc.cluster.local
                  port: 80
            camunda-tasklist:
              namespace: default
              hosts:
                - camunda-tasklist.sarex-k8s.uralmine.com
              gateways:
                - default/camunda-gateway
              routes:
                - path:
                    prefix: /
                  service: camunda-tasklist.camunda.svc.cluster.local
                  port: 80
            camunda-optimize:
              namespace: default
              hosts:
                - camunda-optimize.sarex-k8s.uralmine.com
              gateways:
                - default/camunda-gateway
              routes:
                - path:
                    prefix: /
                  service: camunda-optimize.camunda.svc.cluster.local
                  port: 80
            rabbitmq:
              namespace: default
              hosts:
                - rabbitmq.sarex-k8s.uralmine.com
              gateways:
                - default/rabbitmq-gateway
              routes:
                - path:
                    prefix: /
                  service: rabbitmq.rabbitmq.svc.cluster.local
                  port: 15672
            zitadel:
              namespace: default
              hosts:
                - sarex-login.uralmine.com
              gateways:
                - default/zitadel-gateway
              routes:
                - path:
                    prefix: /
                  service: zitadel-idp-contour.zitadel.svc.cluster.local
                  port: 8080
