-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to specify rules directory #816
Conversation
It would be helpful to also edit the README.md chart documentation to explain what scenarios would require this new |
@@ -56,6 +56,7 @@ The command removes all the Kubernetes components associated with the chart and | |||
| `command` | command override for container | `NULL` | | |||
| `args` | args override for container | `NULL` | | |||
| `replicaCount` | number of replicas to run | 1 | | |||
| `rulesFolder` | Locaton of rules directory. Usefull when you have one docker image and different set on rules per environemnt. For example development can reside in `/opt/elastalert/develop` and production in `/opt/elastalert/production`. | /opt/elastalert/rules | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help me understand this a bit better, in case others ask about it in the future? Typically when I am deploying a different set of rules to alternate environments my override yaml file defines the rules specific to each environment. The jertel/elastalert2
Docker image remains the same across all environments. How does changing this directory name make a difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
As far as I know there are few ways to have this implemented right now.
We can (for example) define our own secret and mount it in the Pod.
But what we wanted to have is to have as little copy-pasting and being able to new rules locally with docker-compose.
So, we have prepared set of yml files, which contain rules definitions. They are different per environment.
During local development, devs just add files to appropriate directory and run docker-compose.
Our docker image just takes all those rules (both lab and prod) and mounts them in container (both set of rules are present in the container). And now I would like to be able, to tell ElastAlert that I want to use rules from lets say lab
subdirectory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that detailed explanation, and thanks for the contribution!
Description
Added ability to specify rules directory with defaulting to the old value.
This functionality makes it easier to customize template and skip creating of secret with custom Elastalert configuration.
Checklist
make test-docker
with my changes.Questions or Comments
I have not added additional unit tests, due to the fact that there are no helm chart tests implemented in elastalert.
I did not add the documentation at elastaler2.read because there are no functional changes in this PR.