From e16a167723b7908cda64ca97be00750ff6f61c40 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 21 Jun 2024 14:18:25 +0000 Subject: [PATCH] chart: fix config ingress.tls Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 8 ++++---- charts/selenium-grid/templates/ingress.yaml | 2 +- .../templates/patch-keda/patch-keda-objects-job.yaml | 6 ++++-- charts/selenium-grid/templates/patch-keda/rbac-role.yaml | 6 +++--- .../templates/patch-keda/rbac-rolebinding.yaml | 6 +++--- charts/selenium-grid/templates/server-configmap.yaml | 4 ++-- tests/charts/templates/render/dummy.yaml | 3 +++ tests/charts/templates/render/dummy_solution.yaml | 3 +++ 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index c8312c33c..e0eb3959b 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -13,11 +13,11 @@ on: request-timeout: description: 'Test parameter for different request timeout' required: false - default: '370' + default: '15' max-replicas-count: description: 'Test parameter for autoscaling to set maxReplicaCount' required: false - default: '30' + default: '10' log-level: description: 'Test parameter for different log level' required: false @@ -148,8 +148,8 @@ jobs: echo "SET_MAX_REPLICAS=${SET_MAX_REPLICAS}" >> $GITHUB_ENV echo "LOG_LEVEL=${LOG_LEVEL}" >> $GITHUB_ENV env: - AUTOSCALING_POLL_INTERVAL: ${{ github.event.inputs.request-timeout || '370' }} - SET_MAX_REPLICAS: ${{ github.event.inputs.max-replicas-count || '30' }} + AUTOSCALING_POLL_INTERVAL: ${{ github.event.inputs.request-timeout || '15' }} + SET_MAX_REPLICAS: ${{ github.event.inputs.max-replicas-count || '10' }} LOG_LEVEL: ${{ github.event.inputs.log-level || 'FINE' }} - name: Test Selenium Grid on Kubernetes ${{ matrix.k8s-version }} with Autoscaling ${{ matrix.test-strategy }} uses: nick-invision/retry@master diff --git a/charts/selenium-grid/templates/ingress.yaml b/charts/selenium-grid/templates/ingress.yaml index 6f53995da..9f40cb929 100644 --- a/charts/selenium-grid/templates/ingress.yaml +++ b/charts/selenium-grid/templates/ingress.yaml @@ -44,7 +44,7 @@ spec: {{- range .hosts }} - {{ tpl . $ | quote }} {{- end }} - secretName: {{ tpl (.secretName) $ | quote }} + secretName: {{ tpl (default "" .secretName) $ | quote }} {{- end }} {{- end }} rules: diff --git a/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml b/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml index ba5208956..794f7122b 100644 --- a/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml +++ b/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml @@ -4,8 +4,8 @@ kind: Job metadata: name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} namespace: {{ .Release.Namespace }} - annotations: &patch_objects_job_annotations {{- with $.Values.autoscaling.patchObjectFinalizers.annotations }} + annotations: &patch_objects_job_annotations {{- toYaml . | nindent 4 }} {{- end }} labels: &patch_objects_job_labels @@ -18,8 +18,10 @@ metadata: spec: template: metadata: - labels: *patch_objects_job_labels + {{- with $.Values.autoscaling.patchObjectFinalizers.annotations }} annotations: *patch_objects_job_annotations + {{- end }} + labels: *patch_objects_job_labels name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} spec: activeDeadlineSeconds: {{ $.Values.autoscaling.patchObjectFinalizers.activeDeadlineSeconds }} diff --git a/charts/selenium-grid/templates/patch-keda/rbac-role.yaml b/charts/selenium-grid/templates/patch-keda/rbac-role.yaml index 40da4db5c..088b89e76 100644 --- a/charts/selenium-grid/templates/patch-keda/rbac-role.yaml +++ b/charts/selenium-grid/templates/patch-keda/rbac-role.yaml @@ -4,10 +4,10 @@ kind: Role metadata: name: {{ template "seleniumGrid.rbac.role.fullname" $ }} namespace: {{ .Release.Namespace }} + {{- with $.Values.rbacRole.annotations }} annotations: - {{- with $.Values.rbacRole.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} labels: deploymentName: {{ template "seleniumGrid.rbac.role.fullname" $ }} {{- include "seleniumGrid.commonLabels" $ | nindent 4 }} diff --git a/charts/selenium-grid/templates/patch-keda/rbac-rolebinding.yaml b/charts/selenium-grid/templates/patch-keda/rbac-rolebinding.yaml index e9d1d3321..535d0e255 100644 --- a/charts/selenium-grid/templates/patch-keda/rbac-rolebinding.yaml +++ b/charts/selenium-grid/templates/patch-keda/rbac-rolebinding.yaml @@ -4,10 +4,10 @@ kind: RoleBinding metadata: name: {{ template "seleniumGrid.rbac.roleBinding.fullname" $ }} namespace: {{ .Release.Namespace }} + {{- with $.Values.rbacRoleBinding.annotations }} annotations: - {{- with $.Values.rbacRoleBinding.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} labels: deploymentName: {{ template "seleniumGrid.rbac.roleBinding.fullname" $ }} {{- include "seleniumGrid.commonLabels" $ | nindent 4 }} diff --git a/charts/selenium-grid/templates/server-configmap.yaml b/charts/selenium-grid/templates/server-configmap.yaml index b72e9c43d..e7eda96ed 100644 --- a/charts/selenium-grid/templates/server-configmap.yaml +++ b/charts/selenium-grid/templates/server-configmap.yaml @@ -13,8 +13,8 @@ metadata: {{- end }} data: SE_SERVER_PROTOCOL: {{ include "seleniumGrid.server.protocol" . | quote }} -{{- with $.Values.serverConfigMap.env }} - {{- toYaml . | nindent 2 }} +{{- range $key, $value := .Values.serverConfigMap.env }} + {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.tls.enabled }} SE_HTTPS_CERTIFICATE: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.certificateFile | quote }} diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index b854934ac..f4952d4f4 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -57,6 +57,9 @@ ingress: name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 + tls: + - hosts: + - '*.my.domain.com' isolateComponents: true diff --git a/tests/charts/templates/render/dummy_solution.yaml b/tests/charts/templates/render/dummy_solution.yaml index 7ac840ee2..ca40d43a6 100644 --- a/tests/charts/templates/render/dummy_solution.yaml +++ b/tests/charts/templates/render/dummy_solution.yaml @@ -58,6 +58,9 @@ selenium-grid: name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 + tls: + - hosts: + - '*.my.domain.com' isolateComponents: true