Skip to content

Commit

Permalink
fix: fixed serviceaccount annotations (#1972)
Browse files Browse the repository at this point in the history
* fixed serviceaccount annotations

Signed-off-by: Andrew Chubatiuk <[email protected]>

* bump chart version

Signed-off-by: Andrew Chubatiuk <[email protected]>

* docs fix

Signed-off-by: Andrew Chubatiuk <[email protected]>

---------

Signed-off-by: Andrew Chubatiuk <[email protected]>
  • Loading branch information
AndrewChubatiuk authored Apr 16, 2024
1 parent e9dbdfb commit 1d3e385
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.2.7
version: 1.2.8
appVersion: v1beta2-1.4.3-3.5.0
keywords:
- spark
Expand Down
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spark-operator

![Version: 1.2.7](https://img.shields.io/badge/Version-1.2.7-informational?style=flat-square) ![AppVersion: v1beta2-1.4.3-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.4.3--3.5.0-informational?style=flat-square)
![Version: 1.2.8](https://img.shields.io/badge/Version-1.2.8-informational?style=flat-square) ![AppVersion: v1beta2-1.4.3-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.4.3--3.5.0-informational?style=flat-square)

A Helm chart for Spark on Kubernetes operator

Expand Down
10 changes: 5 additions & 5 deletions charts/spark-operator-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ spec:
{{- toYaml .Values.securityContext | nindent 10 }}
{{- if or .Values.metrics.enable .Values.webhook.enable }}
ports:
{{ if .Values.metrics.enable }}
{{ if .Values.metrics.enable -}}
- name: {{ .Values.metrics.portName | quote }}
containerPort: {{ .Values.metrics.port }}
{{ end }}
{{ if .Values.webhook.enable }}
{{- end }}
{{ if .Values.webhook.enable -}}
- name: {{ .Values.webhook.portName | quote }}
containerPort: {{ .Values.webhook.port }}
{{ end }}
{{ end }}
{{- end }}
{{ end -}}
args:
- -v={{ .Values.logLevel }}
- -logtostderr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{{- if .Values.serviceAccounts.spark.create -}}
{{- if .Values.serviceAccounts.spark.create }}
{{- range $sparkJobNamespace := .Values.sparkJobNamespaces | default (list .Release.Namespace) }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "spark.serviceAccountName" $ }}
namespace: {{ $sparkJobNamespace }}
labels:
{{- include "spark-operator.labels" $ | nindent 4 }}
{{- with $.Values.serviceAccounts.spark.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
labels: {{ include "spark-operator.labels" $ | nindent 4 }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/spark-operator-chart/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ release:
name: spark-operator

tests:
- it: Should contain namespace arg when sparkJobNamespaces is equal to 1
set:
sparkJobNamespaces:
- ns1
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: -namespace=ns1

- it: Should add pod annotations if podAnnotations is set
set:
podAnnotations:
Expand Down
1 change: 1 addition & 0 deletions charts/spark-operator-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ serviceAccounts:

# -- List of namespaces where to run spark jobs, operator namespace is included only when list of namespaces is empty
sparkJobNamespaces: []
# - ns1

# -- Operator concurrency, higher values might increase memory usage
controllerThreads: 10
Expand Down

0 comments on commit 1d3e385

Please sign in to comment.