From 345d611810e9a8e87d92281948211f44d97d68d2 Mon Sep 17 00:00:00 2001 From: Jacob Salway Date: Wed, 23 Oct 2024 20:41:29 +1100 Subject: [PATCH] Allow --ingress-class-name to be specified in chart (#2278) Signed-off-by: Jacob Salway --- charts/spark-operator-chart/README.md | 1 + .../templates/controller/deployment.yaml | 3 +++ .../tests/controller/deployment_test.yaml | 13 +++++++++++++ charts/spark-operator-chart/values.yaml | 2 ++ 4 files changed, 19 insertions(+) diff --git a/charts/spark-operator-chart/README.md b/charts/spark-operator-chart/README.md index 9c945d33b4..1df28cdc7f 100644 --- a/charts/spark-operator-chart/README.md +++ b/charts/spark-operator-chart/README.md @@ -90,6 +90,7 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum | controller.uiService.enable | bool | `true` | Specifies whether to create service for Spark web UI. | | controller.uiIngress.enable | bool | `false` | Specifies whether to create ingress for Spark web UI. `controller.uiService.enable` must be `true` to enable ingress. | | controller.uiIngress.urlFormat | string | `""` | Ingress URL format. Required if `controller.uiIngress.enable` is true. | +| controller.uiIngress.ingressClassName | string | `""` | Optionally set the ingressClassName. | | controller.batchScheduler.enable | bool | `false` | Specifies whether to enable batch scheduler for spark jobs scheduling. If enabled, users can specify batch scheduler name in spark application. | | controller.batchScheduler.kubeSchedulerNames | list | `[]` | Specifies a list of kube-scheduler names for scheduling Spark pods. | | controller.batchScheduler.default | string | `""` | Default batch scheduler to be used if not specified by the user. If specified, this value must be either "volcano" or "yunikorn". Specifying any other value will cause the controller to error on startup. | diff --git a/charts/spark-operator-chart/templates/controller/deployment.yaml b/charts/spark-operator-chart/templates/controller/deployment.yaml index 1efd126568..2a1fd5f19e 100644 --- a/charts/spark-operator-chart/templates/controller/deployment.yaml +++ b/charts/spark-operator-chart/templates/controller/deployment.yaml @@ -69,6 +69,9 @@ spec: {{- with .Values.controller.uiIngress.urlFormat }} - --ingress-url-format={{ . }} {{- end }} + {{- with .Values.controller.uiIngress.ingressClassName }} + - --ingress-class-name={{ . }} + {{- end }} {{- end }} {{- if .Values.controller.batchScheduler.enable }} - --enable-batch-scheduler=true diff --git a/charts/spark-operator-chart/tests/controller/deployment_test.yaml b/charts/spark-operator-chart/tests/controller/deployment_test.yaml index c2513dd32f..67c475da40 100644 --- a/charts/spark-operator-chart/tests/controller/deployment_test.yaml +++ b/charts/spark-operator-chart/tests/controller/deployment_test.yaml @@ -171,6 +171,19 @@ tests: path: spec.template.spec.containers[?(@.name=="spark-operator-controller")].args content: --ingress-url-format={{$appName}}.example.com/{{$appNamespace}}/{{$appName}} + - it: Should contain `--ingress-class-name` arg if `controller.uiIngress.enable` is set to `true` and `controller.uiIngress.ingressClassName` is set + set: + controller: + uiService: + enable: true + uiIngress: + enable: true + ingressClassName: nginx + asserts: + - contains: + path: spec.template.spec.containers[?(@.name=="spark-operator-controller")].args + content: --ingress-class-name=nginx + - it: Should contain `--enable-batch-scheduler` arg if `controller.batchScheduler.enable` is `true` set: controller: diff --git a/charts/spark-operator-chart/values.yaml b/charts/spark-operator-chart/values.yaml index 75cf5cac88..672d622528 100644 --- a/charts/spark-operator-chart/values.yaml +++ b/charts/spark-operator-chart/values.yaml @@ -65,6 +65,8 @@ controller: # -- Ingress URL format. # Required if `controller.uiIngress.enable` is true. urlFormat: "" + # -- Optionally set the ingressClassName. + ingressClassName: "" batchScheduler: # -- Specifies whether to enable batch scheduler for spark jobs scheduling.