Skip to content

Commit c792a45

Browse files
authored
Merge branch 'master' into st2web-annotations
2 parents 02cf554 + 0ca3c2a commit c792a45

8 files changed

+177
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
charts
22
*.lock
3+
.DS_Store

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## In Development
44

5+
## v0.11.0
6+
* Add st2chatops support (@mosn, @rapittdev) (#55)
7+
58
## v0.10.0
69
* Bump versions of all dependencies (#50)
710
* Allow st2sensorcontainer to be partitioned (#51)

Chart.yaml

+2-1
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.0dev
44
name: stackstorm-ha
5-
version: 0.10.0
5+
version: 0.11.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
@@ -12,6 +12,7 @@ keywords:
1212
- st2
1313
- stackstorm
1414
- devops
15+
- chatops
1516
- event-driven
1617
- auto-remediation
1718
- IFTTT

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ All the workflow engine processes will share the load and pick up more work if o
103103
> [Orquesta st2workflowengine](https://docs.stackstorm.com/orchestra/index.html) as a new native workflow engine.
104104
105105
### [st2scheduler](https://docs.stackstorm.com/reference/ha.html#st2scheduler)
106-
TODO: Description TBD
106+
`st2scheduler` is responsible for handling ingress action execution requests.
107+
`2` replicas for K8s Deployment are configured by default to increase StackStorm scheduling throughput.
107108

108109
### [st2notifier](https://docs.stackstorm.com/reference/ha.html#st2notifier)
109110
Multiple st2notifier processes can run in active-active mode, using connections to RabbitMQ and MongoDB and generating triggers based on
@@ -145,6 +146,11 @@ Having `1` st2garbagecollector replica for K8s Deployment is enough, considering
145146
By default this process does nothing and needs to be configured in st2.conf settings (via `values.yaml`).
146147
Purging stale data can significantly improve cluster abilities to perform faster and so it's recommended to configure st2garbagecollector in production.
147148

149+
### [st2chatops](https://docs.stackstorm.com/chatops/index.html)
150+
StackStorm ChatOps service, based on hubot engine, custom stackstorm integration module and preinstalled list of chat adapters.
151+
Due to Hubot limitation, st2chatops doesn't provide mechanisms to guarantee high availability and so only single `1` node of st2chatops is deployed.
152+
This service is disabled by default. Please refer to Helm `values.yaml` about how to enable and configure st2chatops with ENV vars for your preferred chat service.
153+
148154
### [MongoDB HA ReplicaSet](https://github.com/helm/charts/tree/master/stable/mongodb-replicaset)
149155
StackStorm works with MongoDB as a database engine. External Helm Chart is used to configure MongoDB HA [ReplicaSet](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/).
150156
By default `3` nodes (1 primary and 2 secondaries) of MongoDB are deployed via K8s StatefulSet.

templates/deployments.yaml

+84
Original file line numberDiff line numberDiff line change
@@ -1319,3 +1319,87 @@ spec:
13191319
- name: st2-virtualenvs-vol
13201320
emptyDir: {}
13211321
{{- end }}
1322+
1323+
{{ if .Values.st2chatops.enabled -}}
1324+
---
1325+
apiVersion: apps/v1
1326+
kind: Deployment
1327+
metadata:
1328+
name: {{ .Release.Name }}-st2chatops{{ template "enterpriseSuffix" . }}
1329+
labels:
1330+
app: st2chatops
1331+
tier: backend
1332+
vendor: stackstorm
1333+
support: {{ template "supportMethod" . }}
1334+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
1335+
release: {{ .Release.Name }}
1336+
heritage: {{ .Release.Service }}
1337+
spec:
1338+
selector:
1339+
matchLabels:
1340+
app: st2chatops
1341+
support: {{ template "supportMethod" . }}
1342+
release: {{ .Release.Name }}
1343+
# As hubot can't be HA scaled properly, we deploy only single replica of st2chatops
1344+
replicas: 1
1345+
template:
1346+
metadata:
1347+
labels:
1348+
app: st2chatops
1349+
tier: backend
1350+
vendor: stackstorm
1351+
support: {{ template "supportMethod" . }}
1352+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
1353+
release: {{ .Release.Name }}
1354+
heritage: {{ .Release.Service }}
1355+
annotations:
1356+
checksum/chatops: {{ include (print $.Template.BasePath "/secrets_st2chatops.yaml") . | sha256sum }}
1357+
spec:
1358+
containers:
1359+
- name: st2chatops{{ template "enterpriseSuffix" . }}
1360+
image: "{{ .Values.st2chatops.image.repository | default "stackstorm" }}/{{ .Values.st2chatops.image.name | default "st2chatops" }}:{{ tpl (.Values.st2chatops.image.tag | default .Chart.AppVersion) . }}"
1361+
imagePullPolicy: {{ .Values.st2chatops.image.pullPolicy | default .Values.image.pullPolicy }}
1362+
env:
1363+
- name: ST2_AUTH_USERNAME
1364+
valueFrom:
1365+
secretKeyRef:
1366+
name: {{ .Release.Name }}-st2-auth
1367+
key: username
1368+
- name: ST2_AUTH_PASSWORD
1369+
valueFrom:
1370+
secretKeyRef:
1371+
name: {{ .Release.Name }}-st2-auth
1372+
key: password
1373+
envFrom:
1374+
- configMapRef:
1375+
name: {{ .Release.Name }}-st2-urls
1376+
- secretRef:
1377+
name: {{ .Release.Name }}-st2chatops
1378+
ports:
1379+
- containerPort: 8081
1380+
# TODO: Add to st2chatops Docker image https://github.com/joelwallis/hubot-health for a little bit more reliable HTTP health endpoint check
1381+
readinessProbe:
1382+
tcpSocket:
1383+
port: 8081
1384+
initialDelaySeconds: 3
1385+
periodSeconds: 10
1386+
livenessProbe:
1387+
tcpSocket:
1388+
port: 8081
1389+
initialDelaySeconds: 10
1390+
periodSeconds: 30
1391+
resources:
1392+
{{ toYaml .Values.st2chatops.resources | indent 10 }}
1393+
{{- with .Values.st2chatops.nodeSelector }}
1394+
nodeSelector:
1395+
{{ toYaml . | indent 8 }}
1396+
{{- end }}
1397+
{{- with .Values.st2chatops.affinity }}
1398+
affinity:
1399+
{{ toYaml . | indent 8 }}
1400+
{{- end }}
1401+
{{- with .Values.st2chatops.tolerations }}
1402+
tolerations:
1403+
{{ toYaml . | indent 8 }}
1404+
{{- end }}
1405+
{{- end }}

templates/secrets_st2chatops.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ if .Values.st2chatops.enabled -}}
2+
---
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: {{ .Release.Name }}-st2chatops
7+
annotations:
8+
description: Custom StackStorm chatops config, passed to hubot as ENV vars
9+
labels:
10+
app: st2chatops
11+
tier: backend
12+
vendor: stackstorm
13+
support: {{ template "supportMethod" . }}
14+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
15+
release: {{ .Release.Name }}
16+
heritage: {{ .Release.Service }}
17+
type: Opaque
18+
data:
19+
{{- range $env, $value := .Values.st2chatops.env }}
20+
{{ $env }}: {{ $value | b64enc | quote }}
21+
{{- end }}
22+
{{- end }}

templates/services.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,30 @@ spec:
108108
ports:
109109
- protocol: TCP
110110
port: 443
111+
112+
{{ if .Values.st2chatops.enabled -}}
113+
---
114+
kind: Service
115+
apiVersion: v1
116+
metadata:
117+
name: {{ .Release.Name }}-st2chatops{{ template "enterpriseSuffix" . }}
118+
annotations:
119+
description: StackStorm st2chatops, - conversation-driven automation service exposed as hubot instance with predefined list of chat adapters
120+
labels:
121+
app: st2chatops
122+
tier: backend
123+
vendor: stackstorm
124+
support: {{ template "supportMethod" . }}
125+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
126+
release: {{ .Release.Name }}
127+
heritage: {{ .Release.Service }}
128+
spec:
129+
selector:
130+
app: st2chatops
131+
support: {{ template "supportMethod" . }}
132+
release: {{ .Release.Name }}
133+
type: ClusterIP
134+
ports:
135+
- protocol: TCP
136+
port: 8081
137+
{{- end }}

values.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,37 @@ st2garbagecollector:
356356
tolerations: []
357357
affinity: {}
358358

359+
##
360+
## StackStorm ChatOps (https://docs.stackstorm.com/chatops/index.html)
361+
## As hubot can't be HA scaled properly, we deploy only single replica of st2chatops
362+
##
363+
st2chatops:
364+
# Enable st2chatops (default: false)
365+
enabled: false
366+
# Custom hubot adapter ENV variables to pass through which will override st2chatops.env defaults.
367+
# See https://github.com/StackStorm/st2chatops/blob/master/st2chatops.env
368+
# for the full list of supported adapters and example ENV variables.
369+
env:
370+
HUBOT_ADAPTER: slack
371+
HUBOT_SLACK_TOKEN: xoxb-CHANGE-ME-PLEASE
372+
# Set custom generated st2chatops Docker image source
373+
# Otherwise default https://hub.docker.com/r/stackstorm/st2chatops is used
374+
image: {}
375+
#repository: stackstorm
376+
#name: st2chatops
377+
#tag: "{{ .Chart.AppVersion }}"
378+
#pullPolicy: Always
379+
# Tested requested resource consumption for st2chatops & hubot in normal mode
380+
# Please adjust based on your conscious choice
381+
resources:
382+
requests:
383+
memory: "50Mi"
384+
cpu: "5m"
385+
# Additional advanced settings to control pod/deployment placement
386+
nodeSelector: {}
387+
tolerations: []
388+
affinity: {}
389+
359390
##
360391
## MongoDB HA configuration (3rd party chart dependency)
361392
##

0 commit comments

Comments
 (0)