From 59badbfed9970ffee60c9fe4fd14e5359c56bd32 Mon Sep 17 00:00:00 2001 From: Zev Isert Date: Thu, 11 Apr 2024 10:45:47 -0700 Subject: [PATCH] fix: add containerPort declaration for webhook in helm chart (#1961) * fix: add containerPort declaration for webhook in helm chart Signed-off-by: Zev Isert * docs: update helm chart readme Signed-off-by: Zev Isert * fix: copied helm value should be for webhook Signed-off-by: Zev Isert * build: bump helm chart to 1.2.3 Signed-off-by: Zev Isert * style: undo unrelated editor autoformatting Signed-off-by: Zev Isert --------- Signed-off-by: Zev Isert Co-authored-by: Mason Legere --- charts/spark-operator-chart/Chart.yaml | 2 +- charts/spark-operator-chart/README.md | 1 + charts/spark-operator-chart/templates/deployment.yaml | 8 +++++++- .../spark-operator-chart/templates/webhook-service.yaml | 2 +- charts/spark-operator-chart/values.yaml | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/charts/spark-operator-chart/Chart.yaml b/charts/spark-operator-chart/Chart.yaml index e15408bff..d4562c68d 100644 --- a/charts/spark-operator-chart/Chart.yaml +++ b/charts/spark-operator-chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: spark-operator description: A Helm chart for Spark on Kubernetes operator -version: 1.2.2 +version: 1.2.3 appVersion: v1beta2-1.4.0-3.5.0 keywords: - spark diff --git a/charts/spark-operator-chart/README.md b/charts/spark-operator-chart/README.md index 9dd82c676..1542c3ee2 100644 --- a/charts/spark-operator-chart/README.md +++ b/charts/spark-operator-chart/README.md @@ -140,6 +140,7 @@ All charts linted successfully | webhook.initResources | object | `{}` | Resources applied to init job | | webhook.namespaceSelector | string | `""` | The webhook server will only operate on namespaces with this label, specified in the form key1=value1,key2=value2. Empty string (default) will operate on all namespaces | | webhook.port | int | `8080` | Webhook service port | +| webhook.portName | string | `"webhook"` | Webhook container port name and service target port name | | webhook.timeout | int | `30` | | ## Maintainers diff --git a/charts/spark-operator-chart/templates/deployment.yaml b/charts/spark-operator-chart/templates/deployment.yaml index 9d99028b3..f9ea20270 100644 --- a/charts/spark-operator-chart/templates/deployment.yaml +++ b/charts/spark-operator-chart/templates/deployment.yaml @@ -52,10 +52,16 @@ spec: {{- toYaml .Values.envFrom | nindent 10 }} securityContext: {{- toYaml .Values.securityContext | nindent 10 }} - {{- if .Values.metrics.enable }} + {{- if or .Values.metrics.enable .Values.webhook.enable }} ports: + {{ if .Values.metrics.enable }} - name: {{ .Values.metrics.portName | quote }} containerPort: {{ .Values.metrics.port }} + {{ end }} + {{ if .Values.webhook.enable }} + - name: {{ .Values.webhook.portName | quote }} + containerPort: {{ .Values.webhook.port }} + {{ end }} {{ end }} args: - -v={{ .Values.logLevel }} diff --git a/charts/spark-operator-chart/templates/webhook-service.yaml b/charts/spark-operator-chart/templates/webhook-service.yaml index babe7f4f6..a26375db6 100644 --- a/charts/spark-operator-chart/templates/webhook-service.yaml +++ b/charts/spark-operator-chart/templates/webhook-service.yaml @@ -8,7 +8,7 @@ metadata: spec: ports: - port: 443 - targetPort: {{ .Values.webhook.port }} + targetPort: {{ .Values.webhook.portName | quote }} name: webhook selector: {{- include "spark-operator.selectorLabels" . | nindent 4 }} diff --git a/charts/spark-operator-chart/values.yaml b/charts/spark-operator-chart/values.yaml index 24a2f7270..de1aee6d3 100644 --- a/charts/spark-operator-chart/values.yaml +++ b/charts/spark-operator-chart/values.yaml @@ -96,6 +96,8 @@ webhook: enable: false # -- Webhook service port port: 8080 + # -- Webhook container port name and service target port name + portName: webhook # -- The webhook server will only operate on namespaces with this label, specified in the form key1=value1,key2=value2. # Empty string (default) will operate on all namespaces namespaceSelector: ""