I’ve deployed Telegraf, Influx, Kapacitor and Chronograf on Kubernetes using Helm.
I’ve written some Tick scripts using the Chronograf UI to generate alerts on my data.
I’m puzzled how to automate deployment of those Tick scripts.
If I were working with Kubernetes manifests, I could probably add in a config map containing my Tick scripts, however, I’m using ArgoCD to deploy the Helm charts and am constrained by what is supported in github influxdata/helm-charts/tree/master/charts/kapacitor
This seems to be what I’m looking for, but never got merged:
This also seems to do what I want, but isn’t supported via Helm (unless I can use the sidecar option to load the directory structure and pass in the [load] config as environmental variables? Its not clear what the sidecar option is for)
A similar community post gives me the idea that maybe I can log into the Kapacitor pod post deployment and load the scripts that way (user wrote a shell script, unfortunately I’ve hit my link limit)
Would really appreciate some community suggestions how to do this!
I can see my tick script in /var/lib/kapacitor/sideload inside the kapacitor pod deployed via helm. However, I still need to run kapacitor commands to add it, i.e “kapacitor define test -tick test.tick” etc.
If I could modify /etc/kapacitor/kapacitor.conf [load] section to point at /var/lib/kapacitor/sideload (or change the sideload folder to /etc/kapacitor/load if [load] is enabled by default) then maybe I could get this working, but I think I’m overusing the sideload node to get my tick scripts auto deployed?
Very confused how I can redeploy kapacitor using helm with all my tick scripts executing out of the box…
Did you manage to get multiple scripts to load from /sideload/tasks?
I have a ConfigMap which is writing multiple .tick files to the directory via the sidecar but Kapacitor only seems to load the first file it finds, then moves on to processing the handlers folder (which doesn’t exist).
It was unreliable. The problem I had was that the tasks didn’t load at all and I put this down to a timing issue; the tasks were being posted before kapacitor was ready.
We have since moved to Influx cloud and while I don’t remember the exact details, I can outline the solution.
It looks like I added the tasks as configmap.
I then had my own kubernetes job to post the tasks.
The crux of the job is an init container to wait for kapacitor to be ready:
Strange, I ended up with the same config as you posted on Aug 10, but it consistently only loads one file. I’ve looked through the Kapacitor code and nothing obvious jumped out at me. My thoughts were that it was maybe a timing issue as well.