Skip to content

Commit bc20a96

Browse files
author
John Funk
committed
added optional ServiceAccounts to coordinating-deploy.yaml, data-statefulset.yaml, master-statefulset.yaml and serviceaccount.yaml
- ServiceAccounts are disabled by default in the Values.yaml
1 parent ba7b512 commit bc20a96

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

bitnami/elasticsearch/templates/coordinating-deploy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ spec:
2727
{{- if .Values.coordinating.tolerations }}
2828
tolerations: {{- include "elasticsearch.tplValue" (dict "value" .Values.coordinating.tolerations "context" $) | nindent 8 }}
2929
{{- end }}
30+
{{- if .Values.coordinating.serviceAccount.create }}
31+
serviceAccountName: {{ .Values.coordinating.serviceAccount.name | default (include "elasticsearch.coordinating.fullname" .) }}
32+
{{- end }}
3033
{{- if .Values.coordinating.securityContext.enabled }}
3134
securityContext:
3235
fsGroup: {{ .Values.coordinating.securityContext.fsGroup }}

bitnami/elasticsearch/templates/data-statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ spec:
3636
{{- if .Values.data.tolerations }}
3737
tolerations: {{- include "elasticsearch.tplValue" (dict "value" .Values.data.tolerations "context" $) | nindent 8 }}
3838
{{- end }}
39+
{{- if .Values.data.serviceAccount.create }}
40+
serviceAccountName: {{ .Values.data.serviceAccount.name | default (include "elasticsearch.data.fullname" .) }}
41+
{{- end }}
3942
{{- if .Values.data.securityContext.enabled }}
4043
securityContext:
4144
fsGroup: {{ .Values.data.securityContext.fsGroup }}

bitnami/elasticsearch/templates/master-statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ spec:
2828
{{- if .Values.master.tolerations }}
2929
tolerations: {{- include "elasticsearch.tplValue" (dict "value" .Values.master.tolerations "context" $) | nindent 8 }}
3030
{{- end }}
31+
{{- if .Values.master.serviceAccount.create }}
32+
serviceAccountName: {{ .Values.master.serviceAccount.name | default (include "elasticsearch.master.fullname" .) }}
33+
{{- end }}
3134
{{- if .Values.master.securityContext.enabled }}
3235
securityContext:
3336
fsGroup: {{ .Values.master.securityContext.fsGroup }}

bitnami/elasticsearch/templates/serviceaccount.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,30 @@ metadata:
66
labels: {{- include "elasticsearch.labels" . | nindent 4 }}
77
role: curator
88
{{- end }}
9+
---
10+
{{- if .Values.data.serviceAccount.create }}
11+
apiVersion: v1
12+
kind: ServiceAccount
13+
metadata:
14+
name: {{ .Values.data.serviceAccount.name | default (include "elasticsearch.data.fullname" .) }}
15+
labels: {{- include "elasticsearch.labels" . | nindent 4 }}
16+
role: data
17+
{{- end }}
18+
---
19+
{{- if .Values.master.serviceAccount.create }}
20+
apiVersion: v1
21+
kind: ServiceAccount
22+
metadata:
23+
name: {{ .Values.master.serviceAccount.name | default (include "elasticsearch.master.fullname" .) }}
24+
labels: {{- include "elasticsearch.labels" . | nindent 4 }}
25+
role: master
26+
{{- end }}
27+
---
28+
{{- if .Values.coordinating.serviceAccount.create }}
29+
apiVersion: v1
30+
kind: ServiceAccount
31+
metadata:
32+
name: {{ .Values.coordinating.serviceAccount.name | default (include "elasticsearch.coordinating.fullname" .) }}
33+
labels: {{- include "elasticsearch.labels" . | nindent 4 }}
34+
role: coordinating-only
35+
{{- end }}

bitnami/elasticsearch/values.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ master:
239239
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
240240
##
241241
# loadBalancerIP:
242+
## Provide functionality to use RBAC
243+
##
244+
serviceAccount:
245+
## Specifies whether a ServiceAccount should be created for the master node
246+
create: false
247+
## The name of the ServiceAccount to use.
248+
## If not set and create is true, a name is generated using the fullname template
249+
name:
242250

243251
## Elasticsearch coordinating-only node parameters
244252
##
@@ -321,6 +329,16 @@ coordinating:
321329
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
322330
##
323331
# loadBalancerIP:
332+
## Provide functionality to use RBAC
333+
##
334+
serviceAccount:
335+
## Specifies whether a ServiceAccount should be created for the coordinating node
336+
##
337+
create: false
338+
## The name of the ServiceAccount to use.
339+
## If not set and create is true, a name is generated using the fullname template
340+
##
341+
name:
324342

325343
## Elasticsearch data node parameters
326344
##
@@ -413,6 +431,16 @@ data:
413431
## Persistent Volume size
414432
##
415433
size: 8Gi
434+
## Provide functionality to use RBAC
435+
##
436+
serviceAccount:
437+
## Specifies whether a ServiceAccount should be created for the data node
438+
##
439+
create: false
440+
## The name of the ServiceAccount to use.
441+
## If not set and create is true, a name is generated using the fullname template
442+
##
443+
name:
416444

417445
## Elasticsearch ingest node parameters
418446
##

0 commit comments

Comments
 (0)