Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Activate SonarQube monitoring + small refactor #121

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/nexus/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
status_code: [204]

- name: Activate Nexus metrics scraping
when: dsc.global.metrics.enabled == true
when: dsc.global.metrics.enabled
block:
- name: Create admin-creds secret
kubernetes.core.k8s:
Expand Down
53 changes: 31 additions & 22 deletions roles/sonarqube/templates/values/00-main.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@ image:

sonarWebContext: /

sonarProperties:
sonar.auth.oidc.enabled: "true"
sonar.auth.oidc.allowUsersToSignUp: "true"
sonar.auth.oidc.autoLogin: "false"
sonar.auth.oidc.groupsSync.claimName: "groups"
sonar.auth.oidc.loginStrategy: "Email"
sonar.auth.oidc.groupsSync: "true"
sonar.auth.oidc.scopes: "openid generic"
sonar.auth.oidc.loginStrategy.customClaim.name: "upn"
sonar.auth.oidc.clientId.secured: "{{ keycloak_client }}"
sonar.auth.oidc.clientSecret.secured: "{{ keycloak_secret }}"
sonar.auth.oidc.issuerUri: "https://{{ keycloak_domain }}/realms/dso"
sonar.core.serverBaseURL: https://{{ sonar_domain }}
sonar.plugins.risk.consent: "ACCEPTED"

plugins:
install:
- https://github.com/vaulttec/sonar-auth-oidc/releases/download/v2.1.1/sonar-auth-oidc-plugin-2.1.1.jar
- https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/1.14.0/sonarqube-community-branch-plugin-1.14.0.jar

jvmOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=web"
jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=ce"
ingress:
enabled: true
# Used to create an Ingress record.
Expand All @@ -53,11 +31,42 @@ initFs:
securityContext:
privileged: true

prometheusExporter:
enabled: {{ dsc.global.metrics.enabled }}

prometheusMonitoring:
podMonitor:
enabled: {{ dsc.global.metrics.enabled }}
namespace: {{ dsc.sonarqube.namespace }}

plugins:
install:
- https://github.com/vaulttec/sonar-auth-oidc/releases/download/v2.1.1/sonar-auth-oidc-plugin-2.1.1.jar
- https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/1.14.0/sonarqube-community-branch-plugin-1.14.0.jar

jvmOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=web"
jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=ce"

## a monitoring passcode needs to be defined in order to get reasonable probe results
# not setting the monitoring passcode will result in a deployment that will never be ready
monitoringPasscodeSecretName: "sonar-monitoring-password"
monitoringPasscodeSecretKey: "monitoring-password"

sonarProperties:
sonar.auth.oidc.enabled: "true"
sonar.auth.oidc.allowUsersToSignUp: "true"
sonar.auth.oidc.autoLogin: "false"
sonar.auth.oidc.groupsSync.claimName: "groups"
sonar.auth.oidc.loginStrategy: "Email"
sonar.auth.oidc.groupsSync: "true"
sonar.auth.oidc.scopes: "openid generic"
sonar.auth.oidc.loginStrategy.customClaim.name: "upn"
sonar.auth.oidc.clientId.secured: "{{ keycloak_client }}"
sonar.auth.oidc.clientSecret.secured: "{{ keycloak_secret }}"
sonar.auth.oidc.issuerUri: "https://{{ keycloak_domain }}/realms/dso"
sonar.core.serverBaseURL: https://{{ sonar_domain }}
sonar.plugins.risk.consent: "ACCEPTED"

## Override JDBC values
## for external Databases
jdbcOverwrite:
Expand Down