Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to define config.js for st2web #165

Merged
merged 1 commit into from
Jan 25, 2021
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
@@ -1,6 +1,7 @@
# Changelog

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

## v0.51.0
* Added Redis with Sentinel to replace etcd as a coordination backend (#169)
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 }}
16 changes: 16 additions & 0 deletions templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ spec:
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2web.yaml") . | sha256sum }}
spec:
imagePullSecrets:
{{- if .Values.enterprise.enabled }}
Expand Down Expand Up @@ -409,13 +411,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
moonrail marked this conversation as resolved.
Show resolved Hide resolved
{{- 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