SonarQube version: 220.127.116.11448
SonarScanner version: 18.104.22.1681
I set up my SonarQube in a local kubernetes cluster using Docker Desktop for Windows. I followed the tutorial here and set up pod and service for sonarqube and postgres as well as persistent volume and the claim. The sonarqube service is exposed to 10.99.198.149 (and localhost as well…).
The source code is in the WSL folder.
When I ran the sonarsource/sonar-scanner-cli docker image with the following options:
docker run -e SONAR_HOST_URL='http://localhost:31680' -e SONAR_LOGIN='3542cea554928abd60a801209a7e1eb8adc15276' -v '/home/ubuntu/workspace/2021-04-23--coderise-k8s-sonarqube/src' sonarsource/sonar-scanner-cli
However, it returned to me
SonarQube server [http://localhost:31680] can not be reached. I also switched the URL to 10.99.198.149 but it still gives me the same thing.
What should I have done instead? I read that it’s possible that the docker image cannot access the local kubernetes cluster. How do I make it connect?