Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Development
* Fix syntax with ensure-packs-volumes-are-writable job (#403) (by @skiedude)
* 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)

## v1.0.0
* Bump to latest CircleCI orb versions ([email protected] and [email protected] by @ZoeLeah)
Expand Down
9 changes: 6 additions & 3 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
{{- with $.Values.securityContext }}
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -365,7 +366,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
{{- with .Values.securityContext }}
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -384,7 +386,8 @@ Merge packs and virtualenvs from st2 with those from st2packs images
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/configs/. /opt/stackstorm/configs-shared
{{- with .Values.securityContext }}
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down
18 changes: 9 additions & 9 deletions templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ spec:
- name: st2web
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with default .Values.securityContext .Values.st2web.securityContext }}
{{- with .Values.st2web.securityContext | default .Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
ports:
Expand Down Expand Up @@ -515,7 +515,7 @@ spec:
{{- with .Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with default .Values.podSecurityContext .Values.st2client.podSecurityContext }}
{{- with .Values.st2web.podSecurityContext | default .Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.st2web.nodeSelector }}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ spec:
- name: {{ $name }}
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- with default $.Values.securityContext $sensor.securityContext }}
{{- with $sensor.securityContext | default $.Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
{{- with $sensor.readinessProbe }}
Expand Down Expand Up @@ -1282,7 +1282,7 @@ spec:
{{- with $.Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with default $.Values.podSecurityContext $sensor.podSecurityContext }}
{{- with $sensor.podSecurityContext | default $.Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $sensor.nodeSelector }}
Expand Down Expand Up @@ -1353,7 +1353,7 @@ spec:
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
{{- end }}
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
# TODO: Add liveness/readiness probes (#3)
Expand Down Expand Up @@ -1436,7 +1436,7 @@ spec:
{{- with .Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with default .Values.podSecurityContext .Values.st2actionrunner.podSecurityContext }}
{{- with .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.st2actionrunner.nodeSelector }}
Expand Down Expand Up @@ -1600,7 +1600,7 @@ spec:
- name: generate-st2client-config
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.securityContext }}
{{- with .Values.st2client.securityContext | default .Values.st2actionrunner.securityContext | default .Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
envFrom:
Expand All @@ -1627,7 +1627,7 @@ spec:
- name: st2client
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
{{- with .Values.st2client.securityContext | default .Values.st2actionrunner.securityContext | default .Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
env:
Expand Down Expand Up @@ -1728,7 +1728,7 @@ spec:
{{- with .Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with default .Values.podSecurityContext .Values.st2client.podSecurityContext }}
{{- with .Values.st2client.podSecurityContext | default .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.st2client.nodeSelector }}
Expand Down
15 changes: 9 additions & 6 deletions templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ spec:
- name: st2-register-content-custom-init
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.securityContext }}
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
command: {{- toYaml $.Values.jobs.preRegisterContentCommand | nindent 8 }}
Expand All @@ -425,7 +426,8 @@ spec:
- name: st2-register-content
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.securityContext }}
{{- with .Values.st2actionrunner.securityContext | default .Values.securityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
command:
Expand Down Expand Up @@ -470,7 +472,8 @@ spec:
{{- with .Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podSecurityContext }}
{{- with .Values.st2actionrunner.podSecurityContext | default .Values.podSecurityContext }}
{{/* st2actionrunner is likely the most permissive so use that if defined. */}}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.nodeSelector }}
Expand Down Expand Up @@ -641,7 +644,7 @@ spec:
- name: generate-st2client-config
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- with $.Values.securityContext }}
{{- with $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
envFrom:
Expand All @@ -668,7 +671,7 @@ spec:
- name: {{ $name }}
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- with $.Values.securityContext }}
{{- with .securityContext | default $.Values.st2actionrunner.securityContext | default $.Values.securityContext }}
securityContext: {{- toYaml . | nindent 10 }}
{{- end }}
{{- if $.Values.jobs.env }}
Expand Down Expand Up @@ -718,7 +721,7 @@ spec:
{{- with $.Values.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.podSecurityContext }}
{{- with .podSecurityContext | default $.Values.st2actionrunner.podSecurityContext | default $.Values.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.jobs.nodeSelector }}
Expand Down
Loading