Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f8128ed
Removing enterprise flags form rbac configs
Feb 16, 2021
513fef8
Updating deployments to remove enterprise flags
Feb 16, 2021
31242c5
Update remaining templates to remove enterprise support
Feb 16, 2021
fa35a3e
Updating helpers.tpl to remove enterprise flags
Feb 16, 2021
d891836
Updating helpers.tpl to fix linting error
Feb 16, 2021
e9a07e4
Updating chart version
Feb 16, 2021
b658342
Merge branch 'master' into master
arm4b Feb 19, 2021
12dea23
Removing Support Method tags
Feb 23, 2021
6468862
Merge branch 'master' of github.com:hnanchahal/stackstorm-ha
Feb 23, 2021
f4bb60d
Update st2.user.conf config
Feb 23, 2021
1483334
Fixing linting errors
Feb 23, 2021
98692a5
linting check
Feb 23, 2021
bd5c6e2
Updating rbac references to rbac configmaps
Feb 24, 2021
1d75f39
Adding rbac config support
Mar 5, 2021
f0db028
Update rbac configs
Mar 5, 2021
45c9245
Updating appVersion
Mar 11, 2021
1d9c1cb
Fix linting error
Mar 11, 2021
e0dbba5
Merge branch 'master' of github.com:StackStorm/stackstorm-ha
Mar 22, 2021
f40bfe1
Revert appVersion to 3.4dev
arm4b Mar 24, 2021
a679c91
Use the proper Changelog record
arm4b Mar 24, 2021
37b87d6
Include CI instructions for RBAC upgrade scenario
arm4b Mar 24, 2021
c350333
Fix yaml indentation
arm4b Mar 24, 2021
c572947
Fix Helm upgrade error: "mapping values are not allowed in this context"
arm4b Mar 24, 2021
97e5bdc
Add RBAC tests in BATS
arm4b Mar 24, 2021
7c99827
Fix Changelog format
arm4b Mar 24, 2021
4106485
Remove remaining enterprise bits
arm4b Mar 24, 2021
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
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ jobs:
name: Helm install stackstorm-ha chart
command: helm install --timeout 10m0s --debug --wait --name-template stackstorm-ha .
- run:
# once https://github.com/helm/community/pull/165 is merged we will need to add the parallelism flag back into the
# below command
name: Helm test
command: helm test stackstorm-ha
- run:
name: Helm upgrade with RBAC enabled
command: helm upgrade --set st2.rbac.enabled=true --timeout 5m0s --debug --wait stackstorm-ha .
- run:
name: Helm test with RBAC enabled
command: helm test stackstorm-ha
- run:
when: always
name: Show created K8s resources
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## In Development
* Change st2packs definition to a list, to support multiple st2packs containers (#166) (by @moonrail)
* Enabled RBAC/LDAP configuration for OSS version, removed enterprise flags (#182) (by @hnanchahal)

## v0.52.0
* Improve resource allocation and scheduling by adding resources requests cpu/memory values for st2 Pods (#179)
Expand Down
4 changes: 2 additions & 2 deletions 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.4dev"
name: stackstorm-ha
version: 0.52.0
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
Expand All @@ -25,7 +25,7 @@ maintainers:
url: https://github.com/armab
details:
This Helm chart is a fully installable app that codifies StackStorm cluster deployment optimized for HA and K8s environment.
RabbitMQ-HA, MongoDB-HA clusters and coordination backend st2 relies on will be deployed as 3rd party chart dependencies.
RabbitMQ-HA, MongoDB-HA clusters and Redis coordination backend st2 relies on will be deployed as 3rd party chart dependencies.
For configuration details please check default values.yaml and README.
dependencies:
- name: rabbitmq
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
29 changes: 3 additions & 26 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 Expand Up @@ -160,7 +137,7 @@ Create the name of the stackstorm-ha service account to use
{{- end }}
# System packs
- name: st2-system-packs
image: "{{ template "imageRepository" . }}/st2actionrunner{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
image: "{{ template "imageRepository" . }}/st2actionrunner:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: st2-packs-vol
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