From f5d9410673688ae9d2eb20efb91a8c1a280ee059 Mon Sep 17 00:00:00 2001 From: almog8k Date: Thu, 16 Apr 2026 11:59:59 +0300 Subject: [PATCH] feat: update nginx version to 2.1.5 and enhance downloads configuration(MAPCO-10121) --- helm/Chart.yaml | 2 +- helm/config/downloads-location.conf | 27 +++++++++++++++ helm/config/downloads.conf | 41 ----------------------- helm/templates/nginx/nginx-configmap.yaml | 2 +- helm/values.yaml | 38 ++++++++++++++++++--- 5 files changed, 62 insertions(+), 48 deletions(-) create mode 100644 helm/config/downloads-location.conf delete mode 100644 helm/config/downloads.conf diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 320118e..b12cd93 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -6,5 +6,5 @@ version: 2.3.0 appVersion: 2.3.0 dependencies: - name: nginx - version: 2.1.1 + version: 2.1.5 repository: oci://acrarolibotnonprod.azurecr.io/helm/common diff --git a/helm/config/downloads-location.conf b/helm/config/downloads-location.conf new file mode 100644 index 0000000..bf2eb42 --- /dev/null +++ b/helm/config/downloads-location.conf @@ -0,0 +1,27 @@ +{{- $storage := (include "common.storage.merged" .) | fromYaml }} +{{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }} + +{{- if eq (upper $storage.gpkgProvider) "FS" }} + # FS provider + root /usr/share/nginx/html/downloads; + types {} +{{- end }} + +{{- if eq (upper $storage.gpkgProvider) "S3" }} + # S3 provider + proxy_pass {{ $serviceUrls.ngnixS3Gateway }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # Timeouts for larger files + proxy_connect_timeout 300; + proxy_send_timeout 300; + proxy_read_timeout 300; + send_timeout 300; + + # Buffer settings for handling large files + proxy_buffering off; + proxy_max_temp_file_size 0; +{{- end }} diff --git a/helm/config/downloads.conf b/helm/config/downloads.conf deleted file mode 100644 index 358a0af..0000000 --- a/helm/config/downloads.conf +++ /dev/null @@ -1,41 +0,0 @@ -{{- $storage := (include "common.storage.merged" .) | fromYaml }} -{{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }} - -server { - listen {{ .Values.nginx.backend.port }}; - server_name {{ .Values.nginx.backend.host }}; - - location /downloads { - {{- if eq (upper $storage.gpkgProvider) "FS" }} - # FS provider - root /usr/share/nginx/html; - types {} - {{- end }} - - {{- if eq (upper $storage.gpkgProvider) "S3" }} - # S3 provider - rewrite ^/downloads/(.*) /$1 break; - - proxy_pass {{ $serviceUrls.ngnixS3Gateway }}; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # Timeouts for larger files - proxy_connect_timeout 300; - proxy_send_timeout 300; - proxy_read_timeout 300; - send_timeout 300; - - # Buffer settings for handling large files - proxy_buffering off; - proxy_max_temp_file_size 0; - {{- end }} - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } -} diff --git a/helm/templates/nginx/nginx-configmap.yaml b/helm/templates/nginx/nginx-configmap.yaml index 56844b0..de877fc 100644 --- a/helm/templates/nginx/nginx-configmap.yaml +++ b/helm/templates/nginx/nginx-configmap.yaml @@ -12,5 +12,5 @@ metadata: environment: {{ .Values.environment }} release: {{ $releaseName }} data: - downloads.conf: {{ tpl (.Files.Get "config/downloads.conf") . | quote }} + downloads-location.conf: {{ tpl (.Files.Get "config/downloads-location.conf") . | quote }} {{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 762bab4..9d605c0 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -62,19 +62,48 @@ env: nginx: enabled: true fullnameOverride: "" + nginx: + extensions: + location: + enabled: true + fileName: downloads-location.conf authorization: enabled: false replicaCount: 1 image: repository: common/nginx - tag: "v2.1.1" + tag: "v2.1.5" port: 8080 targetPort: 8080 nodePort: 30003 backend: - host: "127.0.0.1" - port: 8082 + enabled: false + + prometheusExporter: + # -- Enable or disable the Prometheus exporter sidecar + enabled: true + image: + # -- Docker image name for the Prometheus exporter + repository: common/nginx/nginx-prometheus-exporter + # -- Docker image tag for the Prometheus exporter + tag: latest + # -- Image pull policy for the Prometheus exporter + pullPolicy: IfNotPresent + resources: + # -- Enable or disable resource limits and requests + enabled: true + value: + limits: + # -- CPU limit for the main container + cpu: 100m + # -- Memory limit for the main container + memory: 128Mi + requests: + # -- CPU request for the main container + cpu: 100m + # -- Memory request for the main container + memory: 128Mi opentelemetry: serviceName: "" @@ -92,9 +121,8 @@ nginx: claimName: "internal-pvc-nfs" extraVolumeMounts: - - mountPath: "/etc/nginx/conf.d/downloads.conf" + - mountPath: "/etc/nginx/conf.d/extensions" name: nginx-config - subPath: downloads.conf - name: gpkgs-storage mountPath: /usr/share/nginx/html/downloads subPath: gpkgs