-
Notifications
You must be signed in to change notification settings - Fork 72
Add the option to automatically install TICK scripts from a specified directory #8
base: master
Are you sure you want to change the base?
Conversation
kapacitor/values.yaml
Outdated
## tick_dir directory, if enabled. | ||
## | ||
install_tick_scripts: | ||
kapacitorURL: http://kapacitor:9092 |
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.
Isnt this just {{ template "fullname" . }}.{{ .Release.Namespace }}:9092
?
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.
Yep, fixed in e48a051
data: | ||
init.sh: |- | ||
#!/usr/bin/env bash | ||
export KAPACITOR_URL={{ .Values.install_tick_scripts.kapacitorURL }} |
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.
Maybe export KAPACITOR_URL={{ template "fullname" . }}.{{ .Release.Namespace }}:9092
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.
Fixed in e48a051
So you are planning to store your alerts in configmaps? I'm not sure how I feel about that. Could you potentially have a different method for storage? Github/lab? |
name="${name/.tick/}" | ||
kapacitor define $name \ | ||
-type batch \ | ||
-dbrp telegraf.autogen \ |
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.
Do we have a better solution to hardcoding the type and dbrp of the task? In the past I have parsed the type and dbrp values from comments at the top of the TICKscript. Part of the work in influxdata/kapacitor#1313 will be to standardize that behavior.
For example
// kapacitor:type=stream
// kapacitor:dbrp=telegraf.autogen
or
// kapacitor:type=batch
// kapacitor:dbrp=mydatabase.autogen
Something along those lines is what I was thinking, but that will probably not be the final result of influxdata/kapacitor#1313.
Technically it is possible to have multiple dbrps values but you can probably leave that out for now as it is uncommon.
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.
For my purposes I don't (yet) need it to vary, which is why I hardcoded it. I figured I could bake it into the dir structure if I needed to parameterize it someday, e.g. $TICK_DIR/telegraf/autogen/foo.tick
. If you want to bake it into the TICK script itself and parse it out in kapacitor, sounds good to me 😁.
@jackzampolin in my usage, the alerts are stored in git as Helm templates. ConfigMap is just an easy way to get them mounted into a container without having to modify a Docker image to bake them in. The current method of specifying |
As requested in influxdata/kapacitor#1313