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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Changelog
2
2
3
3
## In Development
4
+
* New feature: Shared packs volumes `st2.packs.volumes`. Allow using cluster-specific persistent volumes to store packs, virtualenvs, and (optionally) configs. This enables using `st2 pack install`. It even works with `st2packs` images in `st2.packs.images`. (#199) (by @cognifloyd)
4
5
* Updated redis constant sentinel ID which will allow other sentinel peers to update to the new given IP in case of pod failure or worker node reboots. (#191) (by @manisha-tanwar)
5
6
* Removed reference to st2-license pullSecrets, which was missed when removing enterprise flags (#192) (by @cognifloyd)
6
7
* Add optional imagePullSecrets to ServiceAccount using `serviceAccount.pullSecret` from values.yaml. If pods do not have imagePullSecrets (eg without `image.pullSecret` in values.yaml), k8s populates them from the ServiceAccount. (#196) (by @cognifloyd)
`5` replicas for K8s Deployment are configured by default to increase StackStorm ability to execute actions without excessive queuing.
@@ -181,15 +181,25 @@ StackStorm employs redis sentinel as a distributed coordination backend, require
181
181
As any other Helm dependency, it's possible to further configure it for specific scaling needs via `values.yaml`.
182
182
183
183
## Install custom st2 packs in the cluster
184
-
In distributed environment of the Kubernetes cluster `st2 pack install` won’t work.
184
+
There are two ways to install st2 packs in the k8s cluster.
185
+
186
+
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.
187
+
188
+
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.
189
+
190
+
NOTE: 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.
191
+
192
+
### Method 1: st2packs images (the default)
193
+
The `st2packs` method is the default. `st2 pack install` does not work because this chart (by default) uses read-only `emptyDir` volumes for `/opt/stackstorm/{packs,virtualenvs}`.
185
194
Instead, you need to bake the packs into a custom docker image, push it to a private or public docker registry and reference that image in Helm values.
186
-
Helm chart will take it from there, sharing `/opt/stackstorm/{packs,virtualenvs}` via a sidecar container in pods which require access to the packs.
195
+
Helm chart will take it from there, sharing `/opt/stackstorm/{packs,virtualenvs}` via a sidecar container in pods which require access to the packs
196
+
(the sidecar is the only place where the volumes are writable).
187
197
188
-
### Building st2packs image
198
+
####Building st2packs image
189
199
For your convenience, we created a new `st2-pack-install <pack1> <pack2> <pack3>` utility and included it in a container that will help to install custom packs during the Docker build process without relying on live DB and MQ connection.
190
200
Please see https://github.com/StackStorm/st2packs-dockerfiles/ for instructions on how to build your custom `st2packs` image.
191
201
192
-
### How to provide custom pack configs
202
+
####How to provide custom pack configs
193
203
Update the `st2.packs.configs` section of Helm values:
194
204
195
205
For example:
@@ -205,7 +215,9 @@ For example:
205
215
```
206
216
Don't forget running Helm upgrade to apply new changes.
207
217
208
-
### Pull st2packs from a private Docker registry
218
+
NOTE: On `helm upgrade` any configs in `st2.packs.configs` will overwrite the contents of `st2.packs.volumes.configs` (optional part of Method 2, described below).
219
+
220
+
#### Pull st2packs from a private Docker registry
209
221
If you need to pull your custom packs Docker image from a private repository, create a Kubernetes Docker registry secret and pass it to Helm values.
210
222
See [K8s documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) for more info.
Once secret created, reference its name in helm value: `st2.packs.images[].pullSecret`.
216
228
229
+
### Method 2: Shared Volumes
230
+
This method requires cluster-specific storage setup and configuration. As the storage volumes are both writable and shared, `st2 pack install` should work like it does for standalone StackStorm installations. The volumes get mounted at `/opt/stackstorm/{packs,virtualenvs}` in the containers that need read or write access to those directories. With this method, `/opt/stackstorm/configs` can also be mounted as a writable volume (in which case the contents of `st2.packs.configs` takes precedence on `helm upgrade`).
231
+
232
+
NOTE: With care, `st2packs` images can be used with `volumes`. Just make sure to keep the `st2packs` images up-to-date with any changes made via `st2 pack install`.
233
+
If a pack is installed via an `st2packs` image and then it gets updated with `st2 pack install`, a subsequent `helm upgrade` will revert back to the version in the `st2packs` image.
234
+
235
+
#### Configure the storage volumes
236
+
Enable the `st2.packs.voluems` section of Helm values and add volume definitions for both `packs` and `virtualenvs`.
237
+
Each of the volume definitions should be customized for your cluster and storage solution.
238
+
239
+
For example, to use persistentVolumeClaims:
240
+
```
241
+
volumes:
242
+
enabled: true
243
+
packs:
244
+
persistentVolumeClaim:
245
+
claim-name: pvc-st2-packs
246
+
virtualenvs:
247
+
persistentVolumeClaim:
248
+
claim-name: pvc-st2-virtualenvs
249
+
```
250
+
251
+
Or, for example, to use NFS:
252
+
```
253
+
volumes:
254
+
enabled: true
255
+
packs:
256
+
nfs:
257
+
server: nfs.example.com
258
+
path: /var/nfsshare/packs
259
+
virtualenvs:
260
+
nfs:
261
+
server: nfs.example.com
262
+
path: /var/nfsshare/virtualenvs
263
+
```
264
+
265
+
Please consult the documentation for your cluster's storage solution to see how to add the storage backend to your cluster and how to define volumes that use your storage backend.
266
+
267
+
#### How to provide custom pack configs
268
+
You may either use the `st2.packs.configs` section of Helm values (like Method 1, see above),
269
+
or add another shared writable volume similar to `packs` and `virtualenvs`. This volume gets mounted
270
+
to `/opt/stackstorm/configs` instead of the `st2.packs.config` values.
271
+
272
+
NOTE: If you define a configs volume and specify `st2.packs.configs`, anything in `st2.packs.configs` takes precdence during `helm upgrade`, overwriting config files already in the volume.
273
+
274
+
For example, to use persistentVolumeClaims:
275
+
```
276
+
volumes:
277
+
enabled: true
278
+
... # define packs and virtualenvs volumes as shown above
279
+
configs:
280
+
persistentVolumeClaim:
281
+
claim-name: pvc-st2-pack-configs
282
+
```
283
+
284
+
Or, for example, to use NFS:
285
+
```
286
+
volumes:
287
+
enabled: true
288
+
... # define packs and virtualenvs volumes as shown above
289
+
configs:
290
+
nfs:
291
+
server: nfs.example.com
292
+
path: /var/nfsshare/configs
293
+
```
294
+
295
+
#### Caveat: Mounting and copying packs
296
+
If you use something like NFS where you can mount the shares outside of the StackStorm pods, there are a couple of things to keep in mind.
297
+
298
+
Though you could manually copy packs into the `packs` shared volume, be aware that StackStorm does not automatically register any changed content.
299
+
So, if you manually copy a pack into the `packs` shared volume, then you also need to trigger updating the virtualenv and registering the content,
300
+
possibly using APIs like:
301
+
[packs/install](https://api.stackstorm.com/api/v1/packs/#/packs_controller.install.post), and
0 commit comments