Skip to content

Commit a24ac60

Browse files
Merge branch 'master' into inject-datastore-encryption-key
2 parents f9fef5f + dd20231 commit a24ac60

File tree

6 files changed

+111
-3
lines changed

6 files changed

+111
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

33
## In Development
4-
* Change ingress name from `<release name>-ingress` to <release name>-st2web-ingress, useful when using `stackstorm-ha` as a requirement for another chart. (#112) (by @erenatas)
4+
* Allow injection of datastore key in cluster (#115) (by @AngryDeveloper)
5+
6+
## v0.25.0
7+
* Change ingress name from `<release name>-ingress` to `<release name>-st2web-ingress`, useful when using `stackstorm-ha` as a requirement for another chart. (#112) (by @erenatas)
58
* Fix st2web ingress which should have been defined as an Integer instead of a String (#111) (by @erenatas)
69
* Add an option to inject hostAliases in the st2actionrunner containers (#114)
7-
* Allow injection of datastore key in cluster (#115) (by @AngryDeveloper)
10+
* Add support for Service Accounts (#117) (by @Vince-Chenal)
11+
812

913
## v0.24.0
1014
* Fix st2web ingress to use `/` path by default instead of `/*`, useful for nginx ingress controller (#103) (by @erenatas)

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
# Update StackStorm version here to rely on other Docker images tags
33
appVersion: 3.2dev
44
name: stackstorm-ha
5-
version: 0.24.0
5+
version: 0.25.0
66
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
77
home: https://stackstorm.com/#product
88
icon: https://avatars1.githubusercontent.com/u/4969009

templates/_helpers.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Expand the name of the chart.
2+
{{- define "stackstorm-ha.name" -}}
3+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
4+
{{- end -}}
5+
16
# Image pull secret used to access private docker.stackstorm.com Docker registry with Enterprise images
27
{{- define "imagePullSecret" }}
38
{{- if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled -}}
@@ -23,6 +28,13 @@ stackstorm
2328
{{- end -}}
2429
{{- end -}}
2530

31+
{{/*
32+
Create the name of the stackstorm-ha service account to use
33+
*/}}
34+
{{- define "stackstorm-ha.serviceAccountName" -}}
35+
{{- default .Chart.Name .Values.serviceAccount.serviceAccountName -}}
36+
{{- end -}}
37+
2638
# Generate '-enterprise' suffix only when it's needed for resource names, docker images, etc
2739
{{- define "enterpriseSuffix" -}}
2840
{{ if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled }}-enterprise{{ end }}

templates/deployments.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ spec:
8686
readOnly: true
8787
resources:
8888
{{ toYaml .Values.st2auth.resources | indent 10 }}
89+
{{- if .Values.st2auth.serviceAccount.attach }}
90+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
91+
{{- end }}
8992
volumes:
9093
- name: st2-config-vol
9194
configMap:
@@ -219,6 +222,9 @@ spec:
219222
{{- end }}
220223
resources:
221224
{{ toYaml .Values.st2api.resources | indent 10 }}
225+
{{- if .Values.st2api.serviceAccount.attach }}
226+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
227+
{{- end }}
222228
volumes:
223229
{{- if .Values.secrets.st2.datastore_crypto_key }}
224230
- name: st2-encryption-key-vol
@@ -310,6 +316,9 @@ spec:
310316
subPath: st2.user.conf
311317
resources:
312318
{{ toYaml .Values.st2stream.resources | indent 10 }}
319+
{{- if .Values.st2stream.serviceAccount.attach }}
320+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
321+
{{- end }}
313322
volumes:
314323
- name: st2-config-vol
315324
configMap:
@@ -393,6 +402,9 @@ spec:
393402
volumeMounts: []
394403
resources:
395404
{{ toYaml .Values.st2web.resources | indent 10 }}
405+
{{- if .Values.st2web.serviceAccount.attach }}
406+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
407+
{{- end }}
396408
volumes: []
397409
{{- with .Values.st2web.nodeSelector }}
398410
nodeSelector:
@@ -473,6 +485,9 @@ spec:
473485
{{- end }}
474486
resources:
475487
{{ toYaml .Values.st2rulesengine.resources | indent 10 }}
488+
{{- if .Values.st2rulesengine.serviceAccount.attach }}
489+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
490+
{{- end }}
476491
volumes:
477492
- name: st2-config-vol
478493
configMap:
@@ -557,6 +572,9 @@ spec:
557572
subPath: st2.user.conf
558573
resources:
559574
{{ toYaml .Values.st2timersengine.resources | indent 10 }}
575+
{{- if .Values.st2timersengine.serviceAccount.attach }}
576+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
577+
{{- end }}
560578
volumes:
561579
- name: st2-config-vol
562580
configMap:
@@ -640,6 +658,9 @@ spec:
640658
{{- end }}
641659
resources:
642660
{{ toYaml .Values.st2workflowengine.resources | indent 10 }}
661+
{{- if .Values.st2workflowengine.serviceAccount.attach }}
662+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
663+
{{- end }}
643664
volumes:
644665
- name: st2-config-vol
645666
configMap:
@@ -722,6 +743,9 @@ spec:
722743
subPath: st2.user.conf
723744
resources:
724745
{{ toYaml .Values.st2scheduler.resources | indent 10 }}
746+
{{- if .Values.st2scheduler.serviceAccount.attach }}
747+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
748+
{{- end }}
725749
volumes:
726750
- name: st2-config-vol
727751
configMap:
@@ -797,6 +821,9 @@ spec:
797821
subPath: st2.user.conf
798822
resources:
799823
{{ toYaml .Values.st2notifier.resources | indent 10 }}
824+
{{- if .Values.st2notifier.serviceAccount.attach }}
825+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
826+
{{- end }}
800827
volumes:
801828
- name: st2-config-vol
802829
configMap:
@@ -942,6 +969,9 @@ spec:
942969
{{- end }}
943970
resources:
944971
{{ toYaml .resources | indent 10 }}
972+
{{- if .serviceAccount.attach }}
973+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" $ }}
974+
{{- end }}
945975
volumes:
946976
{{- if $.Values.secrets.st2.datastore_crypto_key }}
947977
- name: st2-encryption-key-vol
@@ -1092,6 +1122,9 @@ spec:
10921122
{{- end }}
10931123
resources:
10941124
{{ toYaml .Values.st2actionrunner.resources | indent 10 }}
1125+
{{- if .Values.st2actionrunner.serviceAccount.attach }}
1126+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
1127+
{{- end }}
10951128
volumes:
10961129
{{- if .Values.secrets.st2.datastore_crypto_key }}
10971130
- name: st2-encryption-key-vol
@@ -1189,6 +1222,9 @@ spec:
11891222
subPath: st2.user.conf
11901223
resources:
11911224
{{ toYaml .Values.st2garbagecollector.resources | indent 10 }}
1225+
{{- if .Values.st2garbagecollector.serviceAccount.attach }}
1226+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
1227+
{{- end }}
11921228
volumes:
11931229
- name: st2-config-vol
11941230
configMap:
@@ -1485,6 +1521,9 @@ spec:
14851521
periodSeconds: 30
14861522
resources:
14871523
{{ toYaml .Values.st2chatops.resources | indent 10 }}
1524+
{{- if .Values.st2chatops.serviceAccount.attach }}
1525+
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
1526+
{{- end }}
14881527
{{- with .Values.st2chatops.nodeSelector }}
14891528
nodeSelector:
14901529
{{ toYaml . | indent 8 }}

templates/service-account.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.serviceAccount.create }}
2+
---
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
name: {{ template "stackstorm-ha.serviceAccountName" . }}
7+
{{- if .Values.serviceAccount.serviceAccountAnnotations }}
8+
annotations:
9+
{{ toYaml .Values.serviceAccount.serviceAccountAnnotations | indent 4 }}
10+
{{- end }}
11+
labels:
12+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
13+
app: "{{ template "stackstorm-ha.name" . }}"
14+
heritage: "{{ .Release.Service }}"
15+
release: "{{ .Release.Name }}"
16+
{{- end }}

values.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ enterprise:
5353
# roles:
5454
# - "admin"
5555

56+
##
57+
## Service Account
58+
##
59+
serviceAccount:
60+
# Whether the Chart should create the service account or not
61+
create: true
62+
# Used to define service account annotations
63+
serviceAccountAnnotations: {}
64+
# Used to override service account name
65+
serviceAccountName:
66+
5667
##
5768
## StackStorm shared variables
5869
##
@@ -103,6 +114,8 @@ st2:
103114
affinity: {}
104115
nodeSelector: {}
105116
tolerations: []
117+
serviceAccount:
118+
attach: false
106119
# Import data into StackStorm's Key/Value datastore (https://docs.stackstorm.com/datastore.html)
107120
keyvalue:
108121
#- name: st2_version
@@ -227,6 +240,8 @@ st2web:
227240
nodeSelector: {}
228241
tolerations: []
229242
affinity: {}
243+
serviceAccount:
244+
attach: false
230245
# https://docs.stackstorm.com/reference/ha.html#st2auth
231246
# Multiple st2auth processes can be behind a load balancer in an active-active configuration.
232247
st2auth:
@@ -237,6 +252,8 @@ st2auth:
237252
nodeSelector: {}
238253
tolerations: []
239254
affinity: {}
255+
serviceAccount:
256+
attach: false
240257
# https://docs.stackstorm.com/reference/ha.html#st2api
241258
# Multiple st2api process can be behind a load balancer in an active-active configuration.
242259
st2api:
@@ -247,6 +264,8 @@ st2api:
247264
nodeSelector: {}
248265
tolerations: []
249266
affinity: {}
267+
serviceAccount:
268+
attach: false
250269
# https://docs.stackstorm.com/reference/ha.html#st2stream
251270
# Multiple st2stream process can be behind a load balancer in an active-active configuration.
252271
st2stream:
@@ -257,6 +276,8 @@ st2stream:
257276
nodeSelector: {}
258277
tolerations: []
259278
affinity: {}
279+
serviceAccount:
280+
attach: false
260281
# https://docs.stackstorm.com/reference/ha.html#st2rulesengine
261282
# Multiple st2rulesengine processes can run in active-active with only connections to MongoDB and RabbitMQ. All these will share the TriggerInstance load and naturally pick up more work if one or more of the processes becomes unavailable.
262283
st2rulesengine:
@@ -267,6 +288,8 @@ st2rulesengine:
267288
nodeSelector: {}
268289
tolerations: []
269290
affinity: {}
291+
serviceAccount:
292+
attach: false
270293
# https://docs.stackstorm.com/reference/ha.html#st2timersengine
271294
# Only single replica is created via K8s Deployment as timersengine can't work in active-active mode at the moment and it relies on K8s failover/reschedule capabilities to address cases of process failure.
272295
st2timersengine:
@@ -276,6 +299,8 @@ st2timersengine:
276299
nodeSelector: {}
277300
tolerations: []
278301
affinity: {}
302+
serviceAccount:
303+
attach: false
279304
# https://docs.stackstorm.com/reference/ha.html#st2workflowengine
280305
# Multiple st2workflowengine processes can run in active-active mode and will share the load and pick up more work if one or more of the processes become available.
281306
st2workflowengine:
@@ -286,6 +311,8 @@ st2workflowengine:
286311
nodeSelector: {}
287312
tolerations: []
288313
affinity: {}
314+
serviceAccount:
315+
attach: false
289316
# https://docs.stackstorm.com/reference/ha.html#st2scheduler
290317
# TODO: Description TBD
291318
st2scheduler:
@@ -296,6 +323,8 @@ st2scheduler:
296323
nodeSelector: {}
297324
tolerations: []
298325
affinity: {}
326+
serviceAccount:
327+
attach: false
299328
# https://docs.stackstorm.com/reference/ha.html#st2notifier
300329
# st2notifier runs in active-active mode and requires for that coordination backend like Redis or Zookeeper
301330
st2notifier:
@@ -306,6 +335,8 @@ st2notifier:
306335
nodeSelector: {}
307336
tolerations: []
308337
affinity: {}
338+
serviceAccount:
339+
attach: false
309340
# https://docs.stackstorm.com/reference/ha.html#st2actionrunner
310341
# Multiple st2actionrunner processes can run in active-active with only connections to MongoDB and RabbitMQ. Work gets naturally
311342
# distributed across runners via RabbitMQ. Adding more st2actionrunner processes increases the ability of StackStorm to execute actions.
@@ -326,6 +357,8 @@ st2actionrunner:
326357
# - hostnames:
327358
# - bar
328359
# ip: 8.8.8.8
360+
serviceAccount:
361+
attach: false
329362

330363
# https://docs.stackstorm.com/reference/ha.html#st2garbagecollector
331364
# Optional service that cleans up old executions and other operations data based on setup configurations.
@@ -339,6 +372,8 @@ st2garbagecollector:
339372
nodeSelector: {}
340373
tolerations: []
341374
affinity: {}
375+
serviceAccount:
376+
attach: false
342377

343378
##
344379
## StackStorm ChatOps (https://docs.stackstorm.com/chatops/index.html)
@@ -371,6 +406,8 @@ st2chatops:
371406
nodeSelector: {}
372407
tolerations: []
373408
affinity: {}
409+
serviceAccount:
410+
attach: false
374411

375412
##
376413
## MongoDB HA configuration (3rd party chart dependency)

0 commit comments

Comments
 (0)