Skip to content

Commit

Permalink
Helm chart update 24.1.3 (#411)
Browse files Browse the repository at this point in the history
* Update chart version and image versions

* Allow parametrization of DB password key

* Global Values & Custom RBAC  (#401)

* Image registry as global parameter #389

* Improper k8s RBAC API Groups #373

* Update RabbitMQ plugin set (#403)

* Update AMQP settings in api-deployment.yaml

* Add pre-upgrade hook  (#407)

* Update analyzer images (#410)

---------

Co-authored-by: piotr-smietana-kaseya <[email protected]>
Co-authored-by: Hleb Kanonik <[email protected]>
Co-authored-by: millerick <[email protected]>
  • Loading branch information
4 people authored Aug 16, 2024
1 parent c09ced8 commit c754ebe
Show file tree
Hide file tree
Showing 16 changed files with 417 additions and 234 deletions.
4 changes: 2 additions & 2 deletions reportportal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "24.1"
description: ReportPortal.io AI-powered Test Automation Dashboard
name: reportportal
version: 24.1.2
version: 24.1.3
sources:
- https://github.com/reportportal/kubernetes
keywords:
Expand All @@ -19,7 +19,7 @@ dependencies:

# If you update version, please update also rabbitmq.image.tag in values.yaml
- name: rabbitmq
version: 14.1.5
version: 14.4.4
repository: https://charts.bitnami.com/bitnami
condition: rabbitmq.install

Expand Down
2 changes: 1 addition & 1 deletion reportportal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ These dependencies are integrated into the distribution by default. To deactivat

```bash
helm install my-release \
--set postgresql.install=fasle \
--set postgresql.install=false \
--set database.endpoint=my-postgresql.host.local \
--set database.port=5432 \
--set database.user=my-user \
Expand Down
24 changes: 21 additions & 3 deletions reportportal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Expand the name of the chart.
*/}}
{{- define "reportportal.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -13,9 +13,9 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "reportportal.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- $name := default .Chart.Name .Values.global.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand Down Expand Up @@ -51,3 +51,21 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create image name
*/}}
{{- define "reportportal.image" -}}
{{- $service := .service -}}
{{- $globalRegistry := .Values.global.imageRegistry -}}
{{- $imageRepository := index .Values $service "image" "repository" -}}
{{- $imageTag := index .Values $service "image" "tag" -}}
{{- if $globalRegistry }}
{{- printf "%s/%s:%s" $globalRegistry $imageRepository $imageTag -}}
{{- else -}}
{{- printf "%s:%s" $imageRepository $imageTag -}}
{{- end -}}
{{- end -}}



19 changes: 14 additions & 5 deletions reportportal/templates/authorization/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "reportportal.fullname" . }}-service-reader
namespace: {{ .Release.Namespace }}
name: {{ include "reportportal.fullname" . }}-service-manager
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: ["", "batch"]
resources: ["pods","services", "jobs"]
verbs: ["get", "list", "watch"]
{{- if .Values.rbac.rules }}
{{- toYaml .Values.rbac.rules | nindent 4 }}
{{- else }}
# Allow the service account to get and list pods, services, and jobs
- apiGroups: ["", "batch"]
resources: ["pods","services", "jobs"]
verbs: ["get", "list", "watch"]
# Allow the service account to delete jobs
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["delete"]
{{- end}}
{{- end }}
16 changes: 8 additions & 8 deletions reportportal/templates/authorization/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "reportportal.fullname" . }}-user-binding
namespace: {{ .Release.Namespace }}
name: {{ include "reportportal.fullname" . }}-user-binding
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "reportportal.fullname" . }}-service-reader
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "reportportal.fullname" . }}-service-manager
subjects:
- kind: ServiceAccount
name: {{ template "reportportal.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: {{ template "reportportal.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
28 changes: 28 additions & 0 deletions reportportal/templates/hooks/pre-upgrade-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "reportportal.fullname" . }}-pre-upgrade-delete-job
labels:
{{ include "labels" . | indent 4 }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
metadata:
labels:
{{- range $key, $value := .Values.migrations.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
component: {{ include "reportportal.fullname" . }}-pre-upgrade-delete-job
spec:
serviceAccountName: {{ template "reportportal.serviceAccountName" . }}
restartPolicy: OnFailure
containers:
- name: delete-job
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- |
kubectl delete job {{ include "reportportal.fullname" . }}-migrations --ignore-not-found=true
16 changes: 7 additions & 9 deletions reportportal/templates/service-api/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: migrations-waiting-init
image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "k8sWaitFor") }}"
imagePullPolicy: IfNotPresent
args:
- "job-wr"
Expand All @@ -54,7 +54,7 @@ spec:
{{- end }}
containers:
- name: "{{ $.Values.serviceapi.name | default "api" }}"
image: "{{ .Values.serviceapi.image.repository }}:{{ .Values.serviceapi.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "serviceapi") }}"
imagePullPolicy: "{{ .Values.serviceapi.pullPolicy }}"
ports:
- containerPort: 8585
Expand Down Expand Up @@ -96,10 +96,8 @@ spec:
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: REPORTING_QUEUES_COUNT
value: "{{ .Values.serviceapi.queues }}"
- name: RP_AMQP_ANALYZER-VHOST
value: "{{ .Values.msgbroker.vhost }}"
- name: RP_AMQP_PASS
Expand Down Expand Up @@ -133,7 +131,7 @@ spec:
valueFrom:
secretKeyRef:
name: "{{ .Values.database.secretName }}"
key: "postgresql-password"
key: "{{ .Values.database.passwordKeyName }}"
{{- else }}
value: "{{ .Values.database.password }}"
{{- end }}
Expand Down Expand Up @@ -220,7 +218,7 @@ spec:
{{- end }}
{{- if .Values.serviceapi.auditLogs.enable }}
- name: auditlogstreamer
image: "{{ .Values.serviceapi.auditLogs.sidecar.image.repository }}:{{ .Values.serviceapi.auditLogs.sidecar.image.tag }}"
image: "{{ if .Values.global.imageRegistry }}{{ .Values.global.imageRegistry }}/{{ .Values.serviceapi.auditLogs.sidecar.image.repository }}:{{ .Values.serviceapi.auditLogs.sidecar.image.tag }}{{ else }}{{ .Values.serviceapi.auditLogs.sidecar.image.repository }}:{{ .Values.serviceapi.auditLogs.sidecar.image.tag }}{{ end }}"
command:
- /bin/sh
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: migrations-waiting-init
image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "k8sWaitFor") }}"
imagePullPolicy: IfNotPresent
args:
- "job-wr"
Expand All @@ -55,7 +55,7 @@ spec:
{{- end }}
containers:
- name: "{{ $.Values.uat.name | default "uat" }}"
image: "{{ .Values.uat.image.repository }}:{{ .Values.uat.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "uat") }}"
imagePullPolicy: "{{ .Values.uat.pullPolicy }}"
ports:
- containerPort: 9999
Expand Down Expand Up @@ -115,7 +115,7 @@ spec:
valueFrom:
secretKeyRef:
name: "{{ .Values.database.secretName }}"
key: "postgresql-password"
key: "{{ .Values.database.passwordKeyName }}"
{{- else }}
value: "{{ .Values.database.password }}"
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions reportportal/templates/service-index/index-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -33,7 +33,7 @@ spec:
serviceAccountName: {{ .Values.serviceindex.serviceAccountName | default (include "reportportal.serviceAccountName" .) }}
containers:
- name: {{ $.Values.serviceindex.name | default "index" }}
image: "{{ .Values.serviceindex.image.repository }}:{{ .Values.serviceindex.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "serviceindex") }}"
imagePullPolicy: "{{ .Values.serviceindex.pullPolicy }}"
env:
- name: K8S_MODE
Expand Down
8 changes: 4 additions & 4 deletions reportportal/templates/service-jobs/jobs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: migrations-waiting-init
image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "k8sWaitFor") }}"
imagePullPolicy: IfNotPresent
args:
- "job-wr"
Expand All @@ -43,7 +43,7 @@ spec:
{{- end }}
containers:
- name: "{{ $.Values.servicejobs.name | default "jobs" }}"
image: "{{ .Values.servicejobs.image.repository }}:{{ .Values.servicejobs.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "servicejobs") }}"
imagePullPolicy: "{{ .Values.servicejobs.pullPolicy }}"
ports:
- containerPort: 8686
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
valueFrom:
secretKeyRef:
name: "{{ .Values.database.secretName }}"
key: "postgresql-password"
key: "{{ .Values.database.passwordKeyName }}"
{{- else }}
value: "{{ .Values.database.password }}"
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions reportportal/templates/service-migrations/migrations-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
{{- end }}
spec:
restartPolicy: OnFailure
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -38,7 +38,7 @@ spec:
valueFrom:
secretKeyRef:
name: "{{ .Values.database.secretName }}"
key: "postgresql-password"
key: "{{ .Values.database.passwordKeyName }}"
{{ else }}
value: "{{ .Values.database.password }}"
{{ end }}
Expand All @@ -65,7 +65,7 @@ spec:
- name: OS_PASSWORD
value: "{{ .Values.searchengine.password }}"
{{- end }}
image: "{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "migrations") }}"
imagePullPolicy: "{{ .Values.migrations.pullPolicy }}"
name: migrations
resources:
Expand Down
4 changes: 2 additions & 2 deletions reportportal/templates/service-ui/ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -30,7 +30,7 @@ spec:
{{- end }}
containers:
- name: {{ $.Values.serviceui.name | default "ui" }}
image: "{{ .Values.serviceui.image.repository }}:{{ .Values.serviceui.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "serviceui") }}"
imagePullPolicy: "{{ .Values.serviceui.pullPolicy }}"
env:
- name: RP_SERVER_PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: migrations-waiting-init
image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "k8sWaitFor") }}"
imagePullPolicy: IfNotPresent
args:
- "pod-wr"
Expand All @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: "{{ $.Values.serviceanalyzer.name | default "analyzer" }}"
image: "{{ .Values.serviceanalyzer.image.repository }}:{{ .Values.serviceanalyzer.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "serviceanalyzer") }}"
imagePullPolicy: "{{ .Values.serviceanalyzer.pullPolicy }}"
ports:
- containerPort: 5001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: migrations-waiting-init
image: "{{ .Values.k8sWaitFor.image.repository }}:{{ .Values.k8sWaitFor.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "k8sWaitFor") }}"
imagePullPolicy: IfNotPresent
args:
- "pod-wr"
Expand All @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: "{{ $.Values.serviceanalyzertrain.name | default "analyzer-train" }}"
image: "{{ .Values.serviceanalyzer.image.repository }}:{{ .Values.serviceanalyzer.image.tag }}"
image: "{{ include "reportportal.image" (dict "Values" .Values "service" "serviceanalyzer") }}"
imagePullPolicy: "{{ .Values.serviceanalyzertrain.pullPolicy }}"
ports:
- containerPort: 5001
Expand Down
Loading

0 comments on commit c754ebe

Please sign in to comment.