From baa40bacf0b6f447fd13b000e163b457331a22ed Mon Sep 17 00:00:00 2001 From: brais <26645694+braisvq1996@users.noreply.github.com> Date: Fri, 10 May 2024 14:30:55 +0200 Subject: [PATCH] update sonar and make resource config customizable (#1283) --- CHANGELOG.md | 1 + configuration-sample/ods-core.env.sample | 32 ++++++++++++++++++- nexus/chart/Chart.yaml | 2 +- nexus/chart/templates/pvc-data.yml | 2 +- nexus/chart/templates/pvc-db-backup.yml | 2 +- nexus/chart/values.yaml.template | 10 +++--- sonarqube/chart/Chart.yaml | 4 +-- sonarqube/chart/templates/pvc-extensions.yaml | 2 +- .../templates/pvc-postgresql-backup.yaml | 2 +- sonarqube/chart/templates/pvc-postgresql.yaml | 2 +- sonarqube/chart/templates/pvc-sonar-data.yaml | 2 +- sonarqube/chart/values.yaml.template | 20 +++++++----- 12 files changed, 59 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8528c61b8..00ca9aa5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Add availability check for DocGen pod ([#1277](https://github.com/opendevstack/ods-core/pull/1277)) ### Changed +- Update SonarQube to 9.9.5 and configure resources for Nexus and Sonarqube in ods-configuration ([#1283](https://github.com/opendevstack/ods-core/pull/1283)) ## [4.4.0] - 2024-04-22 diff --git a/configuration-sample/ods-core.env.sample b/configuration-sample/ods-core.env.sample index e75a7ba51..fb6b920ce 100644 --- a/configuration-sample/ods-core.env.sample +++ b/configuration-sample/ods-core.env.sample @@ -71,6 +71,16 @@ NEXUS_AUTH=developer:changeme # See https://help.sonatype.com/en/sonatype-nexus-repository-system-requirements.html NEXUS_JVM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=/nexus-data/javaprefs" +# Nexus memory and CPU resources +NEXUS_CPU_REQUEST=200m +NEXUS_MEMORY_REQUEST=3Gi +NEXUS_CPU_LIMIT=1 +NEXUS_MEMORY_LIMIT=5Gi + +# Nexus data and backup capacity +NEXUS_DATA_CAPACITY=60Gi +NEXUS_DATA_BACKUP_CAPACITY=10Gi + ############# # SonarQube # ############# @@ -125,7 +135,27 @@ SONAR_EDITION=community # See Dockerhub https://hub.docker.com/_/sonarqube/tags # Officially supported is: # - 9.9 (LTS release) -SONAR_VERSION=9.9.4 +SONAR_VERSION=9.9.5 + +# SonarQube memory and CPU resources +SONARQUBE_CPU_REQUEST=200m +SONARQUBE_MEMORY_REQUEST=2Gi +SONARQUBE_CPU_LIMIT=1 +SONARQUBE_MEMORY_LIMIT=4Gi + +# SonarQube data and backup capacity +SONARQUBE_DATA_CAPACITY=2Gi +SONARQUBE_EXTENSIONS_CAPACITY=1Gi + +# SonarQube database memory and CPU resources +SONARQUBE_DB_CPU_REQUEST=100m +SONARQUBE_DB_MEMORY_REQUEST=256Mi +SONARQUBE_DB_CPU_LIMIT=1 +SONARQUBE_DB_MEMORY_LIMIT=512Mi + +# SonarQube database and backup capacity +SONARQUBE_DB_CAPACITY=2Gi +SONARQUBE_DB_BACKUP_CAPACITY=1Gi ######### # Jira # diff --git a/nexus/chart/Chart.yaml b/nexus/chart/Chart.yaml index 8737a070a..235d053c1 100644 --- a/nexus/chart/Chart.yaml +++ b/nexus/chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/nexus/chart/templates/pvc-data.yml b/nexus/chart/templates/pvc-data.yml index 1c1c1be71..7f4917759 100644 --- a/nexus/chart/templates/pvc-data.yml +++ b/nexus/chart/templates/pvc-data.yml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 60Gi + storage: {{ .Values.nexus.pvcDataCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/nexus/chart/templates/pvc-db-backup.yml b/nexus/chart/templates/pvc-db-backup.yml index ee9355c24..1bf111a3a 100644 --- a/nexus/chart/templates/pvc-db-backup.yml +++ b/nexus/chart/templates/pvc-db-backup.yml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 10Gi + storage: {{ .Values.nexus.pvcDataBackupCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/nexus/chart/values.yaml.template b/nexus/chart/values.yaml.template index 667ac4959..ffbb361b5 100644 --- a/nexus/chart/values.yaml.template +++ b/nexus/chart/values.yaml.template @@ -15,10 +15,12 @@ global: nexusDockerGroup: 'docker-group' nexusJvmParams: $NEXUS_JVM_PARAMS nexus: - cpuRequest: 200m - cpuLimit: 1 - memRequest: 2Gi - memLimit: 4Gi + cpuRequest: $NEXUS_CPU_REQUEST + cpuLimit: $NEXUS_CPU_LIMIT + memRequest: $NEXUS_MEMORY_REQUEST + memLimit: $NEXUS_MEMORY_LIMIT + pvcDataCapacity: $NEXUS_DATA_CAPACITY + pvcDataBackupCapacity: $NEXUS_DATA_BACKUP_CAPACITY buildConfig: cpuRequest: 200m cpuLimit: 1 diff --git a/sonarqube/chart/Chart.yaml b/sonarqube/chart/Chart.yaml index 080ee4f65..67e524ece 100644 --- a/sonarqube/chart/Chart.yaml +++ b/sonarqube/chart/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "9.9.4" +appVersion: "9.9.5" diff --git a/sonarqube/chart/templates/pvc-extensions.yaml b/sonarqube/chart/templates/pvc-extensions.yaml index 5a3da8ab7..7057b48dd 100644 --- a/sonarqube/chart/templates/pvc-extensions.yaml +++ b/sonarqube/chart/templates/pvc-extensions.yaml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 1Gi + storage: {{ .Values.sonarqube.pvcExtensionsCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/sonarqube/chart/templates/pvc-postgresql-backup.yaml b/sonarqube/chart/templates/pvc-postgresql-backup.yaml index 4cc73b5ad..dbe622a94 100644 --- a/sonarqube/chart/templates/pvc-postgresql-backup.yaml +++ b/sonarqube/chart/templates/pvc-postgresql-backup.yaml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 1Gi + storage: {{ .Values.postgresql.pvcDatabaseBackupCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/sonarqube/chart/templates/pvc-postgresql.yaml b/sonarqube/chart/templates/pvc-postgresql.yaml index f07b0712a..619fb38bc 100644 --- a/sonarqube/chart/templates/pvc-postgresql.yaml +++ b/sonarqube/chart/templates/pvc-postgresql.yaml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 2Gi + storage: {{ .Values.postgresql.pvcDatabaseCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/sonarqube/chart/templates/pvc-sonar-data.yaml b/sonarqube/chart/templates/pvc-sonar-data.yaml index 0481d513a..10050a59d 100644 --- a/sonarqube/chart/templates/pvc-sonar-data.yaml +++ b/sonarqube/chart/templates/pvc-sonar-data.yaml @@ -13,6 +13,6 @@ spec: - ReadWriteOnce resources: requests: - storage: 2Gi + storage: {{ .Values.sonarqube.pvcDataCapacity }} storageClassName: {{ .Values.global.storageClassData }} volumeMode: Filesystem diff --git a/sonarqube/chart/values.yaml.template b/sonarqube/chart/values.yaml.template index 1b514269d..e1bd92573 100644 --- a/sonarqube/chart/values.yaml.template +++ b/sonarqube/chart/values.yaml.template @@ -22,15 +22,19 @@ global: sonarDatabaseImage: $SONAR_DATABASE_IMAGE postgresql: name: 'sonarqube-postgresql' - cpuRequest: 100m - cpuLimit: 1 - memRequest: 256Mi - memLimit: 512Mi + cpuRequest: $SONARQUBE_DB_CPU_REQUEST + cpuLimit: $SONARQUBE_DB_CPU_LIMIT + memRequest: $SONARQUBE_DB_MEMORY_REQUEST + memLimit: $SONARQUBE_DB_MEMORY_LIMIT + pvcDatabaseCapacity: $SONARQUBE_DB_CAPACITY + pvcDatabaseBackupCapacity: $SONARQUBE_DB_BACKUP_CAPACITY sonarqube: - cpuRequest: 200m - cpuLimit: 1 - memRequest: 2Gi - memLimit: 4Gi + cpuRequest: $SONARQUBE_CPU_REQUEST + cpuLimit: $SONARQUBE_CPU_LIMIT + memRequest: $SONARQUBE_MEMORY_REQUEST + memLimit: $SONARQUBE_MEMORY_LIMIT + pvcDataCapacity: $SONARQUBE_DATA_CAPACITY + pvcExtensionsCapacity: $SONARQUBE_EXTENSIONS_CAPACITY sonarAuthSaml: $SONAR_AUTH_SAML sonarAuthSamlApplicationId: $SONAR_SAML_APPLICATION_ID sonarAuthSamlProviderIdB64: $SONAR_SAML_PROVIDER_ID_B64