I deployed a sonarqube server on kubernetes with an ingress for access in https and integrated sonarqube with my local gitlab.
When my pipeline is executed I get [ERROR] SonarQube server [https://sonarqube.mydomain.com] can not be reached
but when I change to IP without https and target port 9000 it works fine
I set the Server base URL to the right value but I don’t know why using FQDN doesn’t work, did anyone managed to solve the issue ?
here some details about my installation
I installed sonarqube with helm
helm upgrade --install -n sonarqube sonarqube sonarqube/sonarqube -f values.yaml
configured ingress
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations:
ingressClassName: nginx
meta.helm.sh/release-name: sonarqube
meta.helm.sh/release-namespace: sonarqube
nginx.ingress.kubernetes.io/proxy-body-size: 64m labels:
app: sonarqube
app.kubernetes.io/managed-by: Helm
chart: sonarqube-10.1.0_628
heritage: Helm
release: sonarqube name: sonarqube-sonarqube namespace: sonarqube spec: ingressClassName: nginx rules:
- host: sonarqube.mydomain.com
http:
paths:
- backend:
service:
name: sonarqube-sonarqube
port:
number: 9000
path: /
pathType: ImplementationSpecific tls:
- hosts:
- sonarqube.mydomain.com
secretName: sonar-tls
kubectl -n sonarqube get all
NAME READY STATUS RESTARTS AGE
pod/sonarqube-postgresql-0 1/1 Running 0 23h
pod/sonarqube-sonarqube-0 1/1 Running 0 23h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/sonarqube-postgresql ClusterIP 10.104.77.155 <none> 5432/TCP 23h
service/sonarqube-postgresql-headless ClusterIP None <none> 5432/TCP 23h
service/sonarqube-sonarqube LoadBalancer 10.97.71.8 10.10.10.33 9000:31092/TCP 23h
NAME READY AGE
statefulset.apps/sonarqube-postgresql 1/1 23h
statefulset.apps/sonarqube-sonarqube 1/1 23h
2
Answers
The problem is with the domain name I tried with the address IP and it works I exposed my sonarqube service as a LoadBalancer service on port 9000 and it works fine.
Using FQDN with ingress with an SSL certificate or without SSL certificate http protocole doesn't work and I have the error message mentioned before.
I tried the same thing with a docker image on another server and exactly the same problem IP works but FQDN with nginx reverse proxy doesn't work and I get error "server cannot be reached" it's not really a matter of IP authorization here
Reason for this might be the IP that’s added to the security group which does not have the required port for connection. For specific GitHub actions IP check by updating the workflow to temporary all open ports.
Error can also be from some proxy set up between nodes, where the scanner is the SonarQube. Check the proxies configuration and certificates, sonarqube site might be using a self-signed certificate.