Skip to content
Closed
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 @@ -7,6 +7,7 @@
* Improve resource allocation and scheduling by adding resources requests cpu/memory values for st2 Pods (#179)
* Avoid cluster restart loop situations by making st2 Pod initContainers to wait for DB/MQ connection (#178)
* Add option to define config.js for st2web (#165) (by @moonrail)
* Removed enterprise flags to enable rbac (#182 by @hnanchahal)

## v0.51.0
* Added Redis with Sentinel to replace etcd as a coordination backend (#169)
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
# StackStorm version which refers to Docker images tag
appVersion: 3.4dev
appVersion: "3.4"
name: stackstorm-ha
version: 0.52.0
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
Expand Down
10 changes: 5 additions & 5 deletions templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Congratulations! You have just deployed StackStorm {{ if .Values.enterprise.enabled }}Enterprise {{ end }}HA!
Congratulations! You have just deployed StackStorm HA!

███████╗████████╗██████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗
██╔════╝╚══██╔══╝╚════██╗ ██║ ██║██╔══██╗ ██╔═══██╗██║ ██╔╝
Expand All @@ -11,20 +11,20 @@ Congratulations! You have just deployed StackStorm {{ if .Values.enterprise.enab
{{- if contains "LoadBalancer" .Values.st2web.service.type }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with "kubectl get service {{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'"
Watch the status with "kubectl get service {{ .Release.Name }}-st2web -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'"

export ST2WEB_IP=$(kubectl get service {{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }} -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
export ST2WEB_IP=$(kubectl get service {{ .Release.Name }}-st2web -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
echo https://${ST2WEB_IP}/

{{- else if contains "ClusterIP" .Values.st2web.service.type }}

echo http://127.0.0.1:8080
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }} 8080:80
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Release.Name }}-st2web 8080:80

{{- else if contains "NodePort" .Values.st2web.service.type }}

export ST2WEB_IP=$(minikube ip 2>/dev/null || kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
export ST2WEB_PORT="$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }})"
export ST2WEB_PORT="$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Release.Name }}-st2web)"
echo http://${ST2WEB_IP}:${ST2WEB_PORT}/

{{- end }}
Expand Down
27 changes: 2 additions & 25 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,9 @@
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

# Image pull secret used to access private docker.stackstorm.com Docker registry with Enterprise images
{{- define "imagePullSecret" }}
{{- if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled -}}
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" "docker.stackstorm.com" (printf "%s:%s" .Values.enterprise.license .Values.enterprise.license | b64enc) | b64enc }}
{{- end -}}
{{- end }}

# Generate support method used in labels. This is based on community/enterprise
{{- define "supportMethod" -}}
{{- if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled -}}
enterprise
{{- else -}}
community
{{- end -}}
{{- end }}

# Generate Docker image repository: Private 'docker.stackstorm.com' for Enterprise vs Public Docker Hub 'stackstorm' for FOSS version
# Generate Docker image repository: Public Docker Hub 'stackstorm' for FOSS version
{{- define "imageRepository" -}}
{{- if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled -}}
docker.stackstorm.com
{{- else if .Values.image.repository -}}
{{- if .Values.image.repository -}}
{{ .Values.image.repository }}
{{- else -}}
stackstorm
Expand All @@ -37,11 +19,6 @@ Create the name of the stackstorm-ha service account to use
{{- default .Chart.Name .Values.serviceAccount.serviceAccountName -}}
{{- end -}}

# Generate '-enterprise' suffix only when it's needed for resource names, docker images, etc
{{- define "enterpriseSuffix" -}}
{{ if required "Missing context '.Values.enterprise.enabled'!" .Values.enterprise.enabled }}-enterprise{{ end }}
{{- end -}}

# Generate '-' prefix only when the variable is defined
{{- define "hyphenPrefix" -}}
{{ if . }}-{{ . }}{{end}}
Expand Down
1 change: 0 additions & 1 deletion templates/configmaps_packs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: {{ template "supportMethod" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand Down
15 changes: 6 additions & 9 deletions templates/configmaps_rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.enterprise.enabled }}
{{- if .Values.st2.rbac.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -10,12 +10,11 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ toYaml .Values.enterprise.rbac.roles | indent 2 }}
{{ toYaml .Values.st2.rbac.roles | indent 2 }}

---
apiVersion: v1
Expand All @@ -28,12 +27,11 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ toYaml .Values.enterprise.rbac.assignments | indent 2 }}
{{ toYaml .Values.st2.rbac.assignments | indent 2 }}

---
apiVersion: v1
Expand All @@ -46,14 +44,13 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{- if .Values.enterprise.rbac.mappings }}
{{ toYaml .Values.enterprise.rbac.mappings | indent 2 }}
{{- if .Values.st2.rbac.mappings }}
{{ toYaml .Values.st2.rbac.mappings | indent 2 }}
{{ else }}
{}
{{ end }}
{{ end }}
{{- end }}
9 changes: 7 additions & 2 deletions templates/configmaps_st2-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: {{ template "supportMethod" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand All @@ -19,7 +18,7 @@ data:
# The order of merging: st2.conf < st2.docker.conf < st2.user.conf
st2.docker.conf: |
[auth]
api_url = http://{{ .Release.Name }}-st2api{{ template "enterpriseSuffix" . }}:9101/
api_url = http://{{ .Release.Name }}-st2api:9101/
{{- if index .Values "redis" "enabled" }}
[coordination]
url = redis://{{ template "redis-nodes" $ }}
Expand All @@ -44,8 +43,14 @@ data:
[keyvalue]
encryption_key_path = /etc/st2/keys/datastore_key.json
{{- end }}
{{- if .Values.st2.rbac.enabled }}
[rbac]
enable = True
backend = default
{{- end }}

# User-defined st2 config with custom settings applied on top of everything else.
# The order of merging: st2.conf < st2.docker.conf < st2.user.conf
st2.user.conf: |
{{ .Values.st2.config | indent 4 }}

7 changes: 3 additions & 4 deletions templates/configmaps_st2-urls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: {{ template "supportMethod" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
ST2_AUTH_URL: http://{{ .Release.Name }}-st2auth{{ template "enterpriseSuffix" . }}:9100/
ST2_API_URL: http://{{ .Release.Name }}-st2api{{ template "enterpriseSuffix" . }}:9101/
ST2_STREAM_URL: http://{{ .Release.Name }}-st2stream{{ template "enterpriseSuffix" . }}:9102/
ST2_AUTH_URL: http://{{ .Release.Name }}-st2auth:9100/
ST2_API_URL: http://{{ .Release.Name }}-st2api:9101/
ST2_STREAM_URL: http://{{ .Release.Name }}-st2stream:9102/
1 change: 0 additions & 1 deletion templates/configmaps_st2web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ metadata:
app: st2
tier: backend
vendor: stackstorm
support: {{ template "supportMethod" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand Down
Loading