Skip to content

Commit

Permalink
Added option to define config.js for st2web
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrail committed Dec 23, 2020
1 parent 562bae5 commit 1c51038
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## In Development
* Add option to define config.js for st2web (#165) (by @moonrail)


## v0.40.0
Expand Down
22 changes: 22 additions & 0 deletions templates/configmaps_st2web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.st2web.config }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-st2web-config
annotations:
description: Custom StackStorm Web config which will override defaults
labels:
app: st2
tier: backend
vendor: stackstorm
support: {{ template "supportMethod" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
# User-defined st2web config with custom settings to replace default config.js
# See https://github.com/StackStorm/st2web#connecting-to-st2-server for more info
st2web.config.js: |
{{ .Values.st2web.config | indent 4 }}
{{- end }}
14 changes: 14 additions & 0 deletions templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,27 @@ spec:
- configMapRef:
name: {{ .Release.Name }}-st2-urls
optional: true
{{- if .Values.st2web.config }}
volumeMounts:
- name: st2web-config-vol
mountPath: /opt/stackstorm/static/webui/config.js
subPath: st2web.config.js
{{- else }}
volumeMounts: []
{{- end }}
resources:
{{ toYaml .Values.st2web.resources | indent 10 }}
{{- if .Values.st2web.serviceAccount.attach }}
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
{{- end }}
{{- if .Values.st2web.config }}
volumes:
- name: st2web-config-vol
configMap:
name: {{ .Release.Name }}-st2web-config
{{- else }}
volumes: []
{{- end }}
{{- with .Values.st2web.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ st2web:
affinity: {}
serviceAccount:
attach: false
# User-defined st2web config with custom settings to replace default config.js
# See https://github.com/StackStorm/st2web#connecting-to-st2-server for more info
# config: |
# // see https://github.com/StackStorm/st2web/blob/master/config.js
# https://docs.stackstorm.com/reference/ha.html#st2auth
# Multiple st2auth processes can be behind a load balancer in an active-active configuration.
st2auth:
Expand Down

0 comments on commit 1c51038

Please sign in to comment.