diff --git a/apps/django/yc-ecp/frontend.yaml b/apps/django/yc-ecp/frontend.yaml new file mode 100644 index 0000000..1b3d2b4 --- /dev/null +++ b/apps/django/yc-ecp/frontend.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: django +spec: + interval: 5m + timeout: 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: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:cps_82ba823b + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: frontend-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: dockerhub + + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - frontend + topologyKey: kubernetes.io/hostname + + # ConfigMap'ы nginx-configmap и robots-txt-config создаются вне этого + # релиза — чарт только монтирует их + volumes: + _default: + - name: nginx-configmap + mountPath: + _default: /etc/nginx/nginx.conf + subPath: + _default: nginx.conf + configMap: + name: + _default: nginx-configmap + items: + - key: nginx.conf + path: + _default: nginx.conf + + - name: robots-volume + mountPath: + _default: /opt/react_client/robots.txt + subPath: + _default: robots.txt + configMap: + name: + _default: robots-txt-config + items: + - key: robots.txt + path: + _default: robots.txt diff --git a/apps/django/yc-ecp/kustomization.yaml b/apps/django/yc-ecp/kustomization.yaml new file mode 100644 index 0000000..667b328 --- /dev/null +++ b/apps/django/yc-ecp/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: django +resources: + - frontend.yaml +# - namespace.yaml diff --git a/apps/django/yc-ecp/namespace.yaml b/apps/django/yc-ecp/namespace.yaml new file mode 100644 index 0000000..33478ea --- /dev/null +++ b/apps/django/yc-ecp/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: django + labels: + istio-injection: enabled diff --git a/clusters/yc-ecp/kustomization.yaml b/clusters/yc-ecp/kustomization.yaml index ed93bd6..65f668e 100644 --- a/clusters/yc-ecp/kustomization.yaml +++ b/clusters/yc-ecp/kustomization.yaml @@ -12,3 +12,4 @@ resources: # apps - ../../apps/measurements/yc-ecp + - ../../apps/django/yc-ecp diff --git a/infrastructure/istio-config/yc-ecp/istio-config.yaml b/infrastructure/istio-config/yc-ecp/istio-config.yaml index 551b5c2..6220737 100644 --- a/infrastructure/istio-config/yc-ecp/istio-config.yaml +++ b/infrastructure/istio-config/yc-ecp/istio-config.yaml @@ -120,7 +120,7 @@ spec: # noCors: чарт иначе навешивает corsPolicy с дефолтными origins sarex.io virtualServices: gitea-virt-service: - namespace: gitea + namespace: gateway noCors: true hosts: - gitea.invest.cps.sarex.lonsdaleites.ru @@ -132,7 +132,7 @@ spec: service: gitea.gitea.svc.cluster.local port: 3000 vault-virt-service: - namespace: vault + namespace: gateway noCors: true hosts: - vault.invest.cps.sarex.lonsdaleites.ru @@ -144,7 +144,7 @@ spec: service: vault-vault-contour.vault.svc.cluster.local port: 8200 dashboard-virt-service: - namespace: kubernetes-dashboard + namespace: gateway noCors: true hosts: - dashboard.invest.cps.sarex.lonsdaleites.ru @@ -158,7 +158,7 @@ spec: # # --- aero.invest.sarex.io / main-gateway --- # backend-service-virt-service: -# namespace: django +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -177,15 +177,15 @@ spec: # routes: # - path: # prefix: /admin/ -# service: backend-service +# service: backend-service.django.svc.cluster.local # port: 8000 # - path: # prefix: /api -# service: backend-service +# service: backend-service.django.svc.cluster.local # port: 8000 # # s3-proxy-virt-service: -# namespace: django +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -205,16 +205,16 @@ spec: # - path: # prefix: /s3/ # rewrite: / -# service: s3-bim-service +# service: s3-bim-service.django.svc.cluster.local # port: 80 # - path: # prefix: /media/ # rewrite: / -# service: s3-service +# service: s3-service.django.svc.cluster.local # port: 80 # # frontend-vs: -# namespace: django +# namespace: gateway # noCors: true # hosts: # - aero.invest.sarex.io @@ -227,7 +227,7 @@ spec: # port: 80 # # bim-api-gazpromcps-api-virt-service: -# namespace: bim +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -247,16 +247,16 @@ spec: # - path: # prefix: /bim-gazpromcps/api/ # rewrite: /api/ -# service: bim-api-gazpromcps-service +# service: bim-api-gazpromcps-service.bim.svc.cluster.local # port: 80 # - path: # prefix: /bim-gazpromcps/files/ # rewrite: /files/ -# service: bim-api-gazpromcps-service +# service: bim-api-gazpromcps-service.bim.svc.cluster.local # port: 80 # # bim-backend-v2-api-virt-service: -# namespace: bim +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -276,11 +276,11 @@ spec: # - path: # prefix: /bim2-gazpromcps/api/ # rewrite: /api/ -# service: bim-backend-v2-service +# service: bim-backend-v2-service.bim.svc.cluster.local # port: 80 # # eav-virt-service: -# namespace: eav +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -301,17 +301,17 @@ spec: # - path: # prefix: /eav/api/ # rewrite: /api/ -# service: eav-service +# service: eav-service.eav.svc.cluster.local # port: 8000 # noCors: true # - path: # prefix: /eav/admin/ # rewrite: /eav/admin/ -# service: eav-service +# service: eav-service.eav.svc.cluster.local # port: 8000 # # api-virt-service: -# namespace: processing +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -331,11 +331,11 @@ spec: # - path: # prefix: /workflows/api/ # rewrite: /api/ -# service: workflows-backend-service +# service: workflows-backend-service.processing.svc.cluster.local # port: 80 # # projects-frontend-static-virt-service: -# namespace: projects +# namespace: gateway # hosts: # - aero.invest.sarex.io # gateways: @@ -355,5 +355,5 @@ spec: # - path: # prefix: /projects/static/ # rewrite: / -# service: projects-frontend-static-service +# service: projects-frontend-static-service.projects.svc.cluster.local # port: 80