From bb497eed5d8df7a23fdff7dabfadfbaab0d51f9e Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 Jan 2022 02:53:31 +0530 Subject: [PATCH 1/6] chore(install): remove the unnecessary validations Signed-off-by: Rajesh Rajendran --- scripts/helmcharts/init.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/helmcharts/init.sh b/scripts/helmcharts/init.sh index c284fab92..2529254b0 100644 --- a/scripts/helmcharts/init.sh +++ b/scripts/helmcharts/init.sh @@ -70,16 +70,6 @@ randomPass() { ## Prepping the infra -## Don't override existing variables file. -[[ -f vars.yaml ]] && { - warn "Existing Variables file. Not downloading." -}|| { - -info " Downloading vars file" -curl -L -O vars.yaml https://raw.githubusercontent.com/rjshrjndrn/openreplay/${version="v1.4.0" - -} - [[ -z $DOMAIN_NAME ]] && { fatal 'DOMAIN_NAME variable is empty. Rerun the script `DOMAIN_NAME=openreplay.mycomp.org bash init.sh `' } From 51f49a7f02b8a37474a42e7285b56e2ad038cc6a Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Sun, 16 Jan 2022 22:44:01 +0100 Subject: [PATCH 2/6] feat(installation): alerts env vars --- .../charts/alerts/templates/deployment.yaml | 32 ++++++++++++++++--- .../openreplay/charts/alerts/values.yaml | 14 ++++++-- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index 3639ae413..a780e481f 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -38,12 +38,34 @@ spec: {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: - - 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 }}' - {{- range $key, $val := .Values.env }} - - name: {{ $key }} + - name: version_number + value: '{{ .Chart.AppVersion }}' + - name: pg_host + value: '{{ .Values.global.postgresql.postgresqlHost }}' + - name: pg_port + value: "5432" + - name: pg_dbname + value: "{{ .Values.global.postgresql.postgresqlDatabase }}" + - name: pg_user + value: '{{ .Values.global.postgresql.postgresqlUser }}' + - name: pg_password + value: '{{ .Values.global.postgresql.postgresqlPassword }}' + - name: S3_HOST + { { - if eq .Values.global.s3.endpoint "http://minio.db.svc.cluster.local:9000" } } + value: 'https://{{ .Values.global.domainName }}' + { { - else } } + value: '{{ .Values.global.s3.endpoint }}' + { { - end } } + - name: S3_KEY + value: '{{ .Values.global.s3.accessKey }}' + - name: S3_SECRET + value: '{{ .Values.global.s3.secretKey }}' + - name: AWS_DEFAULT_REGION + value: '{{ .Values.global.s3.region }}' + { { - range $key, $val := .Values.env } } + - name: { { $key } } value: '{{ $val }}' - {{- end}} + { { - end } } ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/scripts/helmcharts/openreplay/charts/alerts/values.yaml b/scripts/helmcharts/openreplay/charts/alerts/values.yaml index 9a353b057..36ae111e3 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/values.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/values.yaml @@ -76,8 +76,18 @@ autoscaling: # targetMemoryUtilizationPercentage: 80 env: - ALERT_NOTIFICATION_STRING: http://chalice-openreplay.app.svc.cluster.local:8000/alerts/notifications - CLICKHOUSE_STRING: 'tcp://clickhouse.db.svc.cluster.local:9000/default' + EMAIL_HOST: '' + EMAIL_PORT: '587' + EMAIL_USER: '' + EMAIL_PASSWORD: '' + EMAIL_USE_TLS: 'true' + EMAIL_USE_SSL: 'false' + EMAIL_SSL_KEY: '' + EMAIL_SSL_CERT: '' + EMAIL_FROM: OpenReplay + SITE_URL: '' + PYTHONUNBUFFERED: '0' + nodeSelector: {} From 2a36f8330884b7c064aa0c97bc7ef6ba838c4782 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 Jan 2022 03:30:09 +0530 Subject: [PATCH 3/6] chore(helm): smtp variable injection Signed-off-by: Rajesh Rajendran --- .../charts/alerts/templates/deployment.yaml | 18 ++++++++++++++++++ .../openreplay/charts/alerts/values.yaml | 9 --------- .../charts/chalice/templates/deployment.yaml | 18 ++++++++++++++++++ scripts/helmcharts/vars.yaml | 19 ++++++++++--------- 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index a780e481f..34ece7eeb 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -62,6 +62,24 @@ spec: value: '{{ .Values.global.s3.secretKey }}' - name: AWS_DEFAULT_REGION value: '{{ .Values.global.s3.region }}' + - name: EMAIL_HOST + value: '{{ .Values.global.email.emailHost }}' + - name: EMAIL_PORT + value: '{{ .Values.global.email.emailPort }}' + - name: EMAIL_USER + value: '{{ .Values.global.email.emailUser }}' + - name: EMAIL_PASSWORD + value: '{{ .Values.global.email.emailPassword }}' + - name: EMAIL_USE_TLS + value: '{{ .Values.global.email.emailUseTls }}' + - name: EMAIL_USE_SSL + value: '{{ .Values.global.email.emailUseSsl }}' + - name: EMAIL_SSL_KEY + value: '{{ .Values.global.email.emailSslKey }}' + - name: EMAIL_SSL_CERT + value: '{{ .Values.global.email.emailSslCert }}' + - name: EMAIL_FROM + value: '{{ .Values.global.email.emailFrom }}' { { - range $key, $val := .Values.env } } - name: { { $key } } value: '{{ $val }}' diff --git a/scripts/helmcharts/openreplay/charts/alerts/values.yaml b/scripts/helmcharts/openreplay/charts/alerts/values.yaml index 36ae111e3..590303a91 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/values.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/values.yaml @@ -76,15 +76,6 @@ autoscaling: # targetMemoryUtilizationPercentage: 80 env: - EMAIL_HOST: '' - EMAIL_PORT: '587' - EMAIL_USER: '' - EMAIL_PASSWORD: '' - EMAIL_USE_TLS: 'true' - EMAIL_USE_SSL: 'false' - EMAIL_SSL_KEY: '' - EMAIL_SSL_CERT: '' - EMAIL_FROM: OpenReplay SITE_URL: '' PYTHONUNBUFFERED: '0' diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index 805873de7..dd67fa1c5 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -70,6 +70,24 @@ spec: value: '{{ .Values.global.s3.sourcemaps_bucket }}' - name: js_cache_bucket value: '{{ .Values.global.s3.assetsBucket }}' + - name: EMAIL_HOST + value: '{{ .Values.global.email.emailHost }}' + - name: EMAIL_PORT + value: '{{ .Values.global.email.emailPort }}' + - name: EMAIL_USER + value: '{{ .Values.global.email.emailUser }}' + - name: EMAIL_PASSWORD + value: '{{ .Values.global.email.emailPassword }}' + - name: EMAIL_USE_TLS + value: '{{ .Values.global.email.emailUseTls }}' + - name: EMAIL_USE_SSL + value: '{{ .Values.global.email.emailUseSsl }}' + - name: EMAIL_SSL_KEY + value: '{{ .Values.global.email.emailSslKey }}' + - name: EMAIL_SSL_CERT + value: '{{ .Values.global.email.emailSslCert }}' + - name: EMAIL_FROM + value: '{{ .Values.global.email.emailFrom }}' {{- range $key, $val := .Values.env }} - name: {{ $key }} value: '{{ $val }}' diff --git a/scripts/helmcharts/vars.yaml b/scripts/helmcharts/vars.yaml index ebf9888cb..869c252e6 100644 --- a/scripts/helmcharts/vars.yaml +++ b/scripts/helmcharts/vars.yaml @@ -48,6 +48,16 @@ global: # are same as minio.global.minio.accesskey and secretKey accessKey: "changeMeMinioAccessKey" secretKey: "changeMeMinioPassword" + email: + emailHost: '' + emailPort: '587' + emailUser: '' + emailPassword: '' + emailUseTls: 'true' + emailUseSsl: 'false' + emailSslKey: '' + emailSslCert: '' + emailFrom: OpenReplay enterpriseEditionLicense: "" domainName: "" @@ -55,15 +65,6 @@ global: chalice: env: jwt_secret: "SetARandomStringHere" - # EMAIL_HOST: '' - # EMAIL_PORT: '587' - # EMAIL_USER: '' - # EMAIL_PASSWORD: '' - # EMAIL_USE_TLS: 'true' - # EMAIL_USE_SSL: 'false' - # EMAIL_SSL_KEY: '' - # EMAIL_SSL_CERT: '' - # EMAIL_FROM: OpenReplay # SAML2_MD_URL: '' # idp_entityId: '' # idp_sso_url: '' From fb0b020c4aac5de8fac24e3060d7a0376cdac300 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 Jan 2022 03:35:47 +0530 Subject: [PATCH 4/6] fix(helm): helm template error Signed-off-by: Rajesh Rajendran --- .../charts/alerts/templates/deployment.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index 34ece7eeb..21b7c9167 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -51,11 +51,11 @@ spec: - name: pg_password value: '{{ .Values.global.postgresql.postgresqlPassword }}' - name: S3_HOST - { { - if eq .Values.global.s3.endpoint "http://minio.db.svc.cluster.local:9000" } } + {{- if eq .Values.global.s3.endpoint "http://minio.db.svc.cluster.local:9000" }} value: 'https://{{ .Values.global.domainName }}' - { { - else } } + {{- else }} value: '{{ .Values.global.s3.endpoint }}' - { { - end } } + {{- end }} - name: S3_KEY value: '{{ .Values.global.s3.accessKey }}' - name: S3_SECRET @@ -80,10 +80,10 @@ spec: value: '{{ .Values.global.email.emailSslCert }}' - name: EMAIL_FROM value: '{{ .Values.global.email.emailFrom }}' - { { - range $key, $val := .Values.env } } - - name: { { $key } } + {{- range $key, $val := .Values.env }} + - name: {{ $key }} value: '{{ $val }}' - { { - end } } + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} From 1d68dfe5e35bc681f3c1bfdc1b19400b392bc158 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 Jan 2022 03:52:01 +0530 Subject: [PATCH 5/6] chore(helm): fix duplicate env keys in helm ref: https://stackoverflow.com/questions/60727150/helm-error-when-updating-upgrade-failed-the-order-in-patch-list Signed-off-by: Rajesh Rajendran --- scripts/helmcharts/openreplay/charts/chalice/values.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/chalice/values.yaml b/scripts/helmcharts/openreplay/charts/chalice/values.yaml index 509516136..4418bd704 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/values.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/values.yaml @@ -81,15 +81,6 @@ env: captcha_server: '' captcha_key: '' async_Token: '' - EMAIL_HOST: '' - EMAIL_PORT: '587' - EMAIL_USER: '' - EMAIL_PASSWORD: '' - EMAIL_USE_TLS: 'true' - EMAIL_USE_SSL: 'false' - EMAIL_SSL_KEY: '' - EMAIL_SSL_CERT: '' - EMAIL_FROM: OpenReplay SITE_URL: '' announcement_url: '' jwt_secret: "SetARandomStringHere" From 4d456ce259f14d279b330f86079832c716128638 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 Jan 2022 04:01:23 +0530 Subject: [PATCH 6/6] chore(helm): updated comment Signed-off-by: Rajesh Rajendran --- scripts/helmcharts/vars.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/helmcharts/vars.yaml b/scripts/helmcharts/vars.yaml index 869c252e6..ac093d6bf 100644 --- a/scripts/helmcharts/vars.yaml +++ b/scripts/helmcharts/vars.yaml @@ -1,7 +1,7 @@ fromVersion: "v1.4.0" # Databases specific variables postgresql: &postgres - # For genrating psswords + # For generating passwords # `openssl rand -hex 20` postgresqlPassword: "changeMePassword" postgresqlHost: "postgresql.db.svc.cluster.local" @@ -21,6 +21,8 @@ kafka: &kafka kafkaUseSsl: "false" redis: &redis + # For enterpriseEdition + # enabled: false redisHost: "redis-master.db.svc.cluster.local" redisPort: "6379"