You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `Helm <https://docs.helm.sh/using_helm/#install-helm>`__, the K8s package manager and `Tiller <https://docs.helm.sh/using_helm/#initialize-helm-and-install-tiller>`_
28
+
* `Helm <https://helm.sh/docs/intro/install>`__ 3, the K8s package manager (Helm 2 is not supported)
27
29
* Enough computing resources for production use, respecting :doc:`/install/system_requirements`
28
30
29
31
Usage
30
32
-----
31
33
This document assumes some basic knowledge of Kubernetes and Helm.
32
-
Please refer to `K8s <https://kubernetes.io/docs/home/>`__ and `Helm <https://docs.helm.sh/>`__
34
+
Please refer to `K8s <https://kubernetes.io/docs/home/>`__ and `Helm <https://helm.sh/docs/>`__
33
35
documentation if you find any difficulties using these tools.
34
36
35
37
However, here are some minimal instructions to get started.
@@ -52,16 +54,17 @@ or ``st2`` CLI client:
52
54
.. figure :: /_static/images/helm-chart-notes.png
53
55
:align: center
54
56
57
+
.. todo:: Update this screenshot. It is out of date.
55
58
56
59
The installation uses some unsafe defaults which we recommend you change for production use via Helm ``values.yaml``.
57
60
58
61
Helm Values
59
62
___________
60
63
Helm package ``stackstorm-ha`` comes with default settings (see `values.yaml <https://github.com/StackStorm/stackstorm-ha/blob/master/values.yaml>`_).
61
-
Fine-tune them to achieve desired configuration for the StackStorm HA K8s cluster.
64
+
Fine-tune them to achieve desired configuration for your StackStorm HA K8s cluster.
62
65
63
66
.. note::
64
-
Keep custom values you want to override in a separated yaml file so they won't get lost.
67
+
Keep custom values you want to override in a separate YAML file so they won't get lost.
65
68
Example: ``helm install -f custom_values.yaml`` or ``helm upgrade -f custom_values.yaml``
66
69
67
70
You can configure:
@@ -71,13 +74,22 @@ You can configure:
71
74
- st2.conf settings
72
75
- RBAC roles, assignments and mappings (enterprise only for StackStorm v3.2 and before, open source
73
76
for StackStorm v3.4 and later)
74
-
- custom st2 packs and its configs
77
+
- custom st2 packs (in persistent volumes or via custom docker images) and their configs
75
78
- SSH private key
76
-
- K8s resources and settings to control pod/deployment placement
77
-
- Mongo, RabbitMQ clusters
79
+
- K8s resources, annotations, and settings to control pod/deployment placement
80
+
- Image tag and repository settings to select the ST2 version or use customized/private component images
81
+
- DNS and Ingress configuration
82
+
- Miscellaneous other ST2 cluster customizations
83
+
- Mongo, RabbitMQ, and Redis clusters
84
+
85
+
If not defined, these values are auto-generated on install and preserved across upgrades:
86
+
87
+
- SSH private key
88
+
- st2 auth secrets (ie: the password for the st2admin user)
78
89
79
90
.. warning::
80
-
It's highly recommended to set your own secrets as the file contains unsafe defaults like SSH keys, StackStorm access credentials and MongoDB/RabbitMQ passwords!
91
+
It's highly recommended to set your own secrets to replace the unsafe defaults for for the MongoDB and RabbitMQ subhcarts!
92
+
If you disable the subcharts, make sure to secure the services and add the relevant secrets to st2.conf.
81
93
82
94
Upgrading
83
95
_________
@@ -121,16 +133,34 @@ Grab all logs only for stackstorm backend services, excluding st2web and DB/MQ/r
121
133
122
134
Custom st2 packs
123
135
----------------
124
-
To follow the stateless model, shipping custom st2 packs is now part of the deployment process.
125
-
It means that ``st2 pack install`` won't work in a distributed environment and you have to bundle all the
126
-
required packs into a Docker image that you can codify, version, package and distribute in a repeatable way.
127
-
The responsibility of this Docker image is to hold pack content and their virtualenvs.
128
-
So the custom st2 pack docker image you have to build is essentially a couple of read-only directories that
129
-
are shared with the corresponding st2 services in the cluster.
130
-
131
-
For your convenience, we created a new ``st2-pack-install <pack1> <pack2> <pack3>`` utility
136
+
There are two ways to install st2 packs in the k8s cluster.
137
+
138
+
1. The ``st2packs`` method is the default. This method will work for practically all clusters, but ``st2 pack install`` does not work. The packs are injected via ``st2packs`` images instead.
139
+
140
+
2. The other method defines shared/writable ``volumes``. This method allows ``st2 pack install`` to work, but requires a persistent storage backend to be available in the cluster. This chart will not configure a storage backend for you.
141
+
142
+
.. note::
143
+
In general, we recommend using only one of these methods. See the NOTE under Method 2 below about how both methods can be used together with care.
144
+
145
+
Method 1: st2packs images (the default)
146
+
_______________________________________
147
+
148
+
This method strives to follow the stateless model, so shipping custom st2 packs is part of the deployment process.
149
+
Without persistent storage (ie without state), packs and their virtualenvs need to be installed in each pod.
150
+
``st2 pack install`` does not work in this distributed model because it assumes that nodes have a shared filesystem
151
+
(Method 2, below, uses a shared filesystem), so that only one node needs to download the pack files or setup the
152
+
virtualenv and all other nodes will see those files right away.
153
+
154
+
In order to achieve this stateless model, you have to bundle all the required packs (and their virtualenvs)
155
+
into one or more Docker images that you can codify, version, package and distribute in a repeatable way.
156
+
The responsibility of these Docker images is to hold pack content and their virtualenvs.
157
+
Effectively, the st2packs Docker image(s) you have to build are a couple of read-only directories that
158
+
are shared with the corresponding st2 services in the cluster. When a new st2actionrunner
159
+
pod starts up, those directories get copied into the pod.
160
+
161
+
For your convenience, we created an ``st2-pack-install <pack1> <pack2> <pack3>`` utility
132
162
and included it in a container `stackstorm/st2packs <https://hub.docker.com/r/stackstorm/st2packs/>`_
133
-
that will help to install custom packs during the Docker build process without relying on live DB and MQ connection.
163
+
that will help to install custom packs during the Docker build process without relying on live MongoDB and RabbitMQ connections.
134
164
135
165
For more detailed instructions see `StackStorm/st2packs-dockerfiles <https://github.com/StackStorm/st2packs-dockerfiles/>`_
136
166
on how to build your custom `st2packs` image.
@@ -139,9 +169,28 @@ Please refer to `StackStorm/stackstorm-ha#install-custom-st2-packs-in-the-cluste
139
169
Helm chart repository with more information about how to reference custom st2pack Docker image in Helm values, providing packs configs,
140
170
using private Docker registry and more.
141
171
172
+
Method 2: Shared Volumes
173
+
________________________
174
+
175
+
Pack content can also be shared via ReadWriteMany volumes such as NFS (Network File System) as :doc:`/reference/ha` recommends.
176
+
Using shared volumes sacrifices the stateless infrastructure model, but enables normal pack management features
177
+
such as ``st2 pack install``.
178
+
179
+
Relying on shared volumes requires cluster-specific storage setup and configuration. As that storage setup varies
180
+
widely, manging that storage is out-of-scope for this helm chart. For example, before you can install this chart to use NFS,
181
+
you would have to create the NFS exports, and you might need ``PersistentVolume`` and ``PersistentVolumeClaim`` k8s objects.
182
+
Then, you add some volume definitions to your ``values.yaml``, and install or upgrade StackStorm with Helm.
183
+
Not every cluster uses NFS or PV/PVCs to manage the storage, so the chart treats your volume definitions as opaque data,
184
+
merely including your volume definitions in the appropriate place in various ``Deployment`` and ``Job`` k8s objects.
185
+
142
186
.. note::
143
-
There is an alternative approach, - sharing pack content via read-write-many NFS (Network File System) as :doc:`/reference/ha` recommends.
144
-
As beta is in progress and both methods have their pros and cons, we'd like to hear your feedback and which way would work better for you.
187
+
With care, ``st2packs`` images can be used with ``volumes``. Just make sure to keep the ``st2packs`` images up-to-date
188
+
with any changes made via ``st2 pack install``. If a pack is installed via an ``st2packs`` image and then it gets updated
189
+
with ``st2 pack install``, a subsequent ``helm upgrade`` will revert back to the version in the ``st2packs`` image.
190
+
191
+
Please refer to `StackStorm/stackstorm-ha#install-custom-st2-packs-in-the-cluster <https://github.com/stackstorm/stackstorm-ha#install-custom-st2-packs-in-the-cluster>`_
192
+
Helm chart repository with more information about how to pass custom volume definitions for ``packs``, ``virtualenvs``
193
+
and pack ``configs`` in Helm values.
145
194
146
195
Ingress
147
196
-------
@@ -185,7 +234,7 @@ st2web
185
234
______
186
235
st2web is a StackStorm Web UI admin dashboard. By default, st2web K8s config includes a Pod Deployment and a Service.
187
236
``2`` replicas (configurable) of st2web serve the web app and proxy requests to st2auth, st2api, st2stream.
188
-
By default, st2web uses HTTP instead of HTTPS. We recommend you rely on ``LoadBalancer`` or ``Ingress`` to add HTTPS layer on top of it.
237
+
By default, st2web uses HTTP instead of HTTPS. We recommend you rely on ``LoadBalancer`` (a ``Service`` type) or ``Ingress`` to add HTTPS layer on top of it.
189
238
190
239
.. note::
191
240
By default, st2web is a NodePort Service and is not exposed to the public net.
@@ -209,7 +258,7 @@ if you are planning a high-volume environment.
209
258
210
259
st2stream
211
260
_________
212
-
StackStorm st2stream - exposes a server-sent event stream, used by the clients like WebUI and ChatOps to receive updates from the st2stream server.
261
+
The StackStorm ``st2stream`` service exposes a server-sent event stream, used by the clients like WebUI and ChatOps to receive updates from the st2stream server.
213
262
Similar to st2auth and st2api, st2stream K8s configuration includes Pod Deployment with ``2`` replicas for HA (can be increased in ``values.yaml``)
214
263
and ClusterIP Service listening on port ``9102``.
215
264
@@ -263,8 +312,8 @@ st2actionrunner
263
312
_______________
264
313
Stackstorm workers that actually execute actions.
265
314
``5`` replicas for K8s Deployment are configured by default to increase StackStorm ability to execute actions without excessive queuing.
266
-
Relies on ``redis`` for coordination. This is likely the first thing to lift if you have a lot of actions
267
-
to execute per time period in your StackStorm cluster.
315
+
Relies on ``redis`` for coordination. The ``st2actionrunner`` replicas count is likely the first thing to increase if you have
316
+
a lot of actions to execute per time period in your StackStorm cluster.
268
317
269
318
st2scheduler
270
319
____________
@@ -294,6 +343,14 @@ By default ``3`` nodes (1 primary and 2 secondaries) of MongoDB are deployed via
294
343
For more advanced MongoDB configuration, refer to official `mongodb-replicaset <https://github.com/helm/charts/tree/master/stable/mongodb-replicaset>`_
295
344
Helm chart settings, which might be fine-tuned via ``values.yaml``.
296
345
346
+
The deployment of MongoDB to the k8s cluster can be disabled by setting the mongodb-ha.enabled key in values.yaml to false.
347
+
348
+
.. note::
349
+
Stackstorm relies heavily on connections to a MongoDB instance. If the in-cluster deployment of MongoDB is disabled,
350
+
a connection to an external instance of MongoDB must be configured. The st2.config key in values.yaml provides a way
351
+
to configure stackstorm.
352
+
See `Configure MongoDB <https://docs.stackstorm.com/install/config/config.html#configure-mongodb>`_ for configuration details.
353
+
297
354
`RabbitMQ HA Cluster <https://docs.stackstorm.com/latest/reference/ha.html#rabbitmq>`_
RabbitMQ is a message bus StackStorm relies on for inter-process communication and load distribution.
@@ -302,6 +359,14 @@ By default ``3`` nodes of RabbitMQ are deployed via K8s StatefulSet.
302
359
For more advanced RabbitMQ configuration, please refer to official `rabbitmq-ha <https://github.com/helm/charts/tree/master/stable/rabbitmq-ha>`_
303
360
Helm chart repository, - all settings could be overridden via ``values.yaml``.
304
361
362
+
The deployment of RabbitMQ to the k8s cluster can be disabled by setting the rabbitmq-ha.enabled key in values.yaml to false.
363
+
364
+
.. note::
365
+
Stackstorm relies heavily on connections to a RabbitMQ instance. If the in-cluster deployment of RabbitMQ is disabled,
366
+
a connection to an external instance of RabbitMQ must be configured. The st2.config key in values.yaml provides a way
367
+
to configure stackstorm.
368
+
See `Configure RabbitMQ <https://docs.stackstorm.com/install/config/config.html#configure-rabbitmq>`_ for configuration details.
369
+
305
370
redis
306
371
_____
307
372
StackStorm employs redis as a distributed coordination backend, required for st2 cluster components to work properly in an HA scenario.
@@ -311,8 +376,9 @@ As any other Helm dependency, it's possible to further configure it for specific
311
376
Feedback Needed!
312
377
----------------
313
378
As this deployment method new and beta is in progress, we ask you to try it and provide your feedback via
379
+
314
380
bug reports, ideas, feature or pull requests in `StackStorm/stackstorm-ha <https://github.com/StackStorm/stackstorm-ha>`_,
315
-
and ecourage discussions in `Slack <https://stackstorm.com/community-signup>`_ ``#docker`` channel or write us an email.
381
+
and encourage discussions in `Slack <https://stackstorm.com/community-signup>`_ ``#k8s`` channel.
0 commit comments