Use environment variable/configuration file for influx/kapacitor connection information
I have a created a Chronograf deployment in Kubernetes v1.5.3 with one replica. It was working fine until I incremented the replica count to more than 1. I have a Chronograf deployment with a frontend service of type LoadBalancer which forwards the traffic to port 8888 of the pods. Also, I have mounted a NFS at /var/lib/chronograf for all the replicas so they can use the same data files.
When I checked the logs of the container. Only the first pod has a working Chronograf server and the rest of the pods are logging this error in the console.
2017-03-14T07:33:37.005601387Z time="2017-03-14T07:33:37Z" level=fatal msg="Unable to open boltdb; is there a chronograf already running? timeout" component=boltstore
Kindly suggest me how to fix this issue.
Hi @kumudt, thanks for writing in! Chronograf currently is using boltdb as its backend database. Boltdb creates a lock for the database so multiple processes cannot open it. So, there isn't a fix right now.
We do plan to add other databases to chronograf, but, we have been waiting to see what databases would be interesting to the community. Because you are running k8s, would Etcd be a good database for you?
@goller Thanks for the quick reply.
I really don't know what Chronograf is storing inside the database apart from the Influx DB & Kapacitor end points. For these, I would suggest to add a config file or add provision to take these values from environment variables.
Also, I really want to know what Chronograf is storing inside that DB apart from the server configuration (I think all the data for the dashboards will be fetched from Influx DB queries right? Or is it caching any of the queries locally? )
Sorry, I have no choice of database that is good for k8s. I am just getting started with k8s. For me, any database which supports multiple connections from different Chronograf instances in a HA environment would be fine.
Hey @kumudt we are storing connection URLs to influx and kapacitor, dashboard layouts, and user created tickscripts. Likely, we'll be removing the user created tickscripts and rely on kapacitor completely. Dashboards include user-interface information like labels, locations and the query to run.
As for env vars and/or configuration files I think that's a really good idea. You've given me a good idea about how I would want to implement it now too :)
As for k8s, @jackzampolin has created helm scripts here https://www.influxdata.com/packaged-kubernetes-deployments-writing-helm-chart/ to help get the tickstack running. Check it out!
@goller Great. I am so excited and will be awaiting this feature.
Yep. That was a really cool article by @jackzampolin . It helped me a lot in deploying the TICK stack on k8s. Currently, the only issue for me is with the autoscaling of chronograf instances. Once, config files / env vars support was added, that wouldn't be a problem.
Closing as duplicate of #318
@kumudt Might want to have a look at our helm charts.
yes @jackzampolin I actually used your helm charts (https://github.com/jackzampolin/tick-charts) as a reference for our TICK stack deployment.