Skip to content

Commit cce832b

Browse files
authored
Merge pull request #68 from StackStorm/add/ingress
Add support for ingress
2 parents dff8360 + 389a5f2 commit cce832b

File tree

6 files changed

+106
-4
lines changed

6 files changed

+106
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## In Development
44

5+
## v0.15.0
6+
* Add support for ingress (#68)
7+
58
## v0.14.0
69
* Pin st2 version to `v3.1dev` as a new latest development version (#67)
710

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
# Update StackStorm version here to rely on other Docker images tags
33
appVersion: 3.1dev
44
name: stackstorm-ha
5-
version: 0.14.0
5+
version: 0.15.0
66
description: StackStorm K8s Helm Chart, optimized for running StackStorm in HA environment.
77
home: https://stackstorm.com/#product
88
icon: https://avatars1.githubusercontent.com/u/4969009

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ See Helm `values.yaml`, `enterprise` section for configuration examples.
4545
> Don't have StackStorm Enterprise License?<br>
4646
> 90-day free trial can be requested at https://stackstorm.com/#product
4747
48+
## Configuration
49+
50+
The default configuration values for this chart are described in `values.yaml`.
51+
52+
## Ingress
53+
54+
Ingress is worth considering if you want to expose multiple services under the same IP address, and
55+
these services all use the same L7 protocol (typically HTTP). You only pay for one load balancer if
56+
you are using native cloud integration, and because Ingress is "smart", you can get a lot of
57+
features out of the box (like SSL, Auth, Routing, etc.). See the ingress section in `values.yaml`
58+
for configuration details.
59+
60+
You will first need to deploy an ingress controller of your preference. See
61+
https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#additional-controllers
62+
for more information.
63+
4864
## Components
4965

5066
The Community FOSS Dockerfiles used to generate the docker images for each st2 component are available at

templates/NOTES.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,24 @@ echo https://${ST2WEB_IP}/
2121
echo https://127.0.0.1:8443
2222
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }} 8443:443
2323

24-
{{- end }}
25-
{{- if contains "NodePort" .Values.st2web.service.type }}
24+
{{- else if contains "NodePort" .Values.st2web.service.type }}
2625

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

3130
{{- end }}
3231

32+
{{- if .Values.ingress.enabled -}}
33+
Ingress is enabled. You may access following endpoints:
34+
{{- range .Values.ingress.hosts }}
35+
{{- $host := .host -}}
36+
{{- range .paths }}
37+
http{{- if $.Values.ingress.tls }}s{{- end -}}://{{ $host }}{{ .path }}
38+
{{- end }}
39+
{{- end }}
40+
{{- end }}
41+
3342
2. Login with the following credentials:
3443
username: {{ .Values.secrets.st2.username }}
3544
password: {{ .Values.secrets.st2.password }}

templates/ingress.yaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
1-
# TODO: Research & add Ingress controller for exposing st2web service to public net (#6)
1+
{{- if .Values.ingress.enabled }}
2+
---
3+
apiVersion: extensions/v1beta1
4+
kind: Ingress
5+
metadata:
6+
name: {{ .Release.Name }}-ingress{{ template "enterpriseSuffix" . }}
7+
labels:
8+
app: ingress
9+
tier: frontend
10+
vendor: stackstorm
11+
support: {{ template "supportMethod" . }}
12+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
13+
release: "{{ .Release.Name }}"
14+
heritage: "{{ .Release.Service }}"
15+
annotations:
16+
{{- if .Values.ingress.tls }}
17+
ingress.kubernetes.io/secure-backends: "true"
18+
{{- end }}
19+
{{- range $key, $value := .Values.ingress.annotations }}
20+
{{ $key }}: {{ $value | quote }}
21+
{{- end }}
22+
spec:
23+
rules:
24+
{{- range .Values.ingress.hosts }}
25+
- host: {{ .host }}
26+
http:
27+
paths:
28+
{{- range .paths }}
29+
- path: {{ default "/*" .path }}
30+
backend:
31+
serviceName: {{ .serviceName }}
32+
servicePort: {{ .servicePort }}
33+
{{- end }}
34+
{{- else }}
35+
{{- if required "Missing context '.Values.st2web.service.hostname'!" .Values.st2web.service.hostname }}
36+
- host: {{ .Values.st2web.service.hostname }}
37+
{{- end }}
38+
http:
39+
paths:
40+
- path: "/*"
41+
backend:
42+
serviceName: {{ .Release.Name }}-st2web{{ template "enterpriseSuffix" . }}
43+
servicePort: "443"
44+
{{- end }}
45+
{{- if .Values.ingress.tls }}
46+
tls:
47+
{{ toYaml .Values.ingress.tls | indent 4 }}
48+
{{- end -}}
49+
{{- end }}

values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,32 @@ st2:
120120
# uid: api_key:56928c2d9637ce44338e9564d4b939df8b258410db23b5a80f8ad69d58e648b574f35f9293c3a76bde263738be9aa8379a81553cd55513ad672540b7b0ec0cac
121121
# user: st2admin
122122

123+
##
124+
## StackStorm HA Ingress
125+
##
126+
ingress:
127+
# As recommended, ingress is disabled by default.
128+
enabled: false
129+
# Annotations are used to configure the ingress controller
130+
annotations: {}
131+
# kubernetes.io/ingress.class: nginx
132+
# kubernetes.io/tls-acme: "true"
133+
# Map hosts to paths
134+
hosts: []
135+
# - host: hostname.domain.tld
136+
# # NOTE: Both path and service details are optional. A working default will be used to
137+
# # automatically configure st2web for ingress.
138+
# # Map paths to services
139+
# paths:
140+
# - path: /
141+
# serviceName: service
142+
# servicePort: port
143+
# Secure the Ingress by specifying a secret that contains a TLS private key and certificate
144+
tls: []
145+
# - secretName: chart-example-tls
146+
# hosts:
147+
# - chart-example.test
148+
123149
##
124150
## StackStorm HA Cluster Secrets. All fields are required!
125151
## NB! It's highly recommended to change ALL defaults!

0 commit comments

Comments
 (0)