Must-share information (formatted with Markdown ):
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube version 7.1
how is SonarQube deployed: zip, Docker, Helm
Sonarqube deployed in the kubernetes
what are you trying to achieve
Need to coverage the code from the sonarqube which i have scanned from the Azure Devops pipeline
what have you tried so far to achieve this
Done as per the documents and steps shared in the community .
POM.xml file
jacoco maven plugin
org.jacoco
jacoco-maven-plugin
0.8.5
prepare-agent
prepare-agent
test-compile
report
report
test
sonar-maven-plugin
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.0.2</version>
</plugin>
the Deployment file which i have used to implement the sonar in kubernetes cluster
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sonarqube
name: sonarqube
namespace: sonar
spec:
replicas: 1
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
spec:
containers:
- name: sonarqube
image: sonarqube:7.1
resources:
requests:
cpu: 500m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
volumeMounts:
- mountPath: “/opt/sonarqube/data/”
name: sonar-data
- mountPath: “/opt/sonarqube/extensions/”
name: sonar-extensions
env:
- name: “SONARQUBE_JDBC_USERNAME”
value: “sonar”
- name: “SONARQUBE_JDBC_URL”
value: “jdbc:postgresql://. .. /sonarqube”
- name: “SONARQUBE_JDBC_PASSWORD”
valueFrom:
secretKeyRef:
name: postgres
key: password
ports:
- containerPort: 9090
protocol: TCP
volumes:
- name: sonar-data
persistentVolumeClaim:
claimName: sonar-data
- name: sonar-extensions
persistentVolumeClaim:
claimName: sonar-extensions
Coverage is analyzing and producing the % in the azure devops summary section , But it was not populating it to the sonarqube dashboard as mentioend below ,
Can some one support on this please .
Regards,
Rajesh M
Colin
(Colin)
May 31, 2023, 9:44am
2
Hi,
Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:
7.1 → 7.9.6 → 8.9.10 → 9.9 → 10.0 (last step optional)
You may find these resources helpful:
If you have questions about upgrading, feel free to open a new thread for that here .
If your error persists after upgrade, please come back to us.
Colin:
7.1 → 7.9.6
Thanks a lot for the response , I have been implemented the Sonarqube as a kubernetes Deployment using the below mentioned file .
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sonarqube
name: sonarqube
namespace: sonar
spec:
replicas: 1
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
spec:
containers:
name: sonarqube
image: sonarqube:7.1
resources:
requests:
cpu: 500m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
volumeMounts:
mountPath: “/opt/sonarqube/data/”
name: sonar-data
mountPath: “/opt/sonarqube/extensions/”
name: sonar-extensions
env:
name: “SONARQUBE_JDBC_USERNAME”
value: “sonar”
name: “SONARQUBE_JDBC_URL”
value: “jdbc:postgresql://. .. /sonarqube”
name: “SONARQUBE_JDBC_PASSWORD”
valueFrom:
secretKeyRef:
name: postgres
key: password
ports:
containerPort: 9090
protocol: TCP
volumes:
name: sonar-data
persistentVolumeClaim:
claimName: sonar-data
name: sonar-extensions
persistentVolumeClaim:
claimName: sonar-extensions
So can we do a Image Change alone from 7.1 to 7.9.6 to check the functionality of the coverage ,
And I have some doubts in the sonarqube versions .
Does 7.1 Does’nt support the coverage from the sonarqube
Do we have any other dependencies to install the plugin for the coverage in sonarqube if that so ?
Regards,
Rajesh M
Colin
(Colin)
May 31, 2023, 1:24pm
4
It’s a good place to start and should work if you follow the upgrade guide (and future upgrade guides) carefully. Once you get to SonarQube v8.9 LTS , there is some official support and guidance for running SonarQube and Kubernetes.
And, you might want to start up an instance of SonarQube v9.9 LTS to perform some testing, if upgrade will take a while. We can only advise on support instances of SonarQube – SonarQube v7.1 was released over five years ago.