From 5b783871eccb0ce2b3696809e78f4d63afad7253 Mon Sep 17 00:00:00 2001 From: Sam Clinckspoor Date: Fri, 6 Sep 2019 16:12:57 +0200 Subject: [PATCH] Support podAnnotations (#16876) Signed-off-by: Sam Clinckspoor --- incubator/sparkoperator/Chart.yaml | 2 +- incubator/sparkoperator/README.md | 6 +++--- .../sparkoperator/templates/spark-operator-deployment.yaml | 7 ++++++- incubator/sparkoperator/values.yaml | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/incubator/sparkoperator/Chart.yaml b/incubator/sparkoperator/Chart.yaml index 98b4214fc3..999bc428c3 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.2.8 +version: 0.3.0 appVersion: v2.4.0-v1beta1-0.9.0 kubeVersion: ">=1.8.0-0" keywords: diff --git a/incubator/sparkoperator/README.md b/incubator/sparkoperator/README.md index ffcbcafd54..429ce2aaab 100644 --- a/incubator/sparkoperator/README.md +++ b/incubator/sparkoperator/README.md @@ -15,7 +15,7 @@ $ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incuba $ helm install incubator/sparkoperator --namespace spark-operator --set sparkJobNamespace=default ``` -Note that you need to use the `--namespace` flag during `helm install` to specify in which namespace you want to install the operator. The namespace can be existing or not. When it's not available, Helm would take care of creating the namespace. Note that this namespace has no relation to the namespace where you would like to deploy Spark jobs (i.e. the setting `sparkJobNamespace` shown in the table below). They can be the same namespace or different ones. +Note that you need to use the `--namespace` flag during `helm install` to specify in which namespace you want to install the operator. The namespace can be existing or not. When it's not available, Helm would take care of creating the namespace. Note that this namespace has no relation to the namespace where you would like to deploy Spark jobs (i.e. the setting `sparkJobNamespace` shown in the table below). They can be the same namespace or different ones. #### Configuration @@ -36,10 +36,10 @@ The following table lists the configurable parameters of the Spark operator char | `metricsPort` | Port for the metrics endpoint | 10254 | | `metricsEndpoint` | Metrics endpoint | "/metrics" | | `metricsPrefix` | Prefix for the metrics | "" | +| `podAnnotations` | annotations to be added to pods | `{}` | | `resyncInterval` | Informer resync interval in seconds | 30 | | `webhookPort` | Service port of the webhook server | 8080 | | `resources` | Resources needed for the sparkoperator deployment | {} | | `enableBatchScheduler` | Whether to enable batch scheduler for pod scheduling | false | -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. - +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/incubator/sparkoperator/templates/spark-operator-deployment.yaml b/incubator/sparkoperator/templates/spark-operator-deployment.yaml index e71f8af844..e7fe1d84a6 100644 --- a/incubator/sparkoperator/templates/spark-operator-deployment.yaml +++ b/incubator/sparkoperator/templates/spark-operator-deployment.yaml @@ -24,12 +24,17 @@ spec: type: Recreate template: metadata: - {{- if .Values.enableMetrics }} + {{- if or .Values.podAnnotations .Values.enableMetrics }} annotations: + {{- if .Values.enableMetrics }} prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.metricsPort }}" prometheus.io/path: {{ .Values.metricsEndpoint }} {{- end }} + {{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | trim | indent 8 }} + {{- end }} + {{- end }} labels: app.kubernetes.io/name: {{ include "sparkoperator.name" . }} app.kubernetes.io/version: {{ .Values.operatorVersion }} diff --git a/incubator/sparkoperator/values.yaml b/incubator/sparkoperator/values.yaml index 9dad594698..9b8525b851 100644 --- a/incubator/sparkoperator/values.yaml +++ b/incubator/sparkoperator/values.yaml @@ -42,3 +42,5 @@ logLevel: 2 ## Whether to enable batch scheduler for pod scheduling, ## if enabled, end user can specify batch scheduler name in spark application. enableBatchScheduler: false + +podAnnotations: {}