Skip to content

Commit e4b72dc

Browse files
committed
Document jobs.extra_hooks in README
1 parent c24a4c7 commit e4b72dc

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,36 @@ Grab all logs only for stackstorm backend services, excluding st2web and DB/MQ/r
325325
kubectl logs -l release=<release-name>,tier=backend
326326
```
327327

328+
## Running jobs before/after install, upgrade, or rollback
329+
WARNING: The feature described in this section is an Advanced feature that new users should not need.
330+
331+
It may be convenient to run one or more `Job`(s) in your `stackstorm-ha` cluster to manage your release's life cycle.
332+
As the [Helm docs]() explain:
333+
334+
> Helm provides a _hook_ mechanism to allow chart developers to intervene at certain points in a release's life cycle.
335+
336+
The `jobs.extra_hooks` feature in this chart simplifies creating `Jobs` that Helm will run in its hooks.
337+
These jobs will use the same settings as any other job defined by this chart (eg image, annotations, pod placement).
338+
The `st2.conf` files and packs volumes will be mounted in the Job and the `st2` cli will be configured.
339+
This feature is primarily useful when you need to run a StackStorm workflow (with `st2 run ...`) after install,
340+
before/after upgrades, or before/after rollbacks.
341+
342+
NOTE: The `jobs.extra_hooks` feature is very opinionated. If you need to to apply helm hooks to anything other than
343+
`Jobs`, or if these jobs do not meet your needs, then you will need to do so from a parent chart. For example, parent charts
344+
are much better suited to jobs that don't need access to the packs, configs, configmaps, and secrets that this chart provides.
345+
See "Extending this chart" below.
346+
347+
These extra hooks jobs can be used for st2 installation-specific jobs like:
348+
349+
- running a pre-upgrade st2 workflow that notifies on various channels that the upgrade is happening,
350+
- running post-upgrade smoke tests to ensure st2 can connect to vital services (vault, kubernetes, aws, etc),
351+
- running a pre-upgrade st2 workflow that pauses long-running workflows,
352+
- running a post-upgrade st2 workflow that resumes long-running workflows,
353+
- running one-time post-install configuration (such as generating dynamic secrets in the st2kv datastore),
354+
355+
To configure the `jobs.extra_hooks`, set `jobs.extra_hooks` in your values file.
356+
Please refer to stackstorm-ha's default values.yaml file for examples.
357+
328358
## Extending this chart
329359
If you have any suggestions or ideas about how to extend this chart functionality,
330360
we welcome you to collaborate in [Issues](https://github.com/stackstorm/stackstorm-ha/issues)

0 commit comments

Comments
 (0)