diff --git a/CHANGELOG.md b/CHANGELOG.md index 6648e9fa..6cde26f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## In Development +* Add option to define config.js for st2web (#165) (by @moonrail) ## v0.50.0 * Drop Helm `v2` support and fully migrate to Helm `v3` (#163) diff --git a/templates/configmaps_st2web.yaml b/templates/configmaps_st2web.yaml new file mode 100644 index 00000000..c861a812 --- /dev/null +++ b/templates/configmaps_st2web.yaml @@ -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 }} diff --git a/templates/deployments.yaml b/templates/deployments.yaml index c1aed4bc..996b37df 100644 --- a/templates/deployments.yaml +++ b/templates/deployments.yaml @@ -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 }} diff --git a/values.yaml b/values.yaml index 9f493f2c..0c22ecd1 100644 --- a/values.yaml +++ b/values.yaml @@ -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: