How to run kapacitor commands in a kubernetes environment?

225 views Asked by At

When starting kapacitor (influxdata) in a docker container, the kapacitor daemon is started and runs in the foreground.

To run kapacitor commands, one needs to exec into the docker container and run commands like kapacitor define backup_alert ....; kapacitor enable ...

Now I'm trying to start the kapacitor container in the kuberneter environment, which runs fine. The problem I'm facing is how to run the additional commands like kapacitor define.

I've tried to modify the entrypoint/command, but I run into the fact that once the kapacitor daemon (kapacitord) is started, it doesn't accepts any kapacitor commands because the daemon is running in the foreground.

How should I solve this?

1

There are 1 answers

0
Juris On

You can use kubectl port-forward to forward kapacitor port to your local machine and use kapacitor binary locally.

Terminal 1

kubectl port-forward <kapacitor-pod-id> 9092

Terminal 2

kapacitor list tasks