Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Add the option to automatically install TICK scripts from a specified directory#8

Open
devth wants to merge 2 commits intoinfluxdata:masterfrom
devth:master
Open

Add the option to automatically install TICK scripts from a specified directory#8
devth wants to merge 2 commits intoinfluxdata:masterfrom
devth:master

Conversation

@devth
Copy link

@devth devth commented May 31, 2017

As requested in influxdata/kapacitor#1313

## tick_dir directory, if enabled.
##
install_tick_scripts:
kapacitorURL: http://kapacitor:9092
Copy link
Contributor

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?

Copy link
Author

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 }}
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e48a051

@jackzampolin
Copy link
Contributor

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 \

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.

Copy link
Author

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 😁.

@devth
Copy link
Author

devth commented Jun 1, 2017

@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 TICK_DIR leaves it up to the user to get the TICK scripts into the running container however they want.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants