Skip to content

Commit b6ddc52

Browse files
authored
Merge branch 'master' into generate-crypto-key
2 parents bb37eaa + c832db4 commit b6ddc52

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* New feature: Add `envFromSecrets` to `st2actionrunner`, `st2client`, `st2sensorcontainer`, and jobs. This is useful for adding custom secrets to the environment. This complements the `extra_volumes` feature (loading secrets as files) to facilitate loading secrets that are not easily injected via the filesystem. (#259) (by @cognifloyd)
1414
* New feature to include `nodeSelector`, `affinity` and `tolerations` to `st2client`, allowing more flexibility to pod positioning. (#263) (by @sandesvitor)
1515
* Template `~/.st2/config`. This allows customizing the settings used by the `st2client` and jobs pods for using the st2 apis. (#262) (by @cognifloyd)
16+
* Fix indent for lifecycle postStart hook of `st2web` pod. (#268) (by @cognifloyd)
17+
* Advanced Feature: Allow `st2web` to serve HTTPS when the ssl certs are provided via `st2web.extra_volumes`. To enable this, add `ST2WEB_HTTPS: "1"` to `st2web.env` in your values file. (#264) (by @cognifloyd)
1618
* Auto-generate `datastore_crypto_key` on install if not provided. This way all HA installs will have a datastore_crypto_key configured. (#266) (by @cognifloyd)
1719

1820
## v0.70.0

templates/deployments.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,13 @@ spec:
396396
image: '{{ template "imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
397397
imagePullPolicy: {{ .Values.image.pullPolicy }}
398398
ports:
399-
- containerPort: 80
399+
- containerPort: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
400400
# Probe to check if app is running. Failure will lead to a pod restart.
401401
livenessProbe:
402402
httpGet:
403-
scheme: HTTP
403+
scheme: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary "HTTPS" "HTTP" }}
404404
path: /
405-
port: 80
405+
port: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
406406
initialDelaySeconds: 1
407407
# Probe to check if app is ready to serve traffic. Failure will lead to temp stop serving traffic.
408408
# TODO: Failing to add readinessProbe, since st2 requires authorization (401) and we don't have `/healthz` endpoints yet (https://github.com/StackStorm/st2/issues/4020)
@@ -422,20 +422,24 @@ spec:
422422
- configMapRef:
423423
name: {{ .Release.Name }}-st2-urls
424424
optional: true
425-
{{- if or .Values.st2web.config .Values.st2web.postStartScript }}
425+
{{- if or .Values.st2web.config .Values.st2web.extra_volumes .Values.st2web.postStartScript }}
426426
volumeMounts:
427427
{{- else }}
428428
volumeMounts: []
429429
{{- end }}
430+
{{- range .Values.st2web.extra_volumes }}
431+
- name: {{ required "Each volume must have a 'name' in st2web.extra_volumes" .name }}
432+
{{- tpl (required "Each volume must have a 'mount' definition in st2web.extra_volumes" .mount | toYaml) $ | nindent 12 }}
433+
{{- end }}
430434
{{- if .Values.st2web.config }}
431435
- name: st2web-config-vol
432436
mountPath: /opt/stackstorm/static/webui/config.js
433437
subPath: st2web.config.js
434438
{{- end }}
435439
{{- if .Values.st2web.postStartScript }}
436-
- name: st2-post-start-script-vol
437-
mountPath: /post-start.sh
438-
subPath: post-start.sh
440+
- name: st2-post-start-script-vol
441+
mountPath: /post-start.sh
442+
subPath: post-start.sh
439443
lifecycle:
440444
postStart:
441445
exec:
@@ -446,11 +450,15 @@ spec:
446450
{{- if .Values.st2web.serviceAccount.attach }}
447451
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
448452
{{- end }}
449-
{{- if or .Values.st2web.config .Values.st2web.postStartScript }}
453+
{{- if or .Values.st2web.config .Values.st2web.extra_volumes .Values.st2web.postStartScript }}
450454
volumes:
451455
{{- else }}
452456
volumes: []
453457
{{- end }}
458+
{{- range .Values.st2web.extra_volumes }}
459+
- name: {{ required "Each volume must have a 'name' in st2web.extra_volumes" .name }}
460+
{{- tpl (required "Each volume must have a 'volume' definition in st2web.extra_volumes" .volume | toYaml) $ | nindent 10 }}
461+
{{- end }}
454462
{{- if .Values.st2web.config }}
455463
- name: st2web-config-vol
456464
configMap:

templates/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ spec:
9999
{{- end }}
100100
ports:
101101
- protocol: TCP
102-
port: 80
102+
port: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
103103

104104
{{ if .Values.st2chatops.enabled -}}
105105
---

values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,17 @@ st2web:
296296
affinity: {}
297297
env: {}
298298
# HTTP_PROXY: http://proxy:1234
299+
## st2web serves HTTP (port 80) so that SSL termination can be managed
300+
## using kubernetes-native features like LoadBalancer or Ingress Controllers.
301+
## To configure st2web to directly serve HTTPS (port 443) instead of HTTP,
302+
## provide ssl certs via extra_volumes, and add the ST2WEB_HTTPS env var here:
303+
# ST2WEB_HTTPS: 1
299304
serviceAccount:
300305
attach: false
306+
# mount extra volumes on the st2web pod(s) (primarily useful for k8s-provisioned secrets)
307+
## Note that Helm templating is supported in 'mount' and 'volume'
308+
extra_volumes: []
309+
# see examples under st2workflowengine.extra_volumes
301310
# User-defined st2web config with custom settings to replace default config.js
302311
# See https://github.com/StackStorm/st2web#connecting-to-st2-server for more info
303312
# config: |

0 commit comments

Comments
 (0)