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.

Hi @Chris ,

We’re facing a specific problem at the moment.

We would like to run SonarQube on our GCP Autopilot (a managed Kubernetes cluster) cluster. Which does not allow privileged Pods.
However, these are required to change (most) Linux Kernel settings. Elasticsearch requires a change of the vm.max_map_count setting. Which basically blocks running Elasticsearch on a GCP Autopilot cluster. Which in turn blocks running SonarQube on there, since it has Elasticsearch built in.

Some context:

This Elasticsearch issue could be avoided if it would be possible to configure SonarQube to use an external Elasticsearch instance (that is running somewhere else).

2 Likes

Hello guys,

I am wondering if this functionality has not been implemented yet?

It is not possible nowadays to configure an external Elasticsearch cluster for the community/enterprise edition?

Hi Alejandro,

It’s no yet possible to configure an external Elasticsearch.
This is not in the short-term roadmap but we are tracking the requests on this topic and are actively monitoring this thread.