From 6a9035e26047319d4ba7f227119b267f54373bd6 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 17 Feb 2022 11:58:26 +0100 Subject: [PATCH] chore(helm): commit We need to check what is the object store endpoint. There can be 4 options 1. Using minio inside kube clster 2. Using minio managed external cluster, like aws minio offering 3. Using GCP or other object stores compatible with s3 apis 4. Using AWS itself. AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object Signed-off-by: rjshrjndrn --- .../charts/assets/templates/deployment.yaml | 18 +++++++++++++++--- .../charts/http/templates/deployment.yaml | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index 1c8216468..d34883b5a 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -56,13 +56,25 @@ spec: value: '{{ .Values.global.kafka.kafkaHost }}:{{ .Values.global.kafka.kafkaPort }}' - name: KAFKA_USE_SSL value: '{{ .Values.global.kafka.kafkaUseSsl }}' - # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter - # We need https://bucketname.s3endpoint + # We need to check what is the object store endpoint. + # There can be 4 options + # 1. Using minio inside kube clster + # 2. Using minio managed external cluster, like aws minio offering + # 3. Using GCP or other object stores compatible with s3 apis + # 4. Using AWS itself. + # AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object - name: ASSETS_ORIGIN {{- if eq .Values.global.s3.endpoint "http://minio.db.svc.cluster.local:9000" }} + # Local minio Installation value: 'https://{{ .Values.global.domainName }}/{{.Values.global.s3.assetsBucket}}' - {{- else }} + {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} + # AWS S3 + # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter + # We need https://bucketname.s3endpoint value: {{ (split "://" .Values.global.s3.endpoint)._0 }}://{{.Values.global.s3.assetsBucket}}.{{ (split "://" .Values.global.s3.endpoint)._1 }} + {{- else }} + # S3 compatible storage + value: '{{ .Values.global.s3.endpoint }}/{{.Values.global.s3.assetsBucket}}' {{- end }} {{- range $key, $val := .Values.env }} - name: {{ $key }} diff --git a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml index 875cc3630..0c4399518 100644 --- a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml @@ -54,11 +54,25 @@ spec: value: '{{ .Values.global.kafka.kafkaUseSsl }}' - name: POSTGRES_STRING value: 'postgres://{{ .Values.global.postgresql.postgresqlUser }}:{{ .Values.global.postgresql.postgresqlPassword }}@{{ .Values.global.postgresql.postgresqlHost }}:{{ .Values.global.postgresql.postgresqlPort }}/{{ .Values.global.postgresql.postgresqlDatabase }}' + # We need to check what is the object store endpoint. + # There can be 4 options + # 1. Using minio inside kube clster + # 2. Using minio managed external cluster, like aws minio offering + # 3. Using GCP or other object stores compatible with s3 apis + # 4. Using AWS itself. + # AWS uses bucketname.endpoint/object while others use endpoint/bucketname/object - name: ASSETS_ORIGIN {{- if eq .Values.global.s3.endpoint "http://minio.db.svc.cluster.local:9000" }} + # Local minio Installation value: 'https://{{ .Values.global.domainName }}/{{.Values.global.s3.assetsBucket}}' - {{- else }} + {{- else if contains "amazonaws.com" .Values.global.s3.endpoint }} + # AWS S3 + # Ref: https://stackoverflow.com/questions/53634583/go-template-split-string-by-delimiter + # We need https://bucketname.s3endpoint value: {{ (split "://" .Values.global.s3.endpoint)._0 }}://{{.Values.global.s3.assetsBucket}}.{{ (split "://" .Values.global.s3.endpoint)._1 }} + {{- else }} + # S3 compatible storage + value: '{{ .Values.global.s3.endpoint }}/{{.Values.global.s3.assetsBucket}}' {{- end }} {{- range $key, $val := .Values.env }} - name: {{ $key }}