diff --git a/CHANGELOG.md b/CHANGELOG.md index 3acddfad..7fabe153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## In Development +* 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) * 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) * Removed reference to st2-license pullSecrets, which was missed when removing enterprise flags (#192) (by @cognifloyd) * 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) diff --git a/README.md b/README.md index 29251c51..63cbd550 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ st2: - name: circleci ref: circle_ci.CircleCIWebhookSensor ``` - + ### [st2actionrunner](https://docs.stackstorm.com/reference/ha.html#st2actionrunner) Stackstorm workers that actually execute actions. `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 As any other Helm dependency, it's possible to further configure it for specific scaling needs via `values.yaml`. ## Install custom st2 packs in the cluster -In distributed environment of the Kubernetes cluster `st2 pack install` won’t work. +There are two ways to install st2 packs in the k8s cluster. + +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. + +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. + +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. + +### Method 1: st2packs images (the default) +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}`. 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. -Helm chart will take it from there, sharing `/opt/stackstorm/{packs,virtualenvs}` via a sidecar container in pods which require access to the packs. +Helm chart will take it from there, sharing `/opt/stackstorm/{packs,virtualenvs}` via a sidecar container in pods which require access to the packs +(the sidecar is the only place where the volumes are writable). -### Building st2packs image +#### Building st2packs image For your convenience, we created a new `st2-pack-install ` 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. Please see https://github.com/StackStorm/st2packs-dockerfiles/ for instructions on how to build your custom `st2packs` image. -### How to provide custom pack configs +#### How to provide custom pack configs Update the `st2.packs.configs` section of Helm values: For example: @@ -205,7 +215,9 @@ For example: ``` Don't forget running Helm upgrade to apply new changes. -### Pull st2packs from a private Docker registry +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). + +#### Pull st2packs from a private Docker registry 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. See [K8s documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) for more info. ``` @@ -214,6 +226,88 @@ kubectl create secret docker-registry st2packs-auth --docker-server=