From 8e4292c96595fac38942adbcac468e6e7a1e6d87 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 15 Apr 2025 11:18:58 +0200 Subject: [PATCH] feat(assist-api): trying to fix ingress declaration --- .../charts/assist-api/templates/ingress.yaml | 53 +++---------------- .../openreplay/charts/assist-api/values.yaml | 34 ++++++------ 2 files changed, 23 insertions(+), 64 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml b/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml index 896db8b52..c9def9f86 100644 --- a/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml +++ b/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml @@ -1,62 +1,25 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "assist-api.fullname" . -}} {{- $svcPort := .Values.service.ports.http -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }} namespace: {{ .Release.Namespace }} labels: {{- include "assist-api.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$1 + nginx.ingress.kubernetes.io/upstream-hash-by: $http_x_forwarded_for + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} + ingressClassName: "{{ tpl .Values.ingress.className . }}" tls: - {{- range .Values.ingress.tls }} - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} + - {{ .Values.global.domainName }} + {{- if .Values.ingress.tls.secretName}} + secretName: {{ .Values.ingress.tls.secretName }} + {{- end}} {{- end }} diff --git a/scripts/helmcharts/openreplay/charts/assist-api/values.yaml b/scripts/helmcharts/openreplay/charts/assist-api/values.yaml index dde9aba35..37800d79e 100644 --- a/scripts/helmcharts/openreplay/charts/assist-api/values.yaml +++ b/scripts/helmcharts/openreplay/charts/assist-api/values.yaml @@ -33,10 +33,10 @@ podSecurityContext: runAsGroup: 1001 fsGroup: 1001 fsGroupChangePolicy: "OnRootMismatch" -# podSecurityContext: {} + # podSecurityContext: {} # fsGroup: 2000 - -# securityContext: {} + + # securityContext: {} # capabilities: # drop: # - ALL @@ -44,8 +44,12 @@ podSecurityContext: # runAsNonRoot: true # runAsUser: 1000 +#service: +# type: ClusterIP +# port: 9000 + serviceMonitor: - enabled: true + enabled: false additionalLabels: release: observability scrapeConfigs: @@ -66,18 +70,6 @@ ingress: enabled: true className: "{{ .Values.global.ingress.controller.ingressClassResource.name }}" annotations: - nginx.ingress.kubernetes.io/configuration-snippet: | - add_header X-Debug-Session-ID $http_sessionid; - add_header X-Debug-Session-Type "wss"; - - # CORS configuration - # We don't need the upstream header - proxy_hide_header Access-Control-Allow-Origin; - add_header 'Access-Control-Allow-Origin' $http_origin always; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'sessionid, Content-Type, Authorization' always; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # kubernetes.io/ingress.class: nginx @@ -95,7 +87,7 @@ resources: {} # memory: 128Mi # requests: # cpu: 100m - # memory: 128Mi +# memory: 128Mi autoscaling: enabled: false @@ -104,7 +96,11 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -env: {} +env: + debug: 0 + uws: false + redis: false + CLEAR_SOCKET_TIME: 720 nodeSelector: {} @@ -123,4 +119,4 @@ persistence: {} # volumes: # - name: kafka-ssl # secret: - # secretName: kafka-ssl +# secretName: kafka-ssl