** SonarQube project creation 1. Click on Projects tab -> Create new project -> Select "Manually" 2. Project display name and Project key: "test-repo" 3. Click on Set up. 4. Select "Locally" on "How do you want to analyze your repository" 5. Use existing token: paste the value of sonarqube-k8s-global token here. 6. Click on Continue. 7. Now, no need to do anything here for now. Go to Jenkins setup. ** Jenkins integration with SonarQube 1. Open /manage/credentials/store/system/domain/_/ - Add credential - Kind: Secret text - Paste the value of sonarqube-k8s-global token in the Secret field. - Id: sonarqube-k8s - Description: SonarQube k8s server access token 2. Open /manage/configure: 1. Add SonarQube: - Name: sonarqube-k8s - Server URL: `$ kubectl get service -n sonarqube | grep sonarqube-sonarqube` - Port: 3050 (ex: http://10.102.225.169:3050) - Server authentication token: "SonarQube k8s server access token" 2. Click on Save. ** Jenkins pipeline with SonarQube 1. Open the PipelineProject1 project on Jenkins. 2. Configure the project. 3. In the Pipeline script copy-paste pipeline.groovy file. 4. Modify any configurable elements, as required. 5. Go to the project page and click on Build Now. 6. The build should succeed. 7. Now, open SQ project page, it should show the latest status. ** Testing 1. Killed sonarqube-sonarqube-0 pod: - kubectl -n sonarqube delete pod sonarqube-sonarqube-0 - kubectl -n sonarqube get pods --watch - Wait for the pod to get in Ready (1/1) state. - Opened http://10.102.225.169:3050 and logged in, all the data exists. Everything is working. 2. Killed sonarqube-postgresql-0 pod: - kubectl -n sonarqube delete pod sonarqube-postgresql-0 - Wait for the pod to get Running again: kubectl -n sonarqube get pods --watch - Refreshed the page, everything is working fine. 3. Killed both the pods: - kubectl -n sonarqube delete pods --all - Waited for both pods to get into Running and Ready (1/1) states. - Opened the URL and logged in. Data was intact and everything was working properly.