From 7bceceaff9297f2c0fa1db468e9af5919d66d1b3 Mon Sep 17 00:00:00 2001 From: Hagai Barel Date: Mon, 18 May 2020 15:23:36 +0300 Subject: [PATCH] [incubator/sparkoperator] Add webhookNamespaceSelector (#22434) * [incubator/sparkoperator] Add webhookNamespaceSelector Signed-off-by: Hagai Barel * Bump chart version to 0.7.0 Signed-off-by: Hagai Barel --- incubator/sparkoperator/Chart.yaml | 2 +- incubator/sparkoperator/README.md | 2 ++ incubator/sparkoperator/ci/test-values.yaml | 3 +++ .../sparkoperator/templates/spark-operator-deployment.yaml | 1 + incubator/sparkoperator/values.yaml | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/incubator/sparkoperator/Chart.yaml b/incubator/sparkoperator/Chart.yaml index cde3fc8847..3a1888b71a 100644 --- a/incubator/sparkoperator/Chart.yaml +++ b/incubator/sparkoperator/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sparkoperator description: A Helm chart for Spark on Kubernetes operator -version: 0.6.13 +version: 0.7.0 appVersion: v1beta2-1.1.1-2.4.5 keywords: - spark diff --git a/incubator/sparkoperator/README.md b/incubator/sparkoperator/README.md index d878d2938a..982305c347 100644 --- a/incubator/sparkoperator/README.md +++ b/incubator/sparkoperator/README.md @@ -62,6 +62,7 @@ The following table lists the configurable parameters of the Spark operator char | `podAnnotations` | Annotations to be added to pods | `{}` | | `resyncInterval` | Informer resync interval in seconds | 30 | | `webhookPort` | Service port of the webhook server | 8080 | +| `webhookNamespaceSelector`| The webhook will only operate on namespaces with this label, specified in the form key1=value1,key2=value2 | `""` | | `resources` | Resources needed for the sparkoperator deployment | {} | | `enableBatchScheduler` | Whether to enable batch scheduler for pod scheduling | false | | `enableResourceQuotaEnforcement` | Whether to enable the ResourceQuota enforcement for SparkApplication resources. Requires the webhook to be enabled by setting enableWebhook to true. | false | @@ -69,6 +70,7 @@ The following table lists the configurable parameters of the Spark operator char | `leaderElection.lockName` | Lock name to use for leader election | `spark-operator-lock` | | `leaderElection.lockNamespace` | Namespace to use for leader election | (namespace of release) | | `securityContext` | Defines security context for operator container. | `{}` | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. #### Upgrading diff --git a/incubator/sparkoperator/ci/test-values.yaml b/incubator/sparkoperator/ci/test-values.yaml index 81146bbfb9..5f68ffbde9 100644 --- a/incubator/sparkoperator/ci/test-values.yaml +++ b/incubator/sparkoperator/ci/test-values.yaml @@ -25,6 +25,9 @@ securityContext: {} enableWebhook: false webhookPort: 8080 +## The webhook will only operate on namespaces with this label, specified in the form key1=value1,key2=value2 +## empty string will operate on all namespaces +webhookNamespaceSelector: "" enableMetrics: true metricsPort: 10254 diff --git a/incubator/sparkoperator/templates/spark-operator-deployment.yaml b/incubator/sparkoperator/templates/spark-operator-deployment.yaml index 278f0eccfe..eb0de4cb4e 100644 --- a/incubator/sparkoperator/templates/spark-operator-deployment.yaml +++ b/incubator/sparkoperator/templates/spark-operator-deployment.yaml @@ -90,6 +90,7 @@ spec: - -webhook-port={{ .Values.webhookPort }} - -webhook-svc-name={{ .Release.Name }}-webhook - -webhook-config-name={{ include "sparkoperator.fullname" . }}-webhook-config + - -webhook-namespace-selector={{ .Values.webhookNamespaceSelector }} {{- end }} {{- if .Values.enableResourceQuotaEnforcement }} - -enable-resource-quota-enforcement={{ .Values.enableResourceQuotaEnforcement }} diff --git a/incubator/sparkoperator/values.yaml b/incubator/sparkoperator/values.yaml index 81146bbfb9..5f68ffbde9 100644 --- a/incubator/sparkoperator/values.yaml +++ b/incubator/sparkoperator/values.yaml @@ -25,6 +25,9 @@ securityContext: {} enableWebhook: false webhookPort: 8080 +## The webhook will only operate on namespaces with this label, specified in the form key1=value1,key2=value2 +## empty string will operate on all namespaces +webhookNamespaceSelector: "" enableMetrics: true metricsPort: 10254