From 4ca2c86587cca350b3156632eb478edf59fd99ad Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 28 Oct 2022 12:58:50 +0300 Subject: [PATCH 01/26] Fix uat readiness values --- reportportal/templates/gateway-ingress.yaml | 20 ++++++++++---------- reportportal/values.yaml | 3 +++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/reportportal/templates/gateway-ingress.yaml b/reportportal/templates/gateway-ingress.yaml index cabb6f22..9989cd75 100644 --- a/reportportal/templates/gateway-ingress.yaml +++ b/reportportal/templates/gateway-ingress.yaml @@ -20,35 +20,35 @@ spec: - host: {{ $host }} http: paths: - - path: /()?(.*) + - path: {{ .Values.ingress.path }}/()?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-index port: name: {{ $.Values.serviceindex.service.portName | default "headless" }} - - path: /(ui)/?(.*) + - path: {{ .Values.ingress.path }}/(ui)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-ui port: name: {{ $.Values.serviceui.service.portName | default "headless" }} - - path: /(uat)/?(.*) + - path: {{ .Values.ingress.path }}/(uat)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-uat port: name: {{ $.Values.uat.service.portName | default "headless" }} - - path: /(api)/?(.*) + - path: {{ .Values.ingress.path }}/(api)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-api port: name: {{ $.Values.serviceapi.service.portName | default "headless" }} - - path: /(jobs)/?(.*) + - path: {{ .Values.ingress.path }}/(jobs)/?(.*) pathType: Prefix backend: service: @@ -59,35 +59,35 @@ spec: {{ else }} - http: paths: - - path: /()?(.*) + - path: {{ .Values.ingress.path }}/()?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-index port: name: {{ $.Values.serviceindex.service.portName | default "headless" }} - - path: /(ui)/?(.*) + - path: {{ .Values.ingress.path }}/(ui)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-ui port: name: {{ $.Values.serviceui.service.portName | default "headless" }} - - path: /(uat)/?(.*) + - path: {{ .Values.ingress.path }}/(uat)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-uat port: name: {{ $.Values.uat.service.portName | default "headless" }} - - path: /(api)/?(.*) + - path: {{ .Values.ingress.path }}/(api)/?(.*) pathType: Prefix backend: service: name: {{ $fullName }}-api port: name: {{ $.Values.serviceapi.service.portName | default "headless" }} - - path: /(jobs)/?(.*) + - path: {{ .Values.ingress.path }}/(jobs)/?(.*) pathType: Prefix backend: service: diff --git a/reportportal/values.yaml b/reportportal/values.yaml index e9a4d4a1..81b0510b 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -425,6 +425,9 @@ ingress: usedomainname: false hosts: - reportportal.k8.com + # Application path as a prefix, should start from '/' and be without trailing '/' + # TODO: remove path before merge + path: "/reportportal" annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-redirect: "false" From 40b17aa095fad8385c00c93292a0b5efbbc1752d Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 28 Oct 2022 20:00:05 +0300 Subject: [PATCH 02/26] Ingress path configuration --- reportportal/templates/gateway-ingress.yaml | 12 ++++++++++-- reportportal/templates/index-deployment.yaml | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/reportportal/templates/gateway-ingress.yaml b/reportportal/templates/gateway-ingress.yaml index 9989cd75..cea0be63 100644 --- a/reportportal/templates/gateway-ingress.yaml +++ b/reportportal/templates/gateway-ingress.yaml @@ -20,7 +20,11 @@ spec: - host: {{ $host }} http: paths: - - path: {{ .Values.ingress.path }}/()?(.*) + {{- if .Values.ingress.path }} + - path: {{ .Values.ingress.path }}/?()?(.*) + {{- else }} + - path: /()?(.*) + {{- end }} pathType: Prefix backend: service: @@ -59,7 +63,11 @@ spec: {{ else }} - http: paths: - - path: {{ .Values.ingress.path }}/()?(.*) + {{- if .Values.ingress.path }} + - path: {{ .Values.ingress.path }}/?()?(.*) + {{- else }} + - path: /()?(.*) + {{- end }} pathType: Prefix backend: service: diff --git a/reportportal/templates/index-deployment.yaml b/reportportal/templates/index-deployment.yaml index 2f87a1c8..404909a4 100644 --- a/reportportal/templates/index-deployment.yaml +++ b/reportportal/templates/index-deployment.yaml @@ -29,6 +29,8 @@ spec: - env: - name: K8S_MODE value: "true" + - name: RESOURCE_PATH + value: {{ .Values.ingress.path }} ### Added for Skaffold local dev environment support {{ if .Values.serviceindex.image }} image: "{{ .Values.serviceindex.image }}" From 7fd79edf1e57d2724c0e68753062d65768282706 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 31 Oct 2022 13:14:40 +0300 Subject: [PATCH 03/26] Ingress path remove --- reportportal/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 81b0510b..4d1b28d1 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -426,8 +426,7 @@ ingress: hosts: - reportportal.k8.com # Application path as a prefix, should start from '/' and be without trailing '/' - # TODO: remove path before merge - path: "/reportportal" + path: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-redirect: "false" From b15f1b2b016e9252c336820b63c2c03109e1e0c7 Mon Sep 17 00:00:00 2001 From: raikbitters Date: Fri, 13 Oct 2023 14:37:07 +0400 Subject: [PATCH 04/26] Merge develop --- values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/values.yaml b/values.yaml index a98e86fa..5f3b6836 100644 --- a/values.yaml +++ b/values.yaml @@ -498,6 +498,8 @@ ingress: usedomainname: false # set to `true` if you have domian name hosts: - reportportal.k8.com + # Application path as a prefix, should start from '/' and be without trailing '/' + path: class: nginx annotations: nginx.ingress.kubernetes.io/ssl-redirect: "false" From 654bd4d6a39ed4005c05e1552cffa90b83967af3 Mon Sep 17 00:00:00 2001 From: hlebkanonik Date: Thu, 14 Mar 2024 18:38:21 +0100 Subject: [PATCH 05/26] added hostAliases for API --- .../templates/service-api/api-deployment.yaml | 10 ++++++++++ reportportal/values.yaml | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/reportportal/templates/service-api/api-deployment.yaml b/reportportal/templates/service-api/api-deployment.yaml index bfb4dede..96b06e69 100644 --- a/reportportal/templates/service-api/api-deployment.yaml +++ b/reportportal/templates/service-api/api-deployment.yaml @@ -20,6 +20,16 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} spec: + {{- with .Values.serviceapi.hostAliases }} + hostAliases: + {{- range . }} + - ip: "{{ .ip }}" + hostnames: + {{- range .hostnames }} + - "{{ . }}" + {{- end }} + {{- end }} + {{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/reportportal/values.yaml b/reportportal/values.yaml index d468f0f4..f06abdda 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -177,6 +177,18 @@ serviceapi: readOnly: true data: {} ## custom-pki.jks: + + ## @param serviceapi.hostAliases define the hosts and IP addresses for the Pod's /etc/hosts file. + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "foo.local" + # - "bar.local" + # - ip: "10.1.2.3" + # hostnames: + # - "foo.remote" + # - "bar.remote" + uat: name: uat From 71a357c1b8115e602611d88dcb025aeb4a2f709b Mon Sep 17 00:00:00 2001 From: hlebkanonik Date: Fri, 15 Mar 2024 11:48:36 +0100 Subject: [PATCH 06/26] hostAliases added for uat service --- .../service-authorization/uat-deployment.yaml | 10 ++++++++++ reportportal/values.yaml | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/reportportal/templates/service-authorization/uat-deployment.yaml b/reportportal/templates/service-authorization/uat-deployment.yaml index 83c4e8c2..9b97e376 100644 --- a/reportportal/templates/service-authorization/uat-deployment.yaml +++ b/reportportal/templates/service-authorization/uat-deployment.yaml @@ -20,6 +20,16 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} spec: + {{- with .Values.uat.hostAliases }} + hostAliases: + {{- range . }} + - ip: "{{ .ip }}" + hostnames: + {{- range .hostnames }} + - "{{ . }}" + {{- end }} + {{- end }} + {{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/reportportal/values.yaml b/reportportal/values.yaml index f06abdda..eb6cb2f9 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -271,6 +271,17 @@ uat: extraPorts: [] annotations: {} + ## @param uat.hostAliases define the hosts and IP addresses for the Pod's /etc/hosts file. + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "foo.local" + # - "bar.local" + # - ip: "10.1.2.3" + # hostnames: + # - "foo.remote" + # - "bar.remote" + servicejobs: name: jobs image: From 907aada9c091bae1aa830506dead9aa958dbeb72 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 22 Mar 2024 17:42:38 +0300 Subject: [PATCH 07/26] Add path variable --- .../templates/ingress/gateway-ingress.yaml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/reportportal/templates/ingress/gateway-ingress.yaml b/reportportal/templates/ingress/gateway-ingress.yaml index 96a1bbf1..55c8a7bd 100644 --- a/reportportal/templates/ingress/gateway-ingress.yaml +++ b/reportportal/templates/ingress/gateway-ingress.yaml @@ -1,6 +1,7 @@ {{- if .Values.ingress.enable }} {{- $fullName := include "reportportal.fullname" . -}} {{- $isTlsCertComplete := and .Values.ingress.tls.certificate.certificate .Values.ingress.tls.certificate.privateKey -}} +{{- $path := .Values.ingress.path -}} apiVersion: networking.k8s.io/v1 kind: Ingress @@ -49,8 +50,8 @@ spec: - host: {{ $host }} http: paths: - {{- if .Values.ingress.path }} - - path: {{ .Values.ingress.path }}/ + {{- if $path }} + - path: {{ $path }}/ {{- else }} - path: / {{- end }} @@ -60,21 +61,21 @@ spec: name: {{ $fullName }}-index port: name: {{ $.Values.serviceindex.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/ui + - path: {{ $path }}/ui pathType: Prefix backend: service: name: {{ $fullName }}-ui port: name: {{ $.Values.serviceui.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/uat + - path: {{ $path }}/uat pathType: Prefix backend: service: name: {{ $fullName }}-uat port: name: {{ $.Values.uat.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/api + - path: {{ $path }}/api pathType: Prefix backend: service: @@ -85,8 +86,8 @@ spec: {{- else }} - http: paths: - {{- if .Values.ingress.path }} - - path: {{ .Values.ingress.path }}/ + {{- if $path }} + - path: {{ $path }}/ {{- else }} - path: / {{- end }} @@ -96,21 +97,21 @@ spec: name: {{ $fullName }}-index port: name: {{ $.Values.serviceindex.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/ui + - path: {{ $path }}/ui pathType: Prefix backend: service: name: {{ $fullName }}-ui port: name: {{ $.Values.serviceui.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/uat + - path: {{ $path }}/uat pathType: Prefix backend: service: name: {{ $fullName }}-uat port: name: {{ $.Values.uat.service.portName | default "headless" }} - - path: {{ .Values.ingress.path }}/api + - path: {{ $path }}/api pathType: Prefix backend: service: From 654b7322a5bb741a74d98ed1cd285f807a970ce6 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 22 Mar 2024 17:55:37 +0300 Subject: [PATCH 08/26] Add path variable --- reportportal/templates/service-index/index-deployment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reportportal/templates/service-index/index-deployment.yaml b/reportportal/templates/service-index/index-deployment.yaml index cda4d48a..c406de17 100644 --- a/reportportal/templates/service-index/index-deployment.yaml +++ b/reportportal/templates/service-index/index-deployment.yaml @@ -1,3 +1,5 @@ +{{- $path := .Values.ingress.path -}} + apiVersion: apps/v1 kind: Deployment metadata: @@ -37,7 +39,7 @@ spec: - name: K8S_MODE value: "true" - name: RESOURCE_PATH - value: {{ .Values.ingress.path }} + value: {{ $path }} ports: - containerPort: 8080 protocol: TCP From f3594bd371198947a383bb68937c75f689838e6d Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 25 Mar 2024 13:11:49 +0300 Subject: [PATCH 09/26] Add path variables --- reportportal/templates/service-api/api-deployment.yaml | 9 +++++---- .../templates/service-authorization/uat-deployment.yaml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/reportportal/templates/service-api/api-deployment.yaml b/reportportal/templates/service-api/api-deployment.yaml index 96b06e69..ed21580b 100644 --- a/reportportal/templates/service-api/api-deployment.yaml +++ b/reportportal/templates/service-api/api-deployment.yaml @@ -1,3 +1,5 @@ +{{- $path := .Values.ingress.path -}} + apiVersion: apps/v1 kind: Deployment metadata: @@ -63,9 +65,8 @@ spec: {{- if .Values.serviceapi.extraEnvs }} {{ toYaml .Values.serviceapi.extraEnvs | indent 8 }} {{- end }} - # TODO: remove SERVER_SERVLET_CONTEXT_PATH after change base path in service-api - name: SERVER_SERVLET_CONTEXT_PATH - value: "/api" + value: "{{ $path }}/api" - name: RP_JOBS_BASEURL value: {{ ternary "https" "http" .Values.k8s.networking.ssl }}://{{ include "reportportal.fullname" . }}-jobs{{ printf ".%s.svc.cluster.local" .Release.Namespace }}:8686/jobs - name: COM_TA_REPORTPORTAL_JOB_INTERRUPT_BROKEN_LAUNCHES_CRON @@ -180,7 +181,7 @@ spec: {{- if .Values.serviceapi.readinessProbe.enabled }} readinessProbe: httpGet: - path: "/api/health" + path: "{{ $path }}/api/health" port: 8585 initialDelaySeconds: {{ .Values.serviceapi.readinessProbe.initialDelaySeconds | default 30 }} periodSeconds: {{ .Values.serviceapi.readinessProbe.periodSeconds | default 20 }} @@ -190,7 +191,7 @@ spec: {{- if .Values.serviceapi.livenessProbe.enabled }} livenessProbe: httpGet: - path: "/api/health" + path: "{{ $path }}/api/health" port: 8585 initialDelaySeconds: {{ .Values.serviceapi.livenessProbe.initialDelaySeconds | default 30 }} periodSeconds: {{ .Values.serviceapi.livenessProbe.periodSeconds | default 20 }} diff --git a/reportportal/templates/service-authorization/uat-deployment.yaml b/reportportal/templates/service-authorization/uat-deployment.yaml index 9b97e376..07c612ec 100644 --- a/reportportal/templates/service-authorization/uat-deployment.yaml +++ b/reportportal/templates/service-authorization/uat-deployment.yaml @@ -1,3 +1,5 @@ +{{- $path := .Values.ingress.path -}} + apiVersion: apps/v1 kind: Deployment metadata: @@ -69,9 +71,8 @@ spec: {{- if .Values.uat.extraEnvs }} {{ toYaml .Values.uat.extraEnvs | indent 8 }} {{- end }} - # TODO: remove SERVER_SERVLET_CONTEXT_PATH after change base path in service-authtorization - name: SERVER_SERVLET_CONTEXT_PATH - value: "/uat" + value: "{{ $path }}/uat" - name: RP_AMQP_PASS {{- if .Values.msgbroker.secretName }} valueFrom: @@ -162,7 +163,7 @@ spec: {{- if .Values.uat.readinessProbe.enabled }} readinessProbe: httpGet: - path: "/uat/health" + path: "{{ $path }}/uat/health" port: 9999 initialDelaySeconds: {{ .Values.uat.readinessProbe.initialDelaySeconds | default 60 }} periodSeconds: {{ .Values.uat.readinessProbe.periodSeconds | default 40 }} @@ -172,7 +173,7 @@ spec: {{- if .Values.uat.livenessProbe.enabled }} livenessProbe: httpGet: - path: "/uat/health" + path: "{{ $path }}/uat/health" port: 9999 initialDelaySeconds: {{ .Values.uat.livenessProbe.initialDelaySeconds | default 60 }} periodSeconds: {{ .Values.uat.livenessProbe.periodSeconds | default 40 }} From 79879631d99d8d9f7c8688e1c709c3defbf919c4 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 26 Mar 2024 12:28:16 +0300 Subject: [PATCH 10/26] Fix some comments --- reportportal/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 123f109a..2a8fa1d6 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -509,7 +509,7 @@ msgbroker: ## Virtual hosts provide logical grouping and separation of resources. Ref: https://www.rabbitmq.com/vhosts.html vhost: analyzer analyzerExchangeName: analyzer-default - ## @param msgbroker.ssl set to `true` if use HTTPS and AMQPS + ## @param msgbroker.ssl set to `true` if you want to use HTTPS and AMQPS ssl: false ## @param msgbroker.endpoint by default {{ .Release.Name }}-rabbitmq.{{ .Release.Namespace }}.svc.cluster.local endpoint: @@ -565,7 +565,7 @@ storage: ## Multi-bucket values bucketMultiPrefix: "prj-" bucketMultiPostfix: "" - ## @param storage.bucket.bucketMultiSaltName storing auth keystor + ## @param storage.bucket.bucketMultiSaltName storing auth keystore bucketMultiSaltName: "keystore" ## @section Ingress configuration @@ -577,6 +577,7 @@ storage: ## @param ingress.class set to `nginx` if you have nginx ingress controller. ## @param ingress.class set to `gce` if you want to use GCE ingress controller. ## @param ingress.class set to any other ingress controller name if you want to use it. +## @param ingress.path is an Application path as a prefix, should start from '/' and be without trailing '/'. Use to deploy ReportPortal to path, E.G. 'https://example.com/reportportal/' ## @param ingress.annotations.custom if you use other ingress controller set your annotations here. ## ## @param ingress.tls.certificates specify a list of predefined secret names for TLS certificates present in the same namespace @@ -592,7 +593,6 @@ storage: ingress: enable: true hosts: [] - # Application path as a prefix, should start from '/' and be without trailing '/' path: class: nginx annotations: From 40592e88ada0f184d7379e63e4cbb6433217bd02 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Wed, 10 Apr 2024 10:41:18 +0300 Subject: [PATCH 11/26] Action version update --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0e8b45f2..b12fe282 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 - name: Setup git credentials - uses: oleksiyrudenko/gha-git-credentials@v2 + uses: oleksiyrudenko/gha-git-credentials@v2-latest with: name: 'reportportal.io' email: 'support@reportportal.io' From 1774e114502b83df33105145a8d90c15d0c85711 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:47:53 +0200 Subject: [PATCH 12/26] Update uat-deployment.yaml (#377) --- .../templates/service-authorization/uat-deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reportportal/templates/service-authorization/uat-deployment.yaml b/reportportal/templates/service-authorization/uat-deployment.yaml index 07c612ec..c15a3368 100644 --- a/reportportal/templates/service-authorization/uat-deployment.yaml +++ b/reportportal/templates/service-authorization/uat-deployment.yaml @@ -195,7 +195,6 @@ spec: securityContext: {{ toYaml .Values.uat.securityContext | indent 8}} serviceAccountName: {{ .Values.uat.serviceAccountName | default (include "reportportal.serviceAccountName" .) }} - tolerations: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} @@ -205,4 +204,4 @@ spec: - name: {{ template "reportportal.name" . }}-uat-secret secret: secretName: {{ template "reportportal.name" . }}-uat-secret - {{- end }} \ No newline at end of file + {{- end }} From 0a1f6345c9f90fbabe2157dab86444160c532dc2 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:38:51 +0200 Subject: [PATCH 13/26] Update minikube-install.md --- docs/minikube-install.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/minikube-install.md b/docs/minikube-install.md index d9703dc7..010b50c2 100644 --- a/docs/minikube-install.md +++ b/docs/minikube-install.md @@ -20,7 +20,7 @@ ### Start Minikube ```bash -minikube start --cpus 4 --memory 4096 --addons ingress +minikube start --cpus 4 --memory 8192 --addons ingress ``` ### Set up hostnames @@ -28,11 +28,13 @@ minikube start --cpus 4 --memory 4096 --addons ingress Add the following line to your `/etc/hosts` file: ```bash -echo "$(minikube ip) reportportal.local" | sudo tee -a /etc/hosts +echo "$(minikube ip) minikube.local" | sudo tee -a /etc/hosts ``` ### Install ReportPortal +#### Install from Helm repo + ```bash helm repo add reportportal https://reportportal.io/kubernetes && helm repo update reportportal ``` @@ -40,14 +42,32 @@ helm repo add reportportal https://reportportal.io/kubernetes && helm repo updat ```bash export SUPERADMIN_PASSWORD=superadmin -helm install reportportal reportportal/reportportal \ - --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ - ${RELEASE_NAME} +helm install reportportal \ + reportportal/reportportal \ + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} +``` + +#### Install from GitHub repo + +Call the following commands from the downloaded [kubernetes](https://github.com/reportportal/kubernetes/) repository. + +```bash +# Dowload the chart dependencies +helm dependency build ./reportportal +``` + +```bash +# Install ReportPortal from ./reportportal/Chart.yaml +export SUPERADMIN_PASSWORD=superadmin + +helm install reportportal \ + ./reportportal + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} ``` ### Access ReportPortal -Open your browser and navigate to [http://reportportal.local](http://reportportal.local). +Open your browser and navigate to [http://reportportal.local](http://minikube.local). ## Clean up From 5d3d7fe6ce68de826ce241513e7e238e0b4d86c9 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:39:10 +0200 Subject: [PATCH 14/26] Update minikube-install.md --- docs/minikube-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/minikube-install.md b/docs/minikube-install.md index 010b50c2..9841b82f 100644 --- a/docs/minikube-install.md +++ b/docs/minikube-install.md @@ -61,7 +61,7 @@ helm dependency build ./reportportal export SUPERADMIN_PASSWORD=superadmin helm install reportportal \ - ./reportportal + ./reportportal \ --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} ``` From 2fe06d78a346b473bae138d80c5499c6a85e5ff9 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Wed, 22 May 2024 14:21:07 +0200 Subject: [PATCH 15/26] Add persistent volume storge support (#380) * Add templates for PV and PVC * Add values for config PV and PVC * Update GKE installation guide * Update Minikube installation guide --- docs/gke-install.md | 79 +++- docs/minikube-install.md | 41 +- .../templates/service-api/api-deployment.yaml | 400 +++++++++--------- .../service-authorization/uat-deployment.yaml | 325 +++++++------- .../service-jobs/jobs-deployment.yaml | 35 +- .../analyzer-statefulset.yaml | 13 +- .../analyzertrain-statefulset.yaml | 13 +- reportportal/templates/volumes/pv.yaml | 53 +++ reportportal/templates/volumes/pvc.yaml | 15 + reportportal/values.yaml | 38 +- 10 files changed, 644 insertions(+), 368 deletions(-) create mode 100644 reportportal/templates/volumes/pv.yaml create mode 100644 reportportal/templates/volumes/pvc.yaml diff --git a/docs/gke-install.md b/docs/gke-install.md index 5ebfeaa0..70b78fd6 100644 --- a/docs/gke-install.md +++ b/docs/gke-install.md @@ -113,6 +113,11 @@ gcloud container clusters create-auto ${CLUSTER_NAME} \ --location=${LOCATION} ``` +> **Note:** You can use the Google Filestore CSI driver for the Autopilot cluster. +> It is enabled by default. +> Minimal storage size for Google Filestore is 1 TB. +> Check the [pricing](https://cloud.google.com/filestore/pricing). + For more information about creating a cluster in Autopilot mode you can find [here](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-an-autopilot-cluster). @@ -120,18 +125,38 @@ For more information about creating a cluster in Autopilot mode you can find For a standard cluster you need to specify a machine type and a number of nodes. -ReportPortal requires at least 3 nodes with 2 vCPU and 4 GB memory for each. -We recommend using `e2-standard-2` machine type with 2 vCPU and 8 GB memory: +ReportPortal requires at least 3 nodes with 4 vCPU and 6 GB memory for each in +the Kubernetes with infrastructure dependencies. +We recommend using `custom-4-6144` machine type with 4 vCPU and 6 GB memory +as a minimal configuration. + +```bash + +If you want avoid using MinIO or Google Cloud Storage, you can use a filesystem storage type +and Google Filestore as a storage class. + +For this, you need to enable the `Google Filestore CSI driver` when creating a cluster: ```bash -export MACHINE_TYPE=e2-standard-2 +export MACHINE_TYPE=custom-4-6144 gcloud container clusters create ${CLUSTER_NAME} \ + --addons=GcpFilestoreCsiDriver \ --zone=${LOCATION} \ - --machine-type=${MACHINE_TYPE} \ - --num-nodes=3 + --machine-type=${MACHINE_TYPE} +``` + +or you can enable it after the cluster creation: + +```bash +gcloud container clusters update ${CLUSTER_NAME} \ + --update-addons=GcpFilestoreCsiDriver=ENABLED ``` +> **Note:** +> Minimal storage size for Google Filestore is 1 TB. +> Check the [pricing](https://cloud.google.com/filestore/pricing). + More information about creating a cluster in Standard mode you can find [here](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-zonal-cluster#gcloud). @@ -235,6 +260,30 @@ helm install \ --version ${VERSION} ``` +If you want to use Google Filestore instead of MinIO, you need to set +the `storage.type` to `filesystem`, `storage.volume.storageClassName` +to `standard-rwx`, and disable MinIO installation: + +```bash +helm install \ + --set ingress.class="gce" \ + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ + --set uat.resources.requests.memory="1Gi" \ + --set serviceapi.resources.requests.cpu="1000m" \ + --set serviceapi.resources.requests.memory="2Gi" \ + --set serviceanalyzer.resources.requests.memory="1Gi" \ + --set storage.type="filesystem" \ + --set storage.volume.storageClassName="standard-rwx" \ + --set minio.install=false \ + ${RELEASE_NAME} \ + oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + --version ${VERSION} +``` + +> **Note:** +> Minimal storage size for Google Filestore is 1 TB. +> Check the [pricing](https://cloud.google.com/filestore/pricing). + ### Install Helm chart on GKE Standard Cluster For installing ReportPortal on GKE Standard Cluster you need to set: @@ -251,6 +300,26 @@ helm install \ --version ${VERSION} ``` +If you want to use Google Filestore instead of MinIO, you need to set +the `storage.type` to `filesystem`, `storage.volume.storageClassName` +to `standard-rwx`, and disable MinIO installation: + +```bash +helm install \ + --set ingress.class="gce" \ + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ + --set storage.type="filesystem" \ + --set storage.volume.storageClassName="standard-rwx" \ + --set minio.install=false \ + ${RELEASE_NAME} \ + oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + --version ${VERSION} +``` + +> **Note:** +> Minimal storage size for Google Filestore is 1 TB. +> Check the [pricing](https://cloud.google.com/filestore/pricing). + ## Ingress configuration You can add custom gce ingress annotations via `ingress.annotations.gce` parameter: diff --git a/docs/minikube-install.md b/docs/minikube-install.md index 9841b82f..0f6a59dd 100644 --- a/docs/minikube-install.md +++ b/docs/minikube-install.md @@ -3,9 +3,12 @@ - [Install ReportPortal on Minikube](#install-reportportal-on-minikube) - [Prerequisites](#prerequisites) - [Installation](#installation) + - [Overview](#overview) - [Start Minikube](#start-minikube) - [Set up hostnames](#set-up-hostnames) - [Install ReportPortal](#install-reportportal) + - [Install from Helm repo](#install-from-helm-repo) + - [Install from GitHub repo](#install-from-github-repo) - [Access ReportPortal](#access-reportportal) - [Clean up](#clean-up) @@ -17,6 +20,17 @@ ## Installation +### Overview + +In this guide, we will install ReportPortal on Minikube using Helm with +ReportPortal's services and the following dependencies: + +- PostgreSQL +- OpenSearch +- RabbitMQ + +Instead of Minio, we will use a Persistent Volume as a filesystem storage. + ### Start Minikube ```bash @@ -42,6 +56,18 @@ helm repo add reportportal https://reportportal.io/kubernetes && helm repo updat ```bash export SUPERADMIN_PASSWORD=superadmin +helm install reportportal \ + reportportal/reportportal \ + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ + --set storage.type=filesystem \ + --set minio.install=false +``` + +If you want to use Minio as a storage: + +```bash +export SUPERADMIN_PASSWORD=superadmin + helm install reportportal \ reportportal/reportportal \ --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} @@ -49,10 +75,11 @@ helm install reportportal \ #### Install from GitHub repo -Call the following commands from the downloaded [kubernetes](https://github.com/reportportal/kubernetes/) repository. +Call the following commands from the downloaded +[kubernetes](https://github.com/reportportal/kubernetes/) repository. ```bash -# Dowload the chart dependencies +# Download the chart dependencies helm dependency build ./reportportal ``` @@ -60,6 +87,16 @@ helm dependency build ./reportportal # Install ReportPortal from ./reportportal/Chart.yaml export SUPERADMIN_PASSWORD=superadmin +helm install reportportal \ + ./reportportal \ + --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ + --set storage.type=filesystem \ + --set minio.install=false +``` + +If you want to use Minio as a storage: + +```bash helm install reportportal \ ./reportportal \ --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} diff --git a/reportportal/templates/service-api/api-deployment.yaml b/reportportal/templates/service-api/api-deployment.yaml index ed21580b..201456aa 100644 --- a/reportportal/templates/service-api/api-deployment.yaml +++ b/reportportal/templates/service-api/api-deployment.yaml @@ -1,5 +1,4 @@ {{- $path := .Values.ingress.path -}} - apiVersion: apps/v1 kind: Deployment metadata: @@ -22,226 +21,243 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} spec: - {{- with .Values.serviceapi.hostAliases }} + {{- with .Values.serviceapi.hostAliases }} hostAliases: {{- range . }} - ip: "{{ .ip }}" - hostnames: + hostnames: {{- range .hostnames }} - "{{ . }}" {{- end }} {{- end }} - {{- end }} - {{- with .Values.imagePullSecrets }} + {{- end }} + {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} initContainers: - - name: migrations-waiting-init - image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}" - imagePullPolicy: IfNotPresent - args: - - "job-wr" - - {{ include "reportportal.fullname" . }}-migrations - resources: - requests: - cpu: 50m - memory: 100Mi - limits: - cpu: 50m - memory: 100Mi -{{- if .Values.extraInitContainers }} -{{ toYaml .Values.extraInitContainers | indent 8 }} -{{- end }} + - name: migrations-waiting-init + image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}" + imagePullPolicy: IfNotPresent + args: + - "job-wr" + - {{ include "reportportal.fullname" . }}-migrations + resources: + requests: + cpu: 50m + memory: 100Mi + limits: + cpu: 50m + memory: 100Mi + {{- if .Values.extraInitContainers }} + {{ toYaml .Values.extraInitContainers | nindent 8 }} + {{- end }} containers: - - name: "{{ $.Values.serviceapi.name | default "api" }}" - image: "{{ .Values.serviceapi.image.repository }}:{{ .Values.serviceapi.image.tag }}" - imagePullPolicy: "{{ .Values.serviceapi.pullPolicy }}" - ports: - - containerPort: 8585 - protocol: TCP - resources: {{- toYaml .Values.serviceapi.resources | nindent 10 }} - env: -{{- if .Values.serviceapi.extraEnvs }} -{{ toYaml .Values.serviceapi.extraEnvs | indent 8 }} -{{- end }} - - name: SERVER_SERVLET_CONTEXT_PATH - value: "{{ $path }}/api" - - name: RP_JOBS_BASEURL - value: {{ ternary "https" "http" .Values.k8s.networking.ssl }}://{{ include "reportportal.fullname" . }}-jobs{{ printf ".%s.svc.cluster.local" .Release.Namespace }}:8686/jobs - - name: COM_TA_REPORTPORTAL_JOB_INTERRUPT_BROKEN_LAUNCHES_CRON - value: "{{ .Values.serviceapi.cronJobs.interruptBrockenLaunches }}" - - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_BATCH-SIZE - value: "{{ .Values.serviceapi.patternAnalysis.batchSize }}" - - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_PREFETCH-COUNT - value: "{{ .Values.serviceapi.patternAnalysis.prefetchCount }}" - - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_CONSUMERS-COUNT - value: "{{ .Values.serviceapi.patternAnalysis.consumersCount }}" - {{- if .Values.serviceapi.auditLogs.enable }} - - name: AUDIT_LOGGER - value: "{{ .Values.serviceapi.auditLogs.loglevel }}" - {{- end }} - - name: RP_ENVIRONMENT_VARIABLE_ALLOW_DELETE_ACCOUNT - value: "{{ .Values.serviceapi.allowDeleteAccount }}" - {{- if .Values.searchengine.doubleEntry.enable }} - - name: RP_ELASTICSEARCH_HOST - value: "{{ ternary "https" "http" .Values.searchengine.ssl }}://{{ .Values.searchengine.endpoint | default (printf "opensearch-cluster-master.%s.svc.cluster.local" .Release.Namespace) }}:{{ .Values.searchengine.port }}" - {{- end }} - - name: LOGGING_LEVEL_ORG_HIBERNATE_SQL - value: "info" - - name: RP_REQUESTLOGGING - value: "false" - - name: RP_AMQP_QUEUES - value: {{ .Values.serviceapi.queues.totalNumber | default "10" | quote }} - - name: RP_AMQP_QUEUESPERPOD - value: {{ .Values.serviceapi.queues.perPodNumber | default "10" | quote }} - {{- if .Values.serviceapi.jvmArgs }} - - name: JAVA_OPTS - value: "{{ .Values.serviceapi.jvmArgs }}" - {{- end }} - - name: RP_AMQP_ANALYZER-VHOST - value: "{{ .Values.msgbroker.vhost }}" - - name: RP_AMQP_PASS - {{- if .Values.msgbroker.secretName }} - valueFrom: - secretKeyRef: - name: "{{ .Values.msgbroker.secretName }}" - key: "rabbitmq-password" - {{- else }} - value: "{{ .Values.msgbroker.password }}" - {{- end }} - - name: RP_AMQP_API_ADDRESS - value: {{ ternary "https" "http" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.apiuser }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.apiport }}/api - - name: RP_AMQP_ADDRESSES - value: '{{ ternary "amqps" "amqp" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.user }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.port }}' - - name: RP_DB_HOST - value: {{ .Values.database.endpoint | default (printf "%s-postgresql.%s.svc.cluster.local" .Release.Name .Release.Namespace) }} - - name: RP_DB_PORT - value: "{{ .Values.database.port }}" - - name: RP_DB_NAME - value: "{{ .Values.database.dbName }}" - {{- if .Values.database.connections }} - - name: RP_DATASOURCE_MAXIMUMPOOLSIZE - value: "{{ .Values.database.connections }}" - {{- end }} - - name: RP_DB_USER - value: "{{ .Values.database.user }}" - - name: RP_DB_PASS - {{- if .Values.database.secretName }} - valueFrom: - secretKeyRef: - name: "{{ .Values.database.secretName }}" - key: "postgresql-password" - {{- else }} - value: "{{ .Values.database.password }}" - {{- end }} - {{- if eq .Values.storage.bucket.type "single" }} - - name: RP_FEATURE_FLAGS - value: "singleBucket" - {{- end }} - - name: DATASTORE_TYPE - value: "{{ .Values.storage.type }}" - {{- if eq .Values.storage.type "minio" }} - - name: DATASTORE_ENDPOINT - value: "{{ ternary "https" "http" .Values.storage.ssl }}://{{ .Values.storage.endpoint | default (printf "%s-minio.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.storage.port }}" - {{- end }} - {{- if .Values.storage.region }} - - name: DATASTORE_REGION - value: "{{ .Values.storage.region }}" - {{- end }} - {{- if .Values.storage.secretName }} - - name: DATASTORE_ACCESSKEY - valueFrom: - secretKeyRef: - name: "{{ .Values.storage.secretName }}" - key: "{{ .Values.storage.accesskeyName }}" - - name: DATASTORE_SECRETKEY - valueFrom: - secretKeyRef: - name: "{{ .Values.storage.secretName }}" - key: "{{ .Values.storage.secretkeyName }}" - {{- else }} - - name: DATASTORE_ACCESSKEY - value: "{{ .Values.storage.accesskey }}" - - name: DATASTORE_SECRETKEY - value: "{{ .Values.storage.secretkey }}" - {{- end }} - {{- if eq .Values.storage.bucket.type "multi" }} - - name: DATASTORE_BUCKETPREFIX - value: "{{ .Values.storage.bucket.bucketMultiPrefix }}" - - name: DATASTORE_BUCKETPOSTFIX - value: "{{ .Values.storage.bucket.bucketMultiPostfix }}" - - name: RP_INTEGRATION_SALT_PATH - value: "{{ .Values.storage.bucket.bucketMultiSaltName }}" - {{- end }} - - name: DATASTORE_DEFAULTBUCKETNAME - value: "{{ .Values.storage.bucket.bucketDefaultName }}" - - name: MANAGEMENT_HEALTH_ELASTICSEARCH_ENABLED - value: "false" - {{- if .Values.serviceapi.readinessProbe.enabled }} - readinessProbe: - httpGet: - path: "{{ $path }}/api/health" - port: 8585 - initialDelaySeconds: {{ .Values.serviceapi.readinessProbe.initialDelaySeconds | default 30 }} - periodSeconds: {{ .Values.serviceapi.readinessProbe.periodSeconds | default 20 }} - timeoutSeconds: {{ .Values.serviceapi.readinessProbe.timeoutSeconds | default 3 }} - failureThreshold: {{ .Values.serviceapi.readinessProbe.failureThreshold | default 20 }} + - name: "{{ $.Values.serviceapi.name | default "api" }}" + image: "{{ .Values.serviceapi.image.repository }}:{{ .Values.serviceapi.image.tag }}" + imagePullPolicy: "{{ .Values.serviceapi.pullPolicy }}" + ports: + - containerPort: 8585 + protocol: TCP + resources: + {{- toYaml .Values.serviceapi.resources | nindent 12 }} + env: + {{- if .Values.serviceapi.extraEnvs }} + {{ toYaml .Values.serviceapi.extraEnvs | nindent 12 }} + {{- end }} + - name: SERVER_SERVLET_CONTEXT_PATH + value: "{{ $path }}/api" + - name: RP_JOBS_BASEURL + value: {{ ternary "https" "http" .Values.k8s.networking.ssl }}://{{ include "reportportal.fullname" . }}-jobs{{ printf ".%s.svc.cluster.local" .Release.Namespace }}:8686/jobs + - name: COM_TA_REPORTPORTAL_JOB_INTERRUPT_BROKEN_LAUNCHES_CRON + value: "{{ .Values.serviceapi.cronJobs.interruptBrockenLaunches }}" + - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_BATCH-SIZE + value: "{{ .Values.serviceapi.patternAnalysis.batchSize }}" + - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_PREFETCH-COUNT + value: "{{ .Values.serviceapi.patternAnalysis.prefetchCount }}" + - name: RP_ENVIRONMENT_VARIABLE_PATTERN-ANALYSIS_CONSUMERS-COUNT + value: "{{ .Values.serviceapi.patternAnalysis.consumersCount }}" + {{- if .Values.serviceapi.auditLogs.enable }} + - name: AUDIT_LOGGER + value: "{{ .Values.serviceapi.auditLogs.loglevel }}" + {{- end }} + - name: RP_ENVIRONMENT_VARIABLE_ALLOW_DELETE_ACCOUNT + value: "{{ .Values.serviceapi.allowDeleteAccount }}" + {{- if .Values.searchengine.doubleEntry.enable }} + - name: RP_ELASTICSEARCH_HOST + value: "{{ ternary "https" "http" .Values.searchengine.ssl }}://{{ .Values.searchengine.endpoint | default (printf "opensearch-cluster-master.%s.svc.cluster.local" .Release.Namespace) }}:{{ .Values.searchengine.port }}" + {{- end }} + - name: LOGGING_LEVEL_ORG_HIBERNATE_SQL + value: "info" + - name: RP_REQUESTLOGGING + value: "false" + {{- if .Values.serviceapi.jvmArgs }} + - name: JAVA_OPTS + value: "{{ .Values.serviceapi.jvmArgs }}" + {{- end }} + # AMQP settings + - name: RP_AMQP_QUEUES + value: {{ .Values.serviceapi.queues.totalNumber | default "10" | quote }} + - name: RP_AMQP_QUEUESPERPOD + value: {{ .Values.serviceapi.queues.perPodNumber | default "10" | quote }} + - name: RP_AMQP_ANALYZER-VHOST + value: "{{ .Values.msgbroker.vhost }}" + - name: RP_AMQP_PASS + {{- if .Values.msgbroker.secretName }} + valueFrom: + secretKeyRef: + name: "{{ .Values.msgbroker.secretName }}" + key: "rabbitmq-password" + {{- else }} + value: "{{ .Values.msgbroker.password }}" + {{- end }} + - name: RP_AMQP_API_ADDRESS + value: {{ ternary "https" "http" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.apiuser }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.apiport }}/api + - name: RP_AMQP_ADDRESSES + value: {{ ternary "amqps" "amqp" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.user }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.port }} + # Database settings + - name: RP_DB_HOST + value: {{ .Values.database.endpoint | default (printf "%s-postgresql.%s.svc.cluster.local" .Release.Name .Release.Namespace) }} + - name: RP_DB_PORT + value: "{{ .Values.database.port }}" + - name: RP_DB_NAME + value: "{{ .Values.database.dbName }}" + {{- if .Values.database.connections }} + - name: RP_DATASOURCE_MAXIMUMPOOLSIZE + value: "{{ .Values.database.connections }}" + {{- end }} + - name: RP_DB_USER + value: "{{ .Values.database.user }}" + - name: RP_DB_PASS + {{- if .Values.database.secretName }} + valueFrom: + secretKeyRef: + name: "{{ .Values.database.secretName }}" + key: "postgresql-password" + {{- else }} + value: "{{ .Values.database.password }}" + {{- end }} + # Storage settings + - name: DATASTORE_TYPE + value: "{{ .Values.storage.type }}" + # Minio/S3 settings + {{- if or (eq .Values.storage.type "minio") (eq .Values.storage.type "s3") }} + {{- if eq .Values.storage.type "minio" }} + - name: DATASTORE_ENDPOINT + value: "{{ ternary "https" "http" .Values.storage.ssl }}://{{ .Values.storage.endpoint | default (printf "%s-minio.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.storage.port }}" + {{- end }} + {{- if .Values.storage.region }} + - name: DATASTORE_REGION + value: "{{ .Values.storage.region }}" + {{- end }} + {{- if .Values.storage.secretName }} + - name: DATASTORE_ACCESSKEY + valueFrom: + secretKeyRef: + name: "{{ .Values.storage.secretName }}" + key: "{{ .Values.storage.accesskeyName }}" + - name: DATASTORE_SECRETKEY + valueFrom: + secretKeyRef: + name: "{{ .Values.storage.secretName }}" + key: "{{ .Values.storage.secretkeyName }}" + {{- else }} + - name: DATASTORE_ACCESSKEY + value: "{{ .Values.storage.accesskey }}" + - name: DATASTORE_SECRETKEY + value: "{{ .Values.storage.secretkey }}" + {{- end }} + {{- if eq .Values.storage.bucket.type "single" }} + - name: RP_FEATURE_FLAGS + value: "singleBucket" + {{- end }} + {{- if eq .Values.storage.bucket.type "multi" }} + - name: DATASTORE_BUCKETPREFIX + value: "{{ .Values.storage.bucket.bucketMultiPrefix }}" + - name: DATASTORE_BUCKETPOSTFIX + value: "{{ .Values.storage.bucket.bucketMultiPostfix }}" + - name: RP_INTEGRATION_SALT_PATH + value: "{{ .Values.storage.bucket.bucketMultiSaltName }}" + {{- end }} + - name: DATASTORE_DEFAULTBUCKETNAME + value: "{{ .Values.storage.bucket.bucketDefaultName }}" {{- end }} + - name: MANAGEMENT_HEALTH_ELASTICSEARCH_ENABLED + value: "false" + {{- if .Values.serviceapi.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: "{{ $path }}/api/health" + port: 8585 + initialDelaySeconds: {{ .Values.serviceapi.readinessProbe.initialDelaySeconds | default 30 }} + periodSeconds: {{ .Values.serviceapi.readinessProbe.periodSeconds | default 20 }} + timeoutSeconds: {{ .Values.serviceapi.readinessProbe.timeoutSeconds | default 3 }} + failureThreshold: {{ .Values.serviceapi.readinessProbe.failureThreshold | default 20 }} + {{- end }} {{- if .Values.serviceapi.livenessProbe.enabled }} - livenessProbe: - httpGet: - path: "{{ $path }}/api/health" - port: 8585 - initialDelaySeconds: {{ .Values.serviceapi.livenessProbe.initialDelaySeconds | default 30 }} - periodSeconds: {{ .Values.serviceapi.livenessProbe.periodSeconds | default 20 }} - timeoutSeconds: {{ .Values.serviceapi.livenessProbe.timeoutSeconds | default 5 }} - failureThreshold: {{ .Values.serviceapi.livenessProbe.failureThreshold | default 5 }} + livenessProbe: + httpGet: + path: "{{ $path }}/api/health" + port: 8585 + initialDelaySeconds: {{ .Values.serviceapi.livenessProbe.initialDelaySeconds | default 30 }} + periodSeconds: {{ .Values.serviceapi.livenessProbe.periodSeconds | default 20 }} + timeoutSeconds: {{ .Values.serviceapi.livenessProbe.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.serviceapi.livenessProbe.failureThreshold | default 5 }} {{- end }} - volumeMounts: + volumeMounts: {{- if .Values.serviceapi.secret.enabled }} - - mountPath: {{ .Values.serviceapi.secret.mountPath }} - name: {{ template "reportportal.name" . }}-serviceapi-secret - readOnly: {{ .Values.serviceapi.secret.readOnly }} + - name: {{ template "reportportal.name" . }}-serviceapi-secret + mountPath: {{ .Values.serviceapi.secret.mountPath }} + readOnly: {{ .Values.serviceapi.secret.readOnly }} {{- end }} {{- if .Values.serviceapi.auditLogs.enable }} - - name: audit-log-volume - mountPath: /var/log + - name: audit-log-volume + mountPath: /var/log + {{- end }} + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + mountPath: /data/storage {{- end }} {{- if .Values.serviceapi.auditLogs.enable }} - - name: auditlogstreamer - image: "{{ .Values.serviceapi.auditLogs.sidecar.image.repository }}:{{ .Values.serviceapi.auditLogs.sidecar.image.tag }}" - command: - - /bin/sh - args: - - -c - - while true; do if [ -e "/var/log/reportportal/audit.log" ]; then tail -f /var/log/reportportal/audit.log; else sleep 60; fi; done - imagePullPolicy: IfNotPresent - resources: {{- toYaml .Values.serviceapi.auditLogs.sidecar.resources | nindent 10 }} - volumeMounts: - - name: audit-log-volume - mountPath: /var/log + - name: auditlogstreamer + image: "{{ .Values.serviceapi.auditLogs.sidecar.image.repository }}:{{ .Values.serviceapi.auditLogs.sidecar.image.tag }}" + command: + - /bin/sh + args: + - -c + - while true; do if [ -e "/var/log/reportportal/audit.log" ]; then tail -f /var/log/reportportal/audit.log; else sleep 60; fi; done + imagePullPolicy: IfNotPresent + resources: + {{- toYaml .Values.serviceapi.auditLogs.sidecar.resources | nindent 12 }} + volumeMounts: + - name: audit-log-volume + mountPath: /var/log {{- end }} -{{- if .Values.serviceapi.nodeSelector }} + {{- if .Values.serviceapi.nodeSelector }} nodeSelector: {{- range $key, $value := .Values.serviceapi.nodeSelector }} {{ $key }}: {{ $value | quote }} {{- end }} -{{- end }} + {{- end }} securityContext: -{{- toYaml .Values.serviceapi.securityContext | indent 8 }} + {{- toYaml .Values.serviceapi.securityContext | nindent 8 }} serviceAccountName: {{ .Values.serviceapi.serviceAccountName | default (include "reportportal.serviceAccountName" .) }} -{{- with .Values.tolerations }} + {{- with .Values.tolerations }} tolerations: -{{- toYaml . | nindent 8 }} -{{- end }} + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - {{- if .Values.serviceapi.secret.enabled }} + {{- if .Values.serviceapi.secret.enabled }} - name: {{ template "reportportal.name" . }}-serviceapi-secret secret: secretName: {{ template "reportportal.name" . }}-serviceapi-secret - {{- end }} - {{- if .Values.serviceapi.auditLogs.enable }} + {{- end }} + {{- if .Values.serviceapi.auditLogs.enable }} - name: audit-log-volume - emptyDir: {} - {{- end }} \ No newline at end of file + emptyDir: { } + {{- end }} + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-shared-volume-claim + {{- end }} \ No newline at end of file diff --git a/reportportal/templates/service-authorization/uat-deployment.yaml b/reportportal/templates/service-authorization/uat-deployment.yaml index c15a3368..4f80f434 100644 --- a/reportportal/templates/service-authorization/uat-deployment.yaml +++ b/reportportal/templates/service-authorization/uat-deployment.yaml @@ -22,186 +22,199 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} spec: - {{- with .Values.uat.hostAliases }} + {{- with .Values.uat.hostAliases }} hostAliases: {{- range . }} - ip: "{{ .ip }}" - hostnames: + hostnames: {{- range .hostnames }} - "{{ . }}" {{- end }} {{- end }} - {{- end }} - {{- with .Values.imagePullSecrets }} + {{- end }} + {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} initContainers: - - name: migrations-waiting-init - image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}" - imagePullPolicy: IfNotPresent - args: - - "job-wr" - - {{ include "reportportal.fullname" . }}-migrations - resources: - requests: - cpu: 50m - memory: 100Mi - limits: - cpu: 50m - memory: 100Mi -{{- if .Values.extraInitContainers }} -{{ toYaml .Values.extraInitContainers | indent 8 }} -{{- end }} + - name: migrations-waiting-init + image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}" + imagePullPolicy: IfNotPresent + args: + - "job-wr" + - {{ include "reportportal.fullname" . }}-migrations + resources: + requests: + cpu: 50m + memory: 100Mi + limits: + cpu: 50m + memory: 100Mi + {{- if .Values.extraInitContainers }} + {{ toYaml .Values.extraInitContainers | nindent 8 }} + {{- end }} containers: - - name: "{{ $.Values.uat.name | default "uat" }}" - image: "{{ .Values.uat.image.repository }}:{{ .Values.uat.image.tag }}" - imagePullPolicy: "{{ .Values.uat.pullPolicy }}" - ports: - - containerPort: 9999 - protocol: TCP - resources: - requests: - cpu: {{ .Values.uat.resources.requests.cpu }} - memory: {{ .Values.uat.resources.requests.memory }} - limits: - cpu: {{ .Values.uat.resources.limits.cpu }} - memory: {{ .Values.uat.resources.limits.memory }} - env: -{{- if .Values.uat.extraEnvs }} -{{ toYaml .Values.uat.extraEnvs | indent 8 }} -{{- end }} - - name: SERVER_SERVLET_CONTEXT_PATH - value: "{{ $path }}/uat" - - name: RP_AMQP_PASS - {{- if .Values.msgbroker.secretName }} - valueFrom: - secretKeyRef: - name: "{{ .Values.msgbroker.secretName }}" - key: "rabbitmq-password" - {{- else }} - value: "{{ .Values.msgbroker.password }}" - {{- end }} - - name: RP_AMQP_ADDRESSES - value: '{{ ternary "amqps" "amqp" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.user }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.port }}' - {{- if .Values.uat.superadminInitPasswd.secretName }} - - name: RP_INITIAL_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: "{{ .Values.uat.superadminInitPasswd.secretName }}" - key: "{{ .Values.uat.superadminInitPasswd.passwordKeyName }}" - {{ else }} - - name: RP_INITIAL_ADMIN_PASSWORD - value: "{{ .Values.uat.superadminInitPasswd.password }}" - {{- end }} - - name: RP_SAML_SESSION-LIVE - value: "{{ .Values.uat.samlSessionLiveTime }}" - {{- if .Values.uat.jvmArgs }} - - name: JAVA_OPTS - value: "{{ .Values.uat.jvmArgs }}" - {{- end }} - - name: RP_SESSION_LIVE - value: "{{ .Values.uat.sessionLiveTime }}" - - name: RP_DB_HOST - value: {{ .Values.database.endpoint | default (printf "%s-postgresql.%s.svc.cluster.local" .Release.Name .Release.Namespace) }} - - name: RP_DB_PORT - value: "{{ .Values.database.port }}" - - name: RP_DB_NAME - value: "{{ .Values.database.dbName }}" - - name: RP_DB_USER - value: "{{ .Values.database.user }}" - - name: RP_DB_PASS - {{- if .Values.database.secretName }} - valueFrom: - secretKeyRef: - name: "{{ .Values.database.secretName }}" - key: "postgresql-password" - {{- else }} - value: "{{ .Values.database.password }}" - {{- end }} - {{- if eq .Values.storage.bucket.type "single" }} - - name: RP_FEATURE_FLAGS - value: "singleBucket" - {{- end }} - - name: DATASTORE_TYPE - value: "{{ .Values.storage.type }}" - {{- if eq .Values.storage.type "minio" }} - - name: DATASTORE_ENDPOINT - value: "{{ ternary "https" "http" .Values.storage.ssl }}://{{ .Values.storage.endpoint | default (printf "%s-minio.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.storage.port }}" - {{- end }} - {{- if .Values.storage.region }} - - name: DATASTORE_REGION - value: "{{ .Values.storage.region }}" + - name: "{{ $.Values.uat.name | default "uat" }}" + image: "{{ .Values.uat.image.repository }}:{{ .Values.uat.image.tag }}" + imagePullPolicy: "{{ .Values.uat.pullPolicy }}" + ports: + - containerPort: 9999 + protocol: TCP + resources: + requests: + cpu: {{ .Values.uat.resources.requests.cpu }} + memory: {{ .Values.uat.resources.requests.memory }} + limits: + cpu: {{ .Values.uat.resources.limits.cpu }} + memory: {{ .Values.uat.resources.limits.memory }} + env: + {{- if .Values.uat.extraEnvs }} + {{ toYaml .Values.uat.extraEnvs | nindent 12 }} + {{- end }} + - name: SERVER_SERVLET_CONTEXT_PATH + value: "{{ $path }}/uat" + - name: RP_AMQP_PASS + {{- if .Values.msgbroker.secretName }} + valueFrom: + secretKeyRef: + name: "{{ .Values.msgbroker.secretName }}" + key: "rabbitmq-password" + {{- else }} + value: "{{ .Values.msgbroker.password }}" + {{- end }} + - name: RP_AMQP_ADDRESSES + value: '{{ ternary "amqps" "amqp" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.user }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.port }}' + {{- if .Values.uat.superadminInitPasswd.secretName }} + - name: RP_INITIAL_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Values.uat.superadminInitPasswd.secretName }}" + key: "{{ .Values.uat.superadminInitPasswd.passwordKeyName }}" + {{ else }} + - name: RP_INITIAL_ADMIN_PASSWORD + value: "{{ .Values.uat.superadminInitPasswd.password }}" + {{- end }} + - name: RP_SAML_SESSION-LIVE + value: "{{ .Values.uat.samlSessionLiveTime }}" + {{- if .Values.uat.jvmArgs }} + - name: JAVA_OPTS + value: "{{ .Values.uat.jvmArgs }}" + {{- end }} + - name: RP_SESSION_LIVE + value: "{{ .Values.uat.sessionLiveTime }}" + - name: RP_DB_HOST + value: {{ .Values.database.endpoint | default (printf "%s-postgresql.%s.svc.cluster.local" .Release.Name .Release.Namespace) }} + - name: RP_DB_PORT + value: "{{ .Values.database.port }}" + - name: RP_DB_NAME + value: "{{ .Values.database.dbName }}" + - name: RP_DB_USER + value: "{{ .Values.database.user }}" + - name: RP_DB_PASS + {{- if .Values.database.secretName }} + valueFrom: + secretKeyRef: + name: "{{ .Values.database.secretName }}" + key: "postgresql-password" + {{- else }} + value: "{{ .Values.database.password }}" + {{- end }} + # Datastore settings + - name: DATASTORE_TYPE + value: "{{ .Values.storage.type }}" + # Minio/S3 settings + {{- if or (eq .Values.storage.type "minio") (eq .Values.storage.type "s3") }} + {{- if eq .Values.storage.type "minio" }} + - name: DATASTORE_ENDPOINT + value: "{{ ternary "https" "http" .Values.storage.ssl }}://{{ .Values.storage.endpoint | default (printf "%s-minio.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.storage.port }}" + {{- end }} + {{- if .Values.storage.region }} + - name: DATASTORE_REGION + value: "{{ .Values.storage.region }}" + {{- end }} + {{- if .Values.storage.secretName }} + - name: DATASTORE_ACCESSKEY + valueFrom: + secretKeyRef: + name: "{{ .Values.storage.secretName }}" + key: "{{ .Values.storage.accesskeyName }}" + - name: DATASTORE_SECRETKEY + valueFrom: + secretKeyRef: + name: "{{ .Values.storage.secretName }}" + key: "{{ .Values.storage.secretkeyName }}" + {{- else }} + - name: DATASTORE_ACCESSKEY + value: "{{ .Values.storage.accesskey }}" + - name: DATASTORE_SECRETKEY + value: "{{ .Values.storage.secretkey }}" + {{- end }} + {{- if eq .Values.storage.bucket.type "single" }} + - name: RP_FEATURE_FLAGS + value: "singleBucket" + {{- end }} + {{- if eq .Values.storage.bucket.type "multi" }} + - name: DATASTORE_BUCKETPREFIX + value: "{{ .Values.storage.bucket.bucketMultiPrefix }}" + - name: DATASTORE_BUCKETPOSTFIX + value: "{{ .Values.storage.bucket.bucketMultiPostfix }}" + - name: RP_INTEGRATION_SALT_PATH + value: "{{ .Values.storage.bucket.bucketMultiSaltName }}" + {{- end }} + - name: DATASTORE_DEFAULTBUCKETNAME + value: "{{ .Values.storage.bucket.bucketDefaultName }}" {{- end }} - {{- if .Values.storage.secretName }} - - name: DATASTORE_ACCESSKEY - valueFrom: - secretKeyRef: - name: "{{ .Values.storage.secretName }}" - key: "{{ .Values.storage.accesskeyName }}" - - name: DATASTORE_SECRETKEY - valueFrom: - secretKeyRef: - name: "{{ .Values.storage.secretName }}" - key: "{{ .Values.storage.secretkeyName }}" - {{- else }} - - name: DATASTORE_ACCESSKEY - value: "{{ .Values.storage.accesskey }}" - - name: DATASTORE_SECRETKEY - value: "{{ .Values.storage.secretkey }}" - {{- end }} - {{- if eq .Values.storage.bucket.type "multi" }} - - name: DATASTORE_BUCKETPREFIX - value: "{{ .Values.storage.bucket.bucketMultiPrefix }}" - - name: DATASTORE_BUCKETPOSTFIX - value: "{{ .Values.storage.bucket.bucketMultiPostfix }}" - - name: RP_INTEGRATION_SALT_PATH - value: "{{ .Values.storage.bucket.bucketMultiSaltName }}" - {{- end }} - - name: DATASTORE_DEFAULTBUCKETNAME - value: "{{ .Values.storage.bucket.bucketDefaultName }}" {{- if .Values.uat.readinessProbe.enabled }} - readinessProbe: - httpGet: - path: "{{ $path }}/uat/health" - port: 9999 - initialDelaySeconds: {{ .Values.uat.readinessProbe.initialDelaySeconds | default 60 }} - periodSeconds: {{ .Values.uat.readinessProbe.periodSeconds | default 40 }} - timeoutSeconds: {{ .Values.uat.readinessProbe.timeoutSeconds | default 5 }} - failureThreshold: {{ .Values.uat.readinessProbe.failureThreshold | default 10 }} - {{- end }} + readinessProbe: + httpGet: + path: "{{ $path }}/uat/health" + port: 9999 + initialDelaySeconds: {{ .Values.uat.readinessProbe.initialDelaySeconds | default 60 }} + periodSeconds: {{ .Values.uat.readinessProbe.periodSeconds | default 40 }} + timeoutSeconds: {{ .Values.uat.readinessProbe.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.uat.readinessProbe.failureThreshold | default 10 }} + {{- end }} {{- if .Values.uat.livenessProbe.enabled }} - livenessProbe: - httpGet: - path: "{{ $path }}/uat/health" - port: 9999 - initialDelaySeconds: {{ .Values.uat.livenessProbe.initialDelaySeconds | default 60 }} - periodSeconds: {{ .Values.uat.livenessProbe.periodSeconds | default 40 }} - timeoutSeconds: {{ .Values.uat.livenessProbe.timeoutSeconds | default 5 }} - failureThreshold: {{ .Values.uat.livenessProbe.failureThreshold | default 10 }} + livenessProbe: + httpGet: + path: "{{ $path }}/uat/health" + port: 9999 + initialDelaySeconds: {{ .Values.uat.livenessProbe.initialDelaySeconds | default 60 }} + periodSeconds: {{ .Values.uat.livenessProbe.periodSeconds | default 40 }} + timeoutSeconds: {{ .Values.uat.livenessProbe.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.uat.livenessProbe.failureThreshold | default 10 }} {{- end }} - volumeMounts: + volumeMounts: {{- if .Values.uat.secret.enabled }} - - mountPath: {{ .Values.uat.secret.mountPath }} - name: {{ template "reportportal.name" . }}-uat-secret - readOnly: {{ .Values.uat.secret.readOnly }} + - name: {{ template "reportportal.name" . }}-uat-secret + mountPath: {{ .Values.uat.secret.mountPath }} + readOnly: {{ .Values.uat.secret.readOnly }} + {{- end }} + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + mountPath: /data/storage {{- end }} -{{- if .Values.uat.nodeSelector }} + {{- if .Values.uat.nodeSelector }} nodeSelector: {{- range $key, $value := .Values.uat.nodeSelector }} {{ $key }}: {{ $value | quote }} {{- end }} -{{- end }} + {{- end }} securityContext: -{{ toYaml .Values.uat.securityContext | indent 8}} + {{ toYaml .Values.uat.securityContext | nindent 8}} serviceAccountName: {{ .Values.uat.serviceAccountName | default (include "reportportal.serviceAccountName" .) }} -{{- with .Values.tolerations }} - tolerations: -{{- toYaml . | nindent 8 }} -{{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - {{- if .Values.uat.secret.enabled }} + {{- if .Values.uat.secret.enabled }} - name: {{ template "reportportal.name" . }}-uat-secret secret: secretName: {{ template "reportportal.name" . }}-uat-secret - {{- end }} + {{- end }} + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-shared-volume-claim + {{- end }} \ No newline at end of file diff --git a/reportportal/templates/service-jobs/jobs-deployment.yaml b/reportportal/templates/service-jobs/jobs-deployment.yaml index 23045c70..1fc3ea5e 100644 --- a/reportportal/templates/service-jobs/jobs-deployment.yaml +++ b/reportportal/templates/service-jobs/jobs-deployment.yaml @@ -59,7 +59,6 @@ spec: {{- if .Values.servicejobs.extraEnvs }} {{ toYaml .Values.servicejobs.extraEnvs | indent 8 }} {{- end }} - #TODO: remove SERVER_SERVLET_CONTEXT_PATH after change base path in service-jobs - name: SERVER_SERVLET_CONTEXT_PATH value: "/jobs" {{- if .Values.searchengine.doubleEntry.enable }} @@ -103,6 +102,7 @@ spec: - name: JAVA_OPTS value: "{{ .Values.servicejobs.jvmArgs }}" {{- end }} + # AMQP Settings - name: RP_AMQP_ANALYZER-VHOST value: "{{ .Values.msgbroker.vhost }}" - name: RP_AMQP_PASS @@ -118,6 +118,7 @@ spec: value: {{ ternary "https" "http" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.apiuser }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.apiport }}/api - name: RP_AMQP_ADDRESSES value: '{{ ternary "amqps" "amqp" .Values.msgbroker.ssl }}://{{ .Values.msgbroker.user }}:$(RP_AMQP_PASS)@{{ .Values.msgbroker.endpoint | default (printf "%s-rabbitmq.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.msgbroker.port }}' + # Database settings - name: RP_DB_HOST value: {{ .Values.database.endpoint | default (printf "%s-postgresql.%s.svc.cluster.local" .Release.Name .Release.Namespace) }} - name: RP_DB_PORT @@ -139,12 +140,10 @@ spec: {{- else }} value: "{{ .Values.database.password }}" {{- end }} - {{- if eq .Values.storage.bucket.type "single" }} - - name: RP_FEATURE_FLAGS - value: "singleBucket" - {{- end }} + # Storage settings - name: DATASTORE_TYPE value: "{{ .Values.storage.type }}" + {{- if or (eq .Values.storage.type "minio") (eq .Values.storage.type "s3") }} {{- if eq .Values.storage.type "minio" }} - name: DATASTORE_ENDPOINT value: "{{ ternary "https" "http" .Values.storage.ssl }}://{{ .Values.storage.endpoint | default (printf "%s-minio.%s.svc.cluster.local" .Release.Name .Release.Namespace) }}:{{ .Values.storage.port }}" @@ -164,22 +163,27 @@ spec: secretKeyRef: name: "{{ .Values.storage.secretName }}" key: "{{ .Values.storage.secretkeyName }}" - {{- else }} + {{- else }} - name: DATASTORE_ACCESSKEY value: "{{ .Values.storage.accesskey }}" - name: DATASTORE_SECRETKEY value: "{{ .Values.storage.secretkey }}" - {{- end }} - {{- if eq .Values.storage.bucket.type "multi" }} + {{- end }} + {{- if eq .Values.storage.bucket.type "single" }} + - name: RP_FEATURE_FLAGS + value: "singleBucket" + {{- end }} + {{- if eq .Values.storage.bucket.type "multi" }} - name: DATASTORE_BUCKETPREFIX value: "{{ .Values.storage.bucket.bucketMultiPrefix }}" - name: DATASTORE_BUCKETPOSTFIX value: "{{ .Values.storage.bucket.bucketMultiPostfix }}" - name: RP_INTEGRATION_SALT_PATH value: "{{ .Values.storage.bucket.bucketMultiSaltName }}" - {{- end }} + {{- end }} - name: DATASTORE_DEFAULTBUCKETNAME value: "{{ .Values.storage.bucket.bucketDefaultName }}" + {{- end }} - name: RP_PROCESSING_LOG_MAXBATCHSIZE value: "{{ .Values.servicejobs.logProcessing.maxBatchSize }}" - name: RP_PROCESSING_LOG_MAXBATCHTIMEOUT @@ -206,6 +210,11 @@ spec: timeoutSeconds: {{ .Values.servicejobs.livenessProbe.timeoutSeconds | default 5 }} failureThreshold: {{ .Values.servicejobs.livenessProbe.failureThreshold | default 10 }} {{- end }} + volumeMounts: + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + mountPath: /data/storage + {{- end }} {{- if .Values.servicejobs.nodeSelector }} nodeSelector: {{- range $key, $value := .Values.servicejobs.nodeSelector }} @@ -218,4 +227,10 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} -{{- end }} \ No newline at end of file +{{- end }} + volumes: + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-shared-volume-claim + {{- end }} \ No newline at end of file diff --git a/reportportal/templates/statefullset-auto-analyzer/analyzer-statefulset.yaml b/reportportal/templates/statefullset-auto-analyzer/analyzer-statefulset.yaml index 10811cb2..ccf4e3c5 100644 --- a/reportportal/templates/statefullset-auto-analyzer/analyzer-statefulset.yaml +++ b/reportportal/templates/statefullset-auto-analyzer/analyzer-statefulset.yaml @@ -126,6 +126,11 @@ spec: - name: UWSGI_WORKERS value: "{{ .Values.serviceanalyzer.uwsgiWorkers }}" {{- end }} + volumeMounts: + {{ if eq .Values.storage.type "filesystem" }} + - name: shared-volume + mountPath: /data/storage + {{- end }} {{- if .Values.serviceanalyzer.nodeSelector }} nodeSelector: {{- range $key, $value := .Values.serviceanalyzer.nodeSelector }} @@ -138,4 +143,10 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} -{{- end }} \ No newline at end of file +{{- end }} + volumes: + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-shared-volume-claim + {{- end }} \ No newline at end of file diff --git a/reportportal/templates/statefullset-auto-analyzer/analyzertrain-statefulset.yaml b/reportportal/templates/statefullset-auto-analyzer/analyzertrain-statefulset.yaml index 39048cfc..30721116 100644 --- a/reportportal/templates/statefullset-auto-analyzer/analyzertrain-statefulset.yaml +++ b/reportportal/templates/statefullset-auto-analyzer/analyzertrain-statefulset.yaml @@ -126,6 +126,11 @@ spec: - name: ES_PASSWORD value: "{{ .Values.searchengine.password }}" {{- end }} + volumeMounts: + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + mountPath: /data/storage + {{- end }} {{- if .Values.serviceanalyzertrain.nodeSelector }} nodeSelector: {{- range $key, $value := .Values.serviceanalyzertrain.nodeSelector }} @@ -138,4 +143,10 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} -{{- end }} \ No newline at end of file +{{- end }} + volumes: + {{- if eq .Values.storage.type "filesystem" }} + - name: shared-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-shared-volume-claim + {{- end }} \ No newline at end of file diff --git a/reportportal/templates/volumes/pv.yaml b/reportportal/templates/volumes/pv.yaml new file mode 100644 index 00000000..df811c80 --- /dev/null +++ b/reportportal/templates/volumes/pv.yaml @@ -0,0 +1,53 @@ +# This snippet creates a PersistentVolume when ReportPortal uses +# filesystem as a storage type instead of a bucket. +# If you set a type of volume to 'gcp' or 'aws' in values.yaml +# this snippet won't be used for creating a PersistentVolume. +# GCP and AWS provides dynamic provisioning of volumes. +# However, you can use a CSI type to get an access to pre-existing volumes. +{{- if and (eq .Values.storage.type "filesystem") (ne .Values.storage.volume.volumeConfig.type "") }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-shared-volume + annotations: + {{ .Values.storage.volume.annotations | toYaml | nindent 4 }} +spec: + capacity: + storage: {{ .Values.storage.volume.capacity }} + volumeMode: Filesystem + accessModes: + - {{ .Values.storage.volume.accessModes | default "ReadWriteMany" }} + persistentVolumeReclaimPolicy: {{ .Values.storage.volume.reclaimPolicy | default "Retain" }} + storageClassName: {{ .Values.storage.volume.storageClassName }} + +# Connection type specific configuration +{{- if eq .Values.storage.volume.volumeConfig.type "hostPath" }} + hostPath: + path: {{ .Values.storage.volume.volumeConfig.hostPath.path | default (printf "/data/%s-shared-volume" .Release.Name) }} +{{- else if eq .Values.storage.volume.volumeConfig.type "local" }} + local: + path: {{ .Values.storage.volume.volumeConfig.local.path | default (printf "/data/%s-shared-volume" .Release.Name) }} + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + {{ .Values.storage.volume.volumeConfig.local.nodeSelectorNames | toYaml | nindent 16 }} +{{- else if eq .Values.storage.volume.volumeConfig.type "csi" }} + csi: + driver: {{ .Values.storage.volume.volumeConfig.csi.driver }} + volumeHandle: {{ .Values.storage.volume.volumeConfig.csi.volumeHandle }} + {{- with .Values.storage.volume.volumeConfig.csi.fsType }} + fsType: {{ . }} + {{- end }} + {{- with .Values.storage.volume.volumeConfig.csi.readOnly }} + readOnly: {{ . }} + {{- end }} + volumeAttributes: + {{- range $key, $value := .Values.storage.volume.volumeConfig.csi.volumeAttributes }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} +{{- end }} diff --git a/reportportal/templates/volumes/pvc.yaml b/reportportal/templates/volumes/pvc.yaml new file mode 100644 index 00000000..b993ca45 --- /dev/null +++ b/reportportal/templates/volumes/pvc.yaml @@ -0,0 +1,15 @@ +{{- if eq .Values.storage.type "filesystem" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-shared-volume-claim + annotations: + {{ .Values.storage.volume.annotations | toYaml | nindent 4 }} +spec: + accessModes: + - {{ .Values.storage.volume.accessMode | default "ReadWriteMany" }} + resources: + requests: + storage: {{ .Values.storage.volume.capacity }} + storageClassName: {{ .Values.storage.volume.storageClassName }} +{{- end }} \ No newline at end of file diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 2a8fa1d6..fe383718 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -537,7 +537,7 @@ searchengine: password: storage: - ## @param storage.type Possible storage types: minio, s3 + ## @param storage.type Possible storage types: minio, s3, filesystem type: minio secretName: "" ## @param storage.accesskeyName and @param storage.secretkeyName pass to the env[].valueFrom.secretKeyRef.key @@ -567,6 +567,42 @@ storage: bucketMultiPostfix: "" ## @param storage.bucket.bucketMultiSaltName storing auth keystore bucketMultiSaltName: "keystore" + ## @param storage.volume defines the persistent volume claim properties + ## for the filesystem storage type. + volume: + ## @param storage.volume.capacity defines the size of the storage. + capacity: 5Gi + ## @param storage.volume.storageClassName defines the storage class name. + storageClassName: "standard" + ## @param storage.volume.annotations defines the common annotations. + annotations: {} + ## @param storage.volume.volumeConfig contains configuration for creating + ## a persistent volume. + volumeConfig: + ## @param storage.volume.volumeConfig.type defines the Persistent Volume type. + ## Possible values: hostPath, local, csi. If empty, PV is not created. + type: "" + hostPath: {} + local: + nodeSelectorNames: [] + ## @param storage.volume.volumeConfig.csi defines + ## the Container Storage Interface (CSI) properties. + csi: + ## @param storage.volume.volumeConfig.csi.driver defines + ## the CSI driver name. + driver: "" + ## @param storage.volume.volumeConfig.csi.volumeHandle defines + ## the volume handle. + volumeHandle: "" + ## @param storage.volume.volumeConfig.csi.fsType defines + ## the filesystem type. Provide ext4, xfs, etc. + fsType: "" + ## @param storage.volume.volumeConfig.csi.readOnly defines if + ## the volume is read-only. Provide true or false. + readOnly: "" + ## @param storage.volume.volumeConfig.csi.volumeAttributes defines + ## additional volume attributes. + volumeAttributes: {} ## @section Ingress configuration From 3422c6519d2f3faefaf16b4211ea3389f1cf2172 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Thu, 23 May 2024 11:42:27 +0200 Subject: [PATCH 16/26] Update all chart dependencies to the latest versions (#381) * Bump charts and image versions * Add gcpManaged cert checking * Add support for setting hosts as string or array --- docs/gke-install.md | 2 - reportportal/Chart.yaml | 17 +++--- .../templates/ingress/gateway-ingress.yaml | 45 +++++++++++++- .../templates/ingress/gateway-secret.yaml | 2 + .../templates/ingress/gcp-managed-cert.yaml | 4 ++ reportportal/values.yaml | 60 ++++++++++--------- 6 files changed, 90 insertions(+), 40 deletions(-) diff --git a/docs/gke-install.md b/docs/gke-install.md index 70b78fd6..17f21d4c 100644 --- a/docs/gke-install.md +++ b/docs/gke-install.md @@ -130,8 +130,6 @@ the Kubernetes with infrastructure dependencies. We recommend using `custom-4-6144` machine type with 4 vCPU and 6 GB memory as a minimal configuration. -```bash - If you want avoid using MinIO or Google Cloud Storage, you can use a filesystem storage type and Google Filestore as a storage class. diff --git a/reportportal/Chart.yaml b/reportportal/Chart.yaml index 7bcc8f41..4e52a0bf 100644 --- a/reportportal/Chart.yaml +++ b/reportportal/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "24.1" description: ReportPortal.io AI-powered Test Automation Dashboard name: reportportal -version: 24.1.0 +version: 24.1.1 sources: - https://github.com/reportportal/kubernetes keywords: @@ -13,23 +13,22 @@ maintainers: dependencies: # If you update version, please update also postgresql.image.tag in values.yaml - name: postgresql - version: 10.16.2 - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami + version: 15.3.5 + repository: https://charts.bitnami.com/bitnami condition: postgresql.install # If you update version, please update also rabbitmq.image.tag in values.yaml - name: rabbitmq - version: 10.3.9 - repository: https://charts.bitnami.com/bitnami + version: 14.1.5 + repository: https://charts.bitnami.com/bitnami condition: rabbitmq.install - name: opensearch - version: 2.17.0 + version: 2.20.0 repository: https://opensearch-project.github.io/helm-charts/ condition: opensearch.install - # MinIO with Apache 2.0 license - name: minio - version: 6.7.7 - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami + version: 14.5.0 + repository: https://charts.bitnami.com/bitnami condition: minio.install diff --git a/reportportal/templates/ingress/gateway-ingress.yaml b/reportportal/templates/ingress/gateway-ingress.yaml index 55c8a7bd..c262fa40 100644 --- a/reportportal/templates/ingress/gateway-ingress.yaml +++ b/reportportal/templates/ingress/gateway-ingress.yaml @@ -35,17 +35,23 @@ spec: {{- if .Values.ingress.tls.certificates }} tls: {{ toYaml .Values.ingress.tls.certificates | nindent 4 }} - {{- else if or $isTlsCertComplete }} + {{- else if and $isTlsCertComplete (eq .Values.ingress.tls.certificate.gcpManaged false)}} tls: - secretName: {{ .Release.Name }}-gateway-tls {{- if .Values.ingress.hosts }} + {{- if kindIs "slice" .Values.ingress.hosts }} hosts: {{ toYaml .Values.ingress.hosts | nindent 8 }} + {{- else if kindIs "string" .Values.ingress.hosts }} + hosts: + - {{ .Values.ingress.hosts }} + {{- end }} {{- end }} {{- end }} # Define the rules for the ingress rules: {{- if .Values.ingress.hosts }} + {{- if kindIs "slice" .Values.ingress.hosts }} {{- range $host := .Values.ingress.hosts }} - host: {{ $host }} http: @@ -83,6 +89,43 @@ spec: port: name: {{ $.Values.serviceapi.service.portName | default "headless" }} {{- end }} + {{- else if kindIs "string" .Values.ingress.hosts }} + - host: {{ .Values.ingress.hosts }} + http: + paths: + {{- if $path }} + - path: {{ $path }}/ + {{- else }} + - path: / + {{- end }} + pathType: Prefix + backend: + service: + name: {{ $fullName }}-index + port: + name: {{ $.Values.serviceindex.service.portName | default "headless" }} + - path: {{ $path }}/ui + pathType: Prefix + backend: + service: + name: {{ $fullName }}-ui + port: + name: {{ $.Values.serviceui.service.portName | default "headless" }} + - path: {{ $path }}/uat + pathType: Prefix + backend: + service: + name: {{ $fullName }}-uat + port: + name: {{ $.Values.uat.service.portName | default "headless" }} + - path: {{ $path }}/api + pathType: Prefix + backend: + service: + name: {{ $fullName }}-api + port: + name: {{ $.Values.serviceapi.service.portName | default "headless" }} + {{- end }} {{- else }} - http: paths: diff --git a/reportportal/templates/ingress/gateway-secret.yaml b/reportportal/templates/ingress/gateway-secret.yaml index 9b375c28..f8b77ec2 100644 --- a/reportportal/templates/ingress/gateway-secret.yaml +++ b/reportportal/templates/ingress/gateway-secret.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.ingress.tls.certificate.gcpManaged false }} {{- if and .Values.ingress.tls.certificate.privateKey .Values.ingress.tls.certificate.certificate }} apiVersion: v1 kind: Secret @@ -11,4 +12,5 @@ data: {{- .Values.ingress.tls.certificate.privateKey | nindent 4 }} tls.crt: | {{- .Values.ingress.tls.certificate.certificate | nindent 4 }} +{{- end }} {{- end }} \ No newline at end of file diff --git a/reportportal/templates/ingress/gcp-managed-cert.yaml b/reportportal/templates/ingress/gcp-managed-cert.yaml index f7c56375..f43f389d 100644 --- a/reportportal/templates/ingress/gcp-managed-cert.yaml +++ b/reportportal/templates/ingress/gcp-managed-cert.yaml @@ -7,5 +7,9 @@ metadata: {{ include "labels" . | nindent 4 }} spec: domains: + {{- if kindIs "slice" .Values.ingress.hosts }} {{ toYaml .Values.ingress.hosts | nindent 4 }} + {{- else if kindIs "string" .Values.ingress.hosts }} + - {{ .Values.ingress.hosts }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/reportportal/values.yaml b/reportportal/values.yaml index fe383718..139e3019 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -39,7 +39,7 @@ serviceui: name: ui image: repository: reportportal/service-ui - tag: 5.11.0 + tag: 5.11.1 pullPolicy: Always resources: requests: @@ -68,7 +68,7 @@ serviceapi: name: api image: repository: reportportal/service-api - tag: 5.11.0 + tag: 5.11.1 pullPolicy: Always replicaCount: 1 readinessProbe: @@ -194,7 +194,7 @@ uat: name: uat image: repository: reportportal/service-authorization - tag: 5.11.0 + tag: 5.11.1 pullPolicy: Always readinessProbe: enabled: true @@ -286,7 +286,7 @@ servicejobs: name: jobs image: repository: reportportal/service-jobs - tag: 5.11.0 + tag: 5.11.1 pullPolicy: Always readinessProbe: enabled: true @@ -618,7 +618,7 @@ storage: ## ## @param ingress.tls.certificates specify a list of predefined secret names for TLS certificates present in the same namespace ## certificates: -## - secretName: reportportal.k8.com-tls +## - secretName: reportportal.k8.com-tls ## hosts: ## - reportportal.k8.com ## @@ -628,8 +628,9 @@ storage: ingress: enable: true - hosts: [] - path: + ## @param ingress.hosts can be a list or a single string. + hosts: null + path: null class: nginx annotations: nginx: @@ -647,8 +648,8 @@ ingress: certificates: null certificate: gcpManaged: false - privateKey: "" - certificate: "" + privateKey: null + certificate: null ## @section Additional configuration @@ -687,17 +688,22 @@ extraInitContainers: {} ## @section External dependencies installation configuration ## @param postgresql External PostgreSQL Helm Chart as dependency -postgresql: - install: true ## set to `false` if using a Cloud/On-Premise managed database. +postgresql: + ## set to `false` if using a Cloud/On-Premise managed database. + install: true image: registry: docker.io repository: bitnami/postgresql - tag: 11.22.0 - postgresqlUsername: *dbuser - postgresqlPassword: *dbpassword - postgresqlDatabase: *dbname - servicePort: *dbport - postgresqlMaxConnections: *dbconnections + tag: 16.3.0 + auth: + postgresPassword: *dbpassword + username: *dbuser + password: *dbpassword + database: *dbname + primary: + service: + ports: + postgresql: *dbport ## @param rabbitmq External RabbitMQ Helm Chart as dependency rabbitmq: @@ -705,7 +711,7 @@ rabbitmq: image: registry: docker.io repository: bitnami/rabbitmq - tag: 3.10.25 + tag: 3.13.2 auth: username: *msgbrokerUser password: *msgbrokerPass @@ -718,7 +724,7 @@ opensearch: install: true ## set to `false` if using a Cloud/On-Premise managed OpenSearch. image: repository: opensearchproject/opensearch - tag: 2.11.1 + tag: 2.14.0 ## @param opensearch.singleNode If "true", replicas will be forced from 3 to 1 singleNode: true ## @param opensearch.httpPort Port for OpenSearch endpoint @@ -731,18 +737,16 @@ opensearch: - name: DISABLE_SECURITY_PLUGIN value: "true" -## Apache 2.0 license version -## @param minio External MinIO Helm Chart as dependency 6.7.7 +## @param minio External MinIO Helm Chart minio: - install: true ## set to `true` if using a Cloud/On-Premise managed storage. + install: true image: - registry: docker.io repository: bitnami/minio - tag: 2021.4.22-debian-10-r6 - accessKey: - password: *storageAccessKey - secretKey: - password: *storageSecretKey + registry: docker.io + tag: 2024.5.10-debian-12-r2 + auth: + rootUser: *storageAccessKey + rootPassword: *storageSecretKey k8sWaitFor: image: From c47d99b2aabda0e335d42a1f753a9821265225c4 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Fri, 24 May 2024 11:13:02 +0200 Subject: [PATCH 17/26] Add ARM arch support for init containers (#382) * Change k8sWaitFor repo * Split uat-secret according to the Helm linter error * Split LOCATION env in GKE Installation guide --- docs/gke-install.md | 31 ++++++++++--------- .../uat-init-password.yaml | 14 +++++++++ .../service-authorization/uat-secret.yaml | 17 ---------- reportportal/values.yaml | 5 ++- 4 files changed, 32 insertions(+), 35 deletions(-) create mode 100644 reportportal/templates/service-authorization/uat-init-password.yaml diff --git a/docs/gke-install.md b/docs/gke-install.md index 17f21d4c..f8c43e78 100644 --- a/docs/gke-install.md +++ b/docs/gke-install.md @@ -50,7 +50,8 @@ gcloud init Set up environment variables: ```bash -export LOCATION=us-central1 +export REPO_LOCATION=us-central1 +export CLUSTER_LOCATION=us-central1-a export PROJECT_ID={your_project_id} export CLUSTER_NAME={reportportal_cluster_name} export REPO_NAME={reportportal_helm_repo_name} @@ -70,7 +71,7 @@ Just perform the following commands: ```bash gcloud auth login -gcloud auth configure-docker ${LOCATION}-docker.pkg.dev +gcloud auth configure-docker ${REPO_LOCATION}-docker.pkg.dev ``` You can find more information about gcloud credential helper @@ -110,7 +111,7 @@ It's pretty simple to create a cluster in Autopilot mode: ```bash gcloud container clusters create-auto ${CLUSTER_NAME} \ - --location=${LOCATION} + --location=${REPO_LOCATION} ``` > **Note:** You can use the Google Filestore CSI driver for the Autopilot cluster. @@ -140,7 +141,7 @@ export MACHINE_TYPE=custom-4-6144 gcloud container clusters create ${CLUSTER_NAME} \ --addons=GcpFilestoreCsiDriver \ - --zone=${LOCATION} \ + --zone=${ZONE} \ --machine-type=${MACHINE_TYPE} ``` @@ -162,7 +163,7 @@ More information about creating a cluster in Standard mode you can find ```bash gcloud container clusters get-credentials ${CLUSTER_NAME} \ - --location=${LOCATION} + --location=${CLUSTER_LOCATION} ``` ### Verify the cluster mode @@ -171,7 +172,7 @@ You can verify the cluster: ```bash gcloud container clusters describe ${CLUSTER_NAME} \ - --location=${LOCATION} + --location=${CLUSTER_LOCATION} ``` ## Prepare Helm package for installation @@ -185,7 +186,7 @@ Create a repository in Artifact Registry for ReportPortal Helm charts: ```bash gcloud artifacts repositories create ${REPO_NAME} --repository-format=docker \ - --location=${LOCATION} --description="ReportPortal Helm repository" + --location=${REPO_LOCATION} --description="ReportPortal Helm repository" ``` > More information about Store Helm charts in the Artifact Registry you can find @@ -201,7 +202,7 @@ gcloud artifacts repositories list ```bash gcloud auth print-access-token | helm registry login -u oauth2accesstoken \ - --password-stdin https://${LOCATION}-docker.pkg.dev + --password-stdin https://${REPO_LOCATION}-docker.pkg.dev ``` ### Build and push Helm chart @@ -219,7 +220,7 @@ and your project id: cd kubernetes/reportportal helm dependency update helm package . -helm push reportportal-${VERSION}.tgz oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME} +helm push reportportal-${VERSION}.tgz oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME} ``` ## Install ReportPortal from Artifact Registry @@ -254,7 +255,7 @@ helm install \ --set serviceapi.resources.requests.memory="2Gi" \ --set serviceanalyzer.resources.requests.memory="1Gi" \ ${RELEASE_NAME} \ - oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ --version ${VERSION} ``` @@ -274,7 +275,7 @@ helm install \ --set storage.volume.storageClassName="standard-rwx" \ --set minio.install=false \ ${RELEASE_NAME} \ - oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ --version ${VERSION} ``` @@ -294,7 +295,7 @@ helm install \ --set ingress.class="gce" \ --set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \ ${RELEASE_NAME} \ - oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ --version ${VERSION} ``` @@ -310,7 +311,7 @@ helm install \ --set storage.volume.storageClassName="standard-rwx" \ --set minio.install=false \ ${RELEASE_NAME} \ - oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ + oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \ --version ${VERSION} ``` @@ -364,13 +365,13 @@ You can use [Cert-Manager](./cert-manager-config.md) to manage certificates for To delete the cluster: ```bash -gcloud container clusters delete ${CLUSTER_NAME} --location=${LOCATION} +gcloud container clusters delete ${CLUSTER_NAME} --location=${CLUSTER_LOCATION} ``` To delete the artifacts repository: ```bash -gcloud artifacts repositories delete ${CLUSTER_NAME} --location=${LOCATION} +gcloud artifacts repositories delete ${CLUSTER_NAME} --location=${REPO_LOCATION} ``` ### Disable HTTP Load Balancing diff --git a/reportportal/templates/service-authorization/uat-init-password.yaml b/reportportal/templates/service-authorization/uat-init-password.yaml new file mode 100644 index 00000000..b1805329 --- /dev/null +++ b/reportportal/templates/service-authorization/uat-init-password.yaml @@ -0,0 +1,14 @@ +{{- if not .Values.uat.superadminInitPasswd.secretName -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "reportportal.name" . }}-uat-init-password + namespace: {{ .Release.Namespace }} + labels: +{{ include "labels" . | indent 4 }} +{{- if .Values.uat.podLabels }} +{{ toYaml .Values.uat.podLabels | indent 4 }} +{{- end }} +data: + password: {{ .Values.uat.superadminInitPasswd.password | b64enc | quote }} +{{- end}} \ No newline at end of file diff --git a/reportportal/templates/service-authorization/uat-secret.yaml b/reportportal/templates/service-authorization/uat-secret.yaml index ffb3eed0..adab82fb 100644 --- a/reportportal/templates/service-authorization/uat-secret.yaml +++ b/reportportal/templates/service-authorization/uat-secret.yaml @@ -11,21 +11,4 @@ metadata: {{- end }} data: {{ toYaml .Values.uat.secret.data | indent 2 }} -{{- end}} - ---- - -{{- if not .Values.uat.superadminInitPasswd.secretName -}} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "reportportal.name" . }}-uat-init-password - namespace: {{ .Release.Namespace }} - labels: -{{ include "labels" . | indent 4 }} -{{- if .Values.uat.podLabels }} -{{ toYaml .Values.uat.podLabels | indent 4 }} -{{- end }} -data: - password: {{ .Values.uat.superadminInitPasswd.password | b64enc | quote }} {{- end}} \ No newline at end of file diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 139e3019..702ade19 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -750,9 +750,8 @@ minio: k8sWaitFor: image: - repository: pegasystems/k8s-wait-for - tag: latest - + repository: reportportal/k8s-wait-for + tag: no-root-latest ## Networking between pods k8s: From 441163990246c612b6fad7d2bc6b4117be2c2df9 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Mon, 27 May 2024 11:19:28 +0200 Subject: [PATCH 18/26] Helm add readiness test (#383) * Update reportportal/migrations image tag to 5.11.1 * Add Helm readiness test --- reportportal/templates/NOTES.txt | 2 ++ .../templates/service-ui/ui-configmap.yaml | 10 ++++++ .../templates/tests/readiness-test.yaml | 33 +++++++++++++++++++ reportportal/values.yaml | 4 +-- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 reportportal/templates/tests/readiness-test.yaml diff --git a/reportportal/templates/NOTES.txt b/reportportal/templates/NOTES.txt index 8d18dc9f..59efdece 100644 --- a/reportportal/templates/NOTES.txt +++ b/reportportal/templates/NOTES.txt @@ -2,8 +2,10 @@ CHART NAME: {{ .Chart.Name }} CHART VERSION: {{ .Chart.Version }} APP VERSION: {{ .Chart.AppVersion }} +{{- if .Values.ingress.hosts}} ReportPortal is now available at: {{ toYaml .Values.ingress.hosts | indent 4 }} +{{- end}} Welcome to ReportPortal, a TestOps service, that provides increased capabilities to speed up results analysis and reporting through the use of built-in analytic features. diff --git a/reportportal/templates/service-ui/ui-configmap.yaml b/reportportal/templates/service-ui/ui-configmap.yaml index eb004041..abc12f9f 100644 --- a/reportportal/templates/service-ui/ui-configmap.yaml +++ b/reportportal/templates/service-ui/ui-configmap.yaml @@ -71,6 +71,16 @@ data: try_files $uri /buildInfo.json 404; } + location /health { + default_type application/json; + return 200 '{"status": "UP"}'; + } + + location /ui/health { + default_type application/json; + return 200 '{"status": "UP"}'; + } + # media, fonts location ~* ([^/\\&\?]+\.+(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2))$ { add_header Cache-Control "public, must-revalidate"; diff --git a/reportportal/templates/tests/readiness-test.yaml b/reportportal/templates/tests/readiness-test.yaml new file mode 100644 index 00000000..d81aafa3 --- /dev/null +++ b/reportportal/templates/tests/readiness-test.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Pod +metadata: + name: {{ .Release.Name }}-readiness-test + labels: + {{ include "labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-container + image: curlimages/curl:latest + command: ["/bin/sh", "-c"] + args: + - > + for url in \ + "http://{{ include "reportportal.fullname" . }}-index:8080/health" \ + "http://{{ include "reportportal.fullname" . }}-ui:8080/ui/health" \ + "http://{{ include "reportportal.fullname" . }}-api:8585/api/health" \ + "http://{{ include "reportportal.fullname" . }}-uat:9999/uat/health" \ + "http://{{ include "reportportal.fullname" . }}-jobs:8686/jobs/health" + do + echo "Checking $url"; + response=$(curl --write-out "%{http_code}" --silent --output /dev/null $url); + if [ $response -ne 200 ]; then + echo "Health check failed for $url with response code $response"; + exit 1; + else + echo "Health check succeeded for $url"; + fi; + done; + echo "All health checks passed."; + restartPolicy: Never diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 702ade19..48408197 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -471,7 +471,7 @@ metricsgatherer: migrations: image: repository: reportportal/migrations - tag: 5.11.0 + tag: 5.11.1 resources: requests: cpu: 100m @@ -751,7 +751,7 @@ minio: k8sWaitFor: image: repository: reportportal/k8s-wait-for - tag: no-root-latest + tag: latest ## Networking between pods k8s: From 318a0792665260f9b07b9b92ea7ac4e616142c95 Mon Sep 17 00:00:00 2001 From: Yuliya Prihodko <107035036+pressayuliya@users.noreply.github.com> Date: Fri, 31 May 2024 16:40:27 +0300 Subject: [PATCH 19/26] Update README.md (#386) --- reportportal/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportportal/README.md b/reportportal/README.md index 0ed5cc23..1872d4a2 100644 --- a/reportportal/README.md +++ b/reportportal/README.md @@ -105,7 +105,7 @@ helm install my-release \ ## Documentation * [General User Manual](https://reportportal.io/docs/) -* [Expert guide and hacks for deploying ReportPortal on Kubernetes](https://reportportal.io/docs/installation-steps/DeployWithKubernetes) +* [Expert guide and hacks for deploying ReportPortal on Kubernetes](https://reportportal.io/docs/installation-steps/deploy-with-kubernetes/) * [Quick Start Guide for Google Cloud Platform GKE](./docs/quick-start-gcp-gke.md) ## Community / Support From aea58b2ed33cedac4a86d67cf3d0e91f239002fc Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:24:26 +0200 Subject: [PATCH 20/26] Update gke-install.md --- docs/gke-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gke-install.md b/docs/gke-install.md index f8c43e78..80e0013c 100644 --- a/docs/gke-install.md +++ b/docs/gke-install.md @@ -89,7 +89,7 @@ Read about it [here](https://cloud.google.com/kubernetes-engine/docs/how-to/role You can use [Predefined GKE Roles](https://cloud.google.com/kubernetes-engine/docs/how-to/iam#predefined) and update your account role. To set a service account on nodes, you must also have the Service Account User role (roles/iam.serviceAccountUser). -> **Impotent** We recommend to create a separate [IAM Service Account](https://cloud.google.com/iam/docs/service-accounts-create) +> **Importent** We recommend to create a separate [IAM Service Account](https://cloud.google.com/iam/docs/service-accounts-create) > for working with GKE cluster. ## Create a GKE cluster From 8bd7abcf5a672e24a382c140725ca8297b5f2859 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:24:48 +0200 Subject: [PATCH 21/26] Update gke-install.md --- docs/gke-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gke-install.md b/docs/gke-install.md index 80e0013c..bbf2c100 100644 --- a/docs/gke-install.md +++ b/docs/gke-install.md @@ -89,7 +89,7 @@ Read about it [here](https://cloud.google.com/kubernetes-engine/docs/how-to/role You can use [Predefined GKE Roles](https://cloud.google.com/kubernetes-engine/docs/how-to/iam#predefined) and update your account role. To set a service account on nodes, you must also have the Service Account User role (roles/iam.serviceAccountUser). -> **Importent** We recommend to create a separate [IAM Service Account](https://cloud.google.com/iam/docs/service-accounts-create) +> **Important** We recommend to create a separate [IAM Service Account](https://cloud.google.com/iam/docs/service-accounts-create) > for working with GKE cluster. ## Create a GKE cluster From 14ccaf1ad0196a33460d63a910a72690f505f9e0 Mon Sep 17 00:00:00 2001 From: "hleb_kanonik@epam.com" Date: Wed, 12 Jun 2024 13:54:08 +0200 Subject: [PATCH 22/26] chore: add extra RabbitMQ plugins for consistent hash exchange --- reportportal/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 48408197..3fc46295 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -718,6 +718,7 @@ rabbitmq: containerPorts: amqp: *msgbrokerPort manager: *msgbrokerApiPort + extraPlugins: "rabbitmq_auth_backend_ldap rabbitmq_consistent_hash_exchange" ## @param opensearch External OpenSearch Helm Chart as dependency opensearch: From c66e4e0a89d41bbaef464fd7844c7473cdd3fd6c Mon Sep 17 00:00:00 2001 From: "hleb_kanonik@epam.com" Date: Wed, 12 Jun 2024 15:51:32 +0200 Subject: [PATCH 23/26] chore: enable consistent hash exchange RabbitMQ plugin --- reportportal/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 3fc46295..11bbcd7d 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -718,6 +718,8 @@ rabbitmq: containerPorts: amqp: *msgbrokerPort manager: *msgbrokerApiPort + ## @param rabbitmq.extraPlugins define additional RabbitMQ plugins to be enabled. + ## Consistent Hash Exchange is required for the ReportPortal. extraPlugins: "rabbitmq_auth_backend_ldap rabbitmq_consistent_hash_exchange" ## @param opensearch External OpenSearch Helm Chart as dependency From 1aeb78995523fd26ae43c24656c59ad49fc5b6c9 Mon Sep 17 00:00:00 2001 From: "hleb_kanonik@epam.com" Date: Thu, 27 Jun 2024 17:54:47 +0200 Subject: [PATCH 24/26] chore: Update minio chart and image versions --- reportportal/Chart.yaml | 2 +- reportportal/values.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/reportportal/Chart.yaml b/reportportal/Chart.yaml index 4e52a0bf..d9130655 100644 --- a/reportportal/Chart.yaml +++ b/reportportal/Chart.yaml @@ -29,6 +29,6 @@ dependencies: condition: opensearch.install - name: minio - version: 14.5.0 + version: 14.6.13 repository: https://charts.bitnami.com/bitnami condition: minio.install diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 11bbcd7d..1be7ee36 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -746,10 +746,13 @@ minio: image: repository: bitnami/minio registry: docker.io - tag: 2024.5.10-debian-12-r2 + tag: 2024.6.26-debian-12-r0 auth: rootUser: *storageAccessKey rootPassword: *storageSecretKey + persistence: + annotations: + "helm.sh/resource-policy": "keep" k8sWaitFor: image: From da6847b7edcd3b035e825cf9a90a3c2cb427b899 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Mon, 1 Jul 2024 15:31:34 +0200 Subject: [PATCH 25/26] Update services endpoints in YAML templates (#390) --- reportportal/templates/service-api/api-service.yaml | 4 ++-- reportportal/templates/service-authorization/uat-service.yaml | 2 +- reportportal/templates/service-index/index-service.yaml | 4 ++-- reportportal/templates/service-jobs/jobs-services.yaml | 4 ++-- reportportal/templates/service-ui/ui-service.yaml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reportportal/templates/service-api/api-service.yaml b/reportportal/templates/service-api/api-service.yaml index aafe03eb..60a3d717 100644 --- a/reportportal/templates/service-api/api-service.yaml +++ b/reportportal/templates/service-api/api-service.yaml @@ -5,8 +5,8 @@ metadata: labels: {{ include "labels" . | indent 4 }} annotations: service: {{ $.Values.serviceapi.name | default "api" }} - infoEndpoint: "/api/info" - healthEndpoint: "/api/health" + infoEndpoint: "{{- $path := .Values.ingress.path -}}/api/info" + healthEndpoint: "{{- $path := .Values.ingress.path -}}/api/health" {{- with .Values.serviceapi.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/reportportal/templates/service-authorization/uat-service.yaml b/reportportal/templates/service-authorization/uat-service.yaml index 312b76a0..2fb0350e 100644 --- a/reportportal/templates/service-authorization/uat-service.yaml +++ b/reportportal/templates/service-authorization/uat-service.yaml @@ -5,7 +5,7 @@ metadata: labels: {{ include "labels" . | indent 4 }} annotations: service: {{ $.Values.uat.name | default "uat" }} - infoEndpoint: "/uat/info" + infoEndpoint: "{{- $path := .Values.ingress.path -}}/uat/info" healthEndpoint: "/uat/health" {{- with .Values.uat.service.annotations }} {{- toYaml . | nindent 4 }} diff --git a/reportportal/templates/service-index/index-service.yaml b/reportportal/templates/service-index/index-service.yaml index 743587cd..bf93f14d 100644 --- a/reportportal/templates/service-index/index-service.yaml +++ b/reportportal/templates/service-index/index-service.yaml @@ -5,8 +5,8 @@ metadata: labels: {{ include "labels" . | indent 4 }} annotations: service: {{ $.Values.serviceindex.name | default "index" }} - infoEndpoint: "/info" - healthEndpoint: "/health" + infoEndpoint: "{{- $path := .Values.ingress.path -}}/info" + healthEndpoint: "{{- $path := .Values.ingress.path -}}/health" {{- with .Values.serviceindex.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/reportportal/templates/service-jobs/jobs-services.yaml b/reportportal/templates/service-jobs/jobs-services.yaml index b42696fd..ab838b82 100644 --- a/reportportal/templates/service-jobs/jobs-services.yaml +++ b/reportportal/templates/service-jobs/jobs-services.yaml @@ -5,8 +5,8 @@ metadata: labels: {{ include "labels" . | indent 4 }} annotations: service: {{ $.Values.servicejobs.name | default "jobs" }} - infoEndpoint: "/jobs/info" - healthEndpoint: "/jobs/health" + infoEndpoint: "{{- $path := .Values.ingress.path -}}/jobs/info" + healthEndpoint: "{{- $path := .Values.ingress.path -}}/jobs/health" {{- with .Values.servicejobs.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/reportportal/templates/service-ui/ui-service.yaml b/reportportal/templates/service-ui/ui-service.yaml index dd2b8496..e5b70ac3 100644 --- a/reportportal/templates/service-ui/ui-service.yaml +++ b/reportportal/templates/service-ui/ui-service.yaml @@ -5,8 +5,8 @@ metadata: labels: {{ include "labels" . | indent 4 }} annotations: service: {{ $.Values.serviceui.name | default "ui" }} - infoEndpoint: "/ui/info" - healthEndpoint: "/ui/health" + infoEndpoint: "{{- $path := .Values.ingress.path -}}/ui/info" + healthEndpoint: "{{- $path := .Values.ingress.path -}}/ui/health" {{- with .Values.serviceui.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }} From eeb6c2380d7be96fa2c88194c421995e98c0772e Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:16:31 +0200 Subject: [PATCH 26/26] Update uat-service.yaml --- reportportal/templates/service-authorization/uat-service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportportal/templates/service-authorization/uat-service.yaml b/reportportal/templates/service-authorization/uat-service.yaml index 2fb0350e..df5407d4 100644 --- a/reportportal/templates/service-authorization/uat-service.yaml +++ b/reportportal/templates/service-authorization/uat-service.yaml @@ -6,7 +6,7 @@ metadata: annotations: service: {{ $.Values.uat.name | default "uat" }} infoEndpoint: "{{- $path := .Values.ingress.path -}}/uat/info" - healthEndpoint: "/uat/health" + healthEndpoint: "{{- $path := .Values.ingress.path -}}/uat/health" {{- with .Values.uat.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }}