Support external Elasticsearch cluster

Hi folks,

We’re running SonarQube in Kubernetes and would like to use managed services of our Cloud provider as much as possible for stateful data, i. e. a managed PostgreSQL server and a managed Elasticsearch cluster.

Effectively, I’d like to only run stateless parts of SonarQube in Kubernetes and let the Cloud provider take care of “the hard stuff”, i. e. stateful databases.

While SonarQube supports using an external database server out-of-the-box, it doesn’t seem to support using an external Elasticsearch cluster (with proper authentication):
https://docs.sonarqube.org/9.0/setup/environment-variables/#header-6

There have been similar topics before which have been closed:

@Tobias_Trabelsi encouraged me to create this feature request nonetheless after opening a GitHub issue on the SonarQube Helm chart:

Hi @joschi,

Thanks for the suggestion.

Are you facing some specific problems with the way Elasticsearch is currently handled by SonarQube in Kubernetes?
Or does your request comes from a wish to rationalize the way you operate all your services?

Hi Christophe,

It’s the latter: We want our pods in the Kubernetes cluster to be stateless and keep all databases out of the Kubernetes cluster (i. e. use the hosted services offered by our cloud platform).

With Elasticsearch “living” inside the same container as SonarQube itself, it could potentially be corrupted if the container is being stopped (for whatever reason). Even if Elasticsearch is not the system of record in this case, it would be one thing less to worry about when using the SonarQube Helm chart and running SonarQube in Kubernetes.

1 Like

Thanks for sharing @joschi.