From 2c975c768eaa1d253c606740e8c2e3db8f0cf69b Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Tue, 27 May 2025 12:55:28 +0200 Subject: [PATCH] feat: refactor assist-api chart and remove ingress routing - Add assist-api as new chart dependency with conditional enablement - Remove Kafka environment variables from assist-api deployment - Add REDIS_CACHE_ENABLED with enterprise license conditional logic - Delete assist-api ingress.yaml for direct service routing - Remove S3 configuration from assist deployment - Add openreplay.assist_url helper for service discovery - Configure assist-api as disabled by default in values BREAKING CHANGE: assist-api no longer uses ingress routing and requires direct service access. S3 configuration removed from assist service. Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay/Chart.yaml | 4 +++ .../assist-api/templates/deployment.yaml | 6 ++-- .../charts/assist-api/templates/ingress.yaml | 36 ------------------- .../charts/assist/templates/deployment.yaml | 24 ------------- .../openreplay/templates/_helpers.tpl | 8 +++++ scripts/helmcharts/openreplay/values.yaml | 2 ++ 6 files changed, 16 insertions(+), 64 deletions(-) delete mode 100644 scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml diff --git a/scripts/helmcharts/openreplay/Chart.yaml b/scripts/helmcharts/openreplay/Chart.yaml index 71f89e366..664a32226 100644 --- a/scripts/helmcharts/openreplay/Chart.yaml +++ b/scripts/helmcharts/openreplay/Chart.yaml @@ -37,3 +37,7 @@ dependencies: repository: file://charts/connector version: 0.1.1 condition: connector.enabled + - name: assist-api + repository: file://charts/assist-api + version: 0.1.1 + condition: assist-api.enabled diff --git a/scripts/helmcharts/openreplay/charts/assist-api/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assist-api/templates/deployment.yaml index e8540295b..b1b540590 100644 --- a/scripts/helmcharts/openreplay/charts/assist-api/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assist-api/templates/deployment.yaml @@ -45,10 +45,6 @@ spec: env: - name: LICENSE_KEY value: '{{ .Values.global.enterpriseEditionLicense }}' - - name: KAFKA_SERVERS - value: '{{ .Values.global.kafka.kafkaHost }}:{{ .Values.global.kafka.kafkaPort }}' - - name: KAFKA_USE_SSL - value: '{{ .Values.global.kafka.kafkaUseSsl }}' - name: ASSIST_KEY value: {{ .Values.global.assistKey }} - name: pg_password @@ -62,6 +58,8 @@ spec: {{- end}} - name: POSTGRES_STRING value: 'postgres://{{ .Values.global.postgresql.postgresqlUser }}:$(pg_password)@{{ .Values.global.postgresql.postgresqlHost }}:{{ .Values.global.postgresql.postgresqlPort }}/{{ .Values.global.postgresql.postgresqlDatabase }}' + - name: REDIS_CACHE_ENABLED + value: {{- if .Values.global.enterpriseEditionLicense }}true{{- else }}false{{- end }} {{- include "openreplay.env.redis_string" .Values.global.redis | nindent 12 }} {{- range $key, $val := .Values.global.env }} - name: {{ $key }} diff --git a/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml b/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml deleted file mode 100644 index 6341db4f2..000000000 --- a/scripts/helmcharts/openreplay/charts/assist-api/templates/ingress.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "assist-api.fullname" . -}} -{{- $svcPort := .Values.service.ports.http -}} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "assist-api.labels" . | nindent 4 }} - 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: - ingressClassName: "{{ tpl .Values.ingress.className . }}" - tls: - - hosts: - - {{ .Values.global.domainName }} - {{- if .Values.ingress.tls.secretName}} - secretName: {{ .Values.ingress.tls.secretName }} - {{- end }} - rules: - - host: {{ .Values.global.domainName }} - http: - paths: - - path: /api-assist/(.*) - pathType: Prefix - backend: - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} -{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml index a4af9a9f8..bb2c75577 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/templates/deployment.yaml @@ -49,30 +49,6 @@ spec: value: {{ .Values.global.assistKey }} - name: AWS_DEFAULT_REGION value: "{{ .Values.global.s3.region }}" - - name: S3_HOST - {{- if contains "minio" .Values.global.s3.endpoint }} - value: '{{ ternary "https" "http" .Values.global.ORSecureAccess}}://{{ .Values.global.domainName }}:{{ ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess }}' - {{- else}} - value: '{{ .Values.global.s3.endpoint }}' - {{- end}} - - name: S3_KEY - {{- if .Values.global.s3.existingSecret }} - valueFrom: - secretKeyRef: - name: {{ .Values.global.s3.existingSecret }} - key: access-key - {{- else }} - value: {{ .Values.global.s3.accessKey }} - {{- end }} - - name: S3_SECRET - {{- if .Values.global.s3.existingSecret }} - valueFrom: - secretKeyRef: - name: {{ .Values.global.s3.existingSecret }} - key: secret-key - {{- else }} - value: {{ .Values.global.s3.secretKey }} - {{- end }} - name: REDIS_URL value: {{ .Values.global.redis.redisHost }} {{- range $key, $val := .Values.global.env }} diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index e239d2f8f..ddbcb764d 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -161,3 +161,11 @@ Create the volume mount config for redis TLS certificates {{- printf "postgres://%s:$(pg_password)@%s:%s/%s" .Values.global.postgresql.postgresqlUser .Values.global.postgresql.postgresqlHost .Values.global.postgresql.postgresqlPort .Values.global.postgresql.postgresqlDatabase -}} {{- end -}} {{- end}} + +{{- define "openreplay.assist_url"}} +{{- if .Values.global.enterpriseEditionLicense }} +assist-api-openreplay:8080 +{{- else}} +assist-openreplay:8080 +{{- end}} +{{- end}} diff --git a/scripts/helmcharts/openreplay/values.yaml b/scripts/helmcharts/openreplay/values.yaml index 8be97a2dc..627db73c6 100644 --- a/scripts/helmcharts/openreplay/values.yaml +++ b/scripts/helmcharts/openreplay/values.yaml @@ -47,6 +47,8 @@ vault: &vault {{- with secret "database/creds/db-app" -}} POSTGRES_STRING=postgres://{{.Data.username}}:{{.Data.password}}@postgresql.db.svc.cluster.local:5432/postgres {{- end -}} +assist-api: + enabled: false minio: # Force initialize minio, even if the instance is not provisioned by OR