Error while installing SonarQube - 8.2 version installation in kubernetes

While installing SonarQube 8.2 (sonarqube:8.2-community) in Kubernetes cluster, I am getting the below error .

Caused by: java.nio.file.AccessDeniedException: /opt/sonarqube/data/es6
        at sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?]
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(Unknown Source) ~[?:?]
        at java.nio.file.Files.createDirectory(Unknown Source) ~[?:?]
        at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source) ~[?:?]
        at java.nio.file.Files.createDirectories(Unknown Source) ~[?:?]

Postgres is running perfectly fine and I was able to run the SonarQube version 7.1 . But while running a pod with version 7.9 and above I am facing this issue.

I tried to give full permission for the directory using dockerfile like below:

FROM sonarqube:8.2-community
USER sonarqube
RUN chmod 777 /opt/sonarqube/data -R

But this didnt help. When I tried with root user, it throws error like “ElasticSearch cannot run as root”

Can anyone let me know how to do a fresh installation of SonarQube 8.0+ in Kubernetes.

Hi @sharigitpersonal ,

while we are not officially supporting kubernetes deployment as of now, but there are already people running sonarqube within a kubernetes cluster. If you want to get going fast i suggest to use the community helm chart in order to deploy an 8.x installation to your cluster. you can find additional information here:

but it boils down to

helm repo add oteemocharts
helm repo update
helm install -f config.yaml oteemocharts/sonarqube 

hope that helps you a little bit

Thanks Trabelsi for your reply,

I was able to get the SonarQube up and running. But am getting an embedded database error which means it is not connecting with Postgres DB. Do you have any inputs on that? How to make a sonarqube interact with a running postgres POD.

Any thoughts would be appreciated.


Hi @sharigitpersonal ,

what is the error message that you get? the common types are connection refused or wrong username/password.
did you change anything within the postgresql section in the values of the helm cart?

I had same issue so I had to use other aproach , and this was by installing sonar in K8s but not using helm chart.
I followed this post which installs separately each component.