stackstorm-k8s icon indicating copy to clipboard operation
stackstorm-k8s copied to clipboard

Overrides for Rules/Sensors

Open cwilson21 opened this issue 3 years ago • 6 comments

I have 2 stackstorm instances running out of the same repo with packs etc. I have rules that I do not want to be enabled however on the dev instance but need to be enabled on the prod instance. Looking at some recent PRs from the st2 repo I see that there is functionality in base stackstorm to make overrides however you rely on the directory /opt/stackstorm/config/overrides/ existing and in the k8s version we are not able to find this directory and are not sure how to specify in our charts to disable rules using this method.

If this is already useable just an explanation of how it can be used now if not can this be added so it is able to be used?

cwilson21 avatar May 12 '22 20:05 cwilson21

You can do that now via extra_volumes so you'll mount override files under the /opt/stackstorm/config/overrides/. Example: https://github.com/StackStorm/stackstorm-k8s/blob/master/values.yaml#L646-L678

But ideally, for a native UX, someone needs to implement the feature so it's easily configurable via Helm values.yaml, similar to RBAC: https://github.com/StackStorm/stackstorm-k8s/blob/master/values.yaml#L200-L236

arm4b avatar May 12 '22 21:05 arm4b

Interesting, just looking this might be one that I can add. I am going to fork this and play with it to see if I can get it working and if I do I will make a Pull Request.

cwilson21 avatar May 12 '22 22:05 cwilson21

If you work on this, please use /opt/stackstorm/overrides (without /config - that was in one of the WIP PRs, but it was changed to drop it before merging).

cognifloyd avatar May 13 '22 03:05 cognifloyd

So I think I have gotten this added. I am doing some testing locally to make sure functionality is in place and if it is I will make a pull request.

cwilson21 avatar May 13 '22 17:05 cwilson21

So this was fairly easy to configure and setup, I figured out my mistake and I am testing again :) Ignore the last update.

~~however I am having one issue. I have added this to st2client and configs do not get overridden on build (st2ctl reload enforces the overrids) , but is expected because all of that is loaded in with the register job. However when trying to put this through the register job I am not having success getting things to load. Looking at st2-register-content I am not sure if this actually processes overrides, maybe @cognifloyd can give more insight on this.~~

cwilson21 avatar May 13 '22 20:05 cwilson21

PR created https://github.com/StackStorm/stackstorm-k8s/pull/307

cwilson21 avatar May 13 '22 22:05 cwilson21

#307 was merged to resolve this.

cognifloyd avatar Dec 20 '22 05:12 cognifloyd