diff --git a/charts/spark-operator-chart/README.md b/charts/spark-operator-chart/README.md index c00d9aaf4..2314c82be 100644 --- a/charts/spark-operator-chart/README.md +++ b/charts/spark-operator-chart/README.md @@ -81,6 +81,7 @@ All charts linted successfully |-----|------|---------|-------------| | affinity | object | `{}` | Affinity for pod assignment | | batchScheduler.enable | bool | `false` | Enable batch scheduler for spark jobs scheduling. If enabled, users can specify batch scheduler name in spark application | +| commonLabels | object | `{}` | Common labels to add to the resources | | controllerThreads | int | `10` | Operator concurrency, higher values might increase memory usage | | fullnameOverride | string | `""` | String to override release name | | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | @@ -126,8 +127,10 @@ All charts linted successfully | tolerations | list | `[]` | List of node taints to tolerate | | uiService.enable | bool | `true` | Enable UI service creation for Spark application | | webhook.cleanupAnnotations | object | `{"helm.sh/hook":"pre-delete, pre-upgrade","helm.sh/hook-delete-policy":"hook-succeeded"}` | The annotations applied to the cleanup job, required for helm lifecycle hooks | +| webhook.cleanupPodLabels | object | `{}` | The podLabels applied to the pod of the cleanup job | | webhook.enable | bool | `false` | Enable webhook server | | webhook.initAnnotations | object | `{"helm.sh/hook":"pre-install, pre-upgrade","helm.sh/hook-weight":"50"}` | The annotations applied to init job, required to restore certs deleted by the cleanup job during upgrade | +| webhook.initPodLabels | object | `{}` | The podLabels applied to the pod of the 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.timeout | int | `30` | | diff --git a/charts/spark-operator-chart/templates/_helpers.tpl b/charts/spark-operator-chart/templates/_helpers.tpl index 2954e8969..8e884ee9d 100644 --- a/charts/spark-operator-chart/templates/_helpers.tpl +++ b/charts/spark-operator-chart/templates/_helpers.tpl @@ -37,6 +37,9 @@ Common labels {{- define "spark-operator.labels" -}} helm.sh/chart: {{ include "spark-operator.chart" . }} {{ include "spark-operator.selectorLabels" . }} +{{- if .Values.commonLabels }} +{{ toYaml .Values.commonLabels }} +{{- end }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} diff --git a/charts/spark-operator-chart/templates/webhook-cleanup-job.yaml b/charts/spark-operator-chart/templates/webhook-cleanup-job.yaml index dadd1df17..a6f2c1ea9 100644 --- a/charts/spark-operator-chart/templates/webhook-cleanup-job.yaml +++ b/charts/spark-operator-chart/templates/webhook-cleanup-job.yaml @@ -15,6 +15,10 @@ spec: annotations: "sidecar.istio.io/inject": "false" {{- end }} + {{- if .Values.webhook.cleanupPodLabels }} + labels: + {{- toYaml .Values.webhook.cleanupPodLabels | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ include "spark-operator.serviceAccountName" . }} restartPolicy: OnFailure diff --git a/charts/spark-operator-chart/templates/webhook-init-job.yaml b/charts/spark-operator-chart/templates/webhook-init-job.yaml index e94483909..009879d99 100644 --- a/charts/spark-operator-chart/templates/webhook-init-job.yaml +++ b/charts/spark-operator-chart/templates/webhook-init-job.yaml @@ -15,6 +15,10 @@ spec: annotations: "sidecar.istio.io/inject": "false" {{- end }} + {{- if .Values.webhook.initPodLabels }} + labels: + {{- toYaml .Values.webhook.initPodLabels | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ include "spark-operator.serviceAccountName" . }} restartPolicy: OnFailure diff --git a/charts/spark-operator-chart/values.yaml b/charts/spark-operator-chart/values.yaml index 891b45f6b..5007b7ea6 100644 --- a/charts/spark-operator-chart/values.yaml +++ b/charts/spark-operator-chart/values.yaml @@ -2,6 +2,9 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +# -- Common labels to add to the resources +commonLabels: {} + # replicaCount -- Desired number of pods, leaderElection will be enabled # if this is greater than 1 replicaCount: 1 @@ -92,11 +95,15 @@ webhook: initAnnotations: "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-weight": "50" + # -- The podLabels applied to the pod of the init job + initPodLabels: {} # -- The annotations applied to the cleanup job, required for helm lifecycle hooks cleanupAnnotations: "helm.sh/hook": pre-delete, pre-upgrade "helm.sh/hook-delete-policy": hook-succeeded # -- Webhook Timeout in seconds + # -- The podLabels applied to the pod of the cleanup job + cleanupPodLabels: {} timeout: 30 metrics: