Skip to content

Commit 4c20f41

Browse files
authored
Merge branch 'master' into removeDataStoreKeyLabels
2 parents 62964b5 + b9e3b8c commit 4c20f41

File tree

8 files changed

+255
-27
lines changed

8 files changed

+255
-27
lines changed

CHANGELOG.md

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

3-
## In Development
3+
## Development
4+
* Fix syntax with ensure-packs-volumes-are-writable job (#403) (by @skiedude)
5+
* Add securityContext support to custom st2packs images, extra_hooks jobs; Also fallback to st2actionrunner securityContext for misc init container jobs and pods. (#410) (by @cognifloyd)
6+
7+
## v1.0.0
48
* Bump to latest CircleCI orb versions (kubernetes@1.3.1 and helm@3.0.0 by @ZoeLeah)
59
* Remove unsupported k8s Versions (1.24.x and 1.25.x by @ZoeLeah)
610
* Update and add new K8s versions (1.28.3, 1.27.7 and 1.26.10 by @ZoeLeah)

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
# StackStorm version which refers to Docker images tag
33
appVersion: "3.8"
44
name: stackstorm-ha
5-
version: 0.110.0
5+
version: 1.0.0
66
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
77
home: https://stackstorm.com/
88
icon: https://landscape.cncf.io/logos/stack-storm.svg

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ NOTE: With care, `st2packs` images can be used with `volumes`. Just make sure to
241241
If a pack is installed via an `st2packs` image and then it gets updated with `st2 pack install`, a subsequent `helm upgrade` will revert back to the version in the `st2packs` image.
242242

243243
#### Configure the storage volumes
244-
Enable the `st2.packs.voluems` section of Helm values and add volume definitions for both `packs` and `virtualenvs`.
244+
Enable the `st2.packs.volumes` section of Helm values and add volume definitions for both `packs` and `virtualenvs`.
245245
Each of the volume definitions should be customized for your cluster and storage solution.
246246

247247
For example, to use persistentVolumeClaims:
@@ -369,3 +369,11 @@ This approach allows not only extending sub-chart with custom objects and templa
369369
but also adds flexibility to include many sub-chart dependencies and pin versions as well as include all the sub-chart values in one single place.
370370
This approach is infra-as-code friendly and more reproducible. See official Helm documentation about
371371
[Subcharts](https://helm.sh/docs/chart_template_guide/#subcharts-and-global-values) and [Dependencies](https://helm.sh/docs/developing_charts/#managing-dependencies-manually-via-the-charts-directory).
372+
373+
## Releasing information
374+
In order to create a release, the steps are as follows:
375+
1. Create a pull request by updating [CHANGELOG.md](./CHANGELOG.md) by replacing the "In Development" heading with the new version, and [Chart.yaml](./Chart.yaml) by replacing the `version` value.
376+
2. Once the pull request is merged, create and push the matching tag (for example, if you are creating release `v1.0.0`, then the tag should also be `v1.0.0`).
377+
3. After the tag is pushed, create the corresponding [release](https://github.com/StackStorm/stackstorm-k8s/releases).
378+
4. After the release is created, switch to the `gh-pages` branch, and generate the updated [Helm index](https://helm.sh/docs/helm/helm_repo_index/), [package](https://helm.sh/docs/helm/helm_package/) and [provenance](https://helm.sh/docs/topics/provenance/).
379+
5. After committing and pushing the changes in the previous step, verify that the new release is present on [ArtifactHub](https://artifacthub.io/packages/helm/stackstorm/stackstorm-ha).

templates/_helpers.tpl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
344344
- |
345345
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
346346
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
347-
{{- with $.Values.securityContext }}
347+
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
348+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
348349
securityContext: {{- toYaml . | nindent 8 }}
349350
{{- end }}
350351
{{- end }}
@@ -365,7 +366,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
365366
- |
366367
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
367368
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
368-
{{- with .Values.securityContext }}
369+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
370+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
369371
securityContext: {{- toYaml . | nindent 8 }}
370372
{{- end }}
371373
{{- end }}
@@ -384,7 +386,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
384386
- '-ec'
385387
- |
386388
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared
387-
{{- with .Values.securityContext }}
389+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
390+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
388391
securityContext: {{- toYaml . | nindent 8 }}
389392
{{- end }}
390393
{{- end }}

templates/deployments.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ spec:
430430
- name: st2web
431431
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
432432
imagePullPolicy: {{ .Values.image.pullPolicy }}
433-
{{- with default .Values.securityContext .Values.st2web.securityContext }}
433+
{{- with .Values.st2web.securityContext | default .Values.securityContext }}
434434
securityContext: {{- toYaml . | nindent 10 }}
435435
{{- end }}
436436
ports:
@@ -517,7 +517,7 @@ spec:
517517
{{- with .Values.dnsConfig }}
518518
dnsConfig: {{- toYaml . | nindent 8 }}
519519
{{- end }}
520-
{{- with default .Values.podSecurityContext .Values.st2client.podSecurityContext }}
520+
{{- with .Values.st2web.podSecurityContext | default .Values.podSecurityContext }}
521521
securityContext: {{- toYaml . | nindent 8 }}
522522
{{- end }}
523523
{{- with .Values.st2web.nodeSelector }}
@@ -1197,7 +1197,7 @@ spec:
11971197
- name: {{ $name }}
11981198
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
11991199
imagePullPolicy: {{ $.Values.image.pullPolicy }}
1200-
{{- with default $.Values.securityContext $sensor.securityContext }}
1200+
{{- with $sensor.securityContext | default $.Values.securityContext }}
12011201
securityContext: {{- toYaml . | nindent 10 }}
12021202
{{- end }}
12031203
{{- with $sensor.readinessProbe }}
@@ -1292,7 +1292,7 @@ spec:
12921292
{{- with $.Values.dnsConfig }}
12931293
dnsConfig: {{- toYaml . | nindent 8 }}
12941294
{{- end }}
1295-
{{- with default $.Values.podSecurityContext $sensor.podSecurityContext }}
1295+
{{- with $sensor.podSecurityContext | default $.Values.podSecurityContext }}
12961296
securityContext: {{- toYaml . | nindent 8 }}
12971297
{{- end }}
12981298
{{- with $sensor.nodeSelector }}
@@ -1365,7 +1365,7 @@ spec:
13651365
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
13661366
{{- end }}
13671367
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
1368-
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
1368+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
13691369
securityContext: {{- toYaml . | nindent 10 }}
13701370
{{- end }}
13711371
# TODO: Add liveness/readiness probes (#3)
@@ -1448,7 +1448,7 @@ spec:
14481448
{{- with .Values.dnsConfig }}
14491449
dnsConfig: {{- toYaml . | nindent 8 }}
14501450
{{- end }}
1451-
{{- with default .Values.podSecurityContext .Values.st2actionrunner.podSecurityContext }}
1451+
{{- with .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
14521452
securityContext: {{- toYaml . | nindent 8 }}
14531453
{{- end }}
14541454
{{- with .Values.st2actionrunner.nodeSelector }}
@@ -1614,7 +1614,7 @@ spec:
16141614
- name: generate-st2client-config
16151615
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
16161616
imagePullPolicy: {{ .Values.image.pullPolicy }}
1617-
{{- with .Values.securityContext }}
1617+
{{- with .Values.st2client.securityContext | default .Values.st2actionrunner.securityContext | default .Values.securityContext }}
16181618
securityContext: {{- toYaml . | nindent 10 }}
16191619
{{- end }}
16201620
envFrom:
@@ -1641,7 +1641,7 @@ spec:
16411641
- name: st2client
16421642
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
16431643
imagePullPolicy: {{ .Values.image.pullPolicy }}
1644-
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
1644+
{{- with .Values.st2client.securityContext | default .Values.st2actionrunner.securityContext | default .Values.securityContext }}
16451645
securityContext: {{- toYaml . | nindent 10 }}
16461646
{{- end }}
16471647
env:
@@ -1742,7 +1742,7 @@ spec:
17421742
{{- with .Values.dnsConfig }}
17431743
dnsConfig: {{- toYaml . | nindent 8 }}
17441744
{{- end }}
1745-
{{- with default .Values.podSecurityContext .Values.st2client.podSecurityContext }}
1745+
{{- with .Values.st2client.podSecurityContext | default .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
17461746
securityContext: {{- toYaml . | nindent 8 }}
17471747
{{- end }}
17481748
{{- with .Values.st2client.nodeSelector }}

templates/jobs.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ spec:
411411
- name: st2-register-content-custom-init
412412
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
413413
imagePullPolicy: {{ .Values.image.pullPolicy }}
414-
{{- with .Values.securityContext }}
414+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
415+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
415416
securityContext: {{- toYaml . | nindent 10 }}
416417
{{- end }}
417418
command: {{- toYaml $.Values.jobs.preRegisterContentCommand | nindent 8 }}
@@ -425,7 +426,8 @@ spec:
425426
- name: st2-register-content
426427
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
427428
imagePullPolicy: {{ .Values.image.pullPolicy }}
428-
{{- with .Values.securityContext }}
429+
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
430+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
429431
securityContext: {{- toYaml . | nindent 10 }}
430432
{{- end }}
431433
command:
@@ -470,7 +472,8 @@ spec:
470472
{{- with .Values.dnsConfig }}
471473
dnsConfig: {{- toYaml . | nindent 8 }}
472474
{{- end }}
473-
{{- with .Values.podSecurityContext }}
475+
{{- with .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
476+
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
474477
securityContext: {{- toYaml . | nindent 8 }}
475478
{{- end }}
476479
{{- with .Values.jobs.nodeSelector }}
@@ -540,7 +543,7 @@ spec:
540543
and then delete this st2canary pod manually.
541544
INTRO
542545
543-
function __handle_error__(){
546+
function __handle_error__ {
544547
cat <<- 'FAIL'
545548
ERROR: One or more volumes in st2.packs.volumes (from helm values) does not meet
546549
StackStorm's shared volumes requirements!
@@ -577,6 +580,7 @@ spec:
577580
{{- toYaml $.Values.st2.packs.volumes.configs | nindent 10 }}
578581
{{- end }}
579582
# st2canary job does not support extra_volumes. Let us know if you need this.
583+
restartPolicy: Never
580584
{{- if $.Values.dnsPolicy }}
581585
dnsPolicy: {{ $.Values.dnsPolicy }}
582586
{{- end }}
@@ -640,7 +644,7 @@ spec:
640644
- name: generate-st2client-config
641645
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
642646
imagePullPolicy: {{ $.Values.image.pullPolicy }}
643-
{{- with $.Values.securityContext }}
647+
{{- with $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
644648
securityContext: {{- toYaml . | nindent 10 }}
645649
{{- end }}
646650
envFrom:
@@ -667,7 +671,7 @@ spec:
667671
- name: {{ $name }}
668672
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
669673
imagePullPolicy: {{ $.Values.image.pullPolicy }}
670-
{{- with $.Values.securityContext }}
674+
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
671675
securityContext: {{- toYaml . | nindent 10 }}
672676
{{- end }}
673677
{{- if $.Values.jobs.env }}
@@ -717,7 +721,7 @@ spec:
717721
{{- with $.Values.dnsConfig }}
718722
dnsConfig: {{- toYaml . | nindent 8 }}
719723
{{- end }}
720-
{{- with $.Values.podSecurityContext }}
724+
{{- with .podSecurityContext | default $.Values.st2actionrunner.podSecurityContext | default $.Values.podSecurityContext }}
721725
securityContext: {{- toYaml . | nindent 8 }}
722726
{{- end }}
723727
{{- with $.Values.jobs.nodeSelector }}

0 commit comments

Comments
 (0)