diff --git a/charts/sonarqube/CHANGELOG.md b/charts/sonarqube/CHANGELOG.md index 18c4a2948..ca451b953 100644 --- a/charts/sonarqube/CHANGELOG.md +++ b/charts/sonarqube/CHANGELOG.md @@ -5,6 +5,9 @@ All changes to this chart will be documented in this file. * Update Chart's version to 10.8.0 * Support the installation of the Oracle JDBC Driver * Support Kubernetes v1.31 +* Deprecate the `community` value for the `edition` parameter +* Introduce the `community.enabled` and `community.buildNumber` parameters for SonarQube Community Build +* Deprecate the default value of `image.tag` in favor of an empty string ## [10.7.0] * Update Chart's version to 10.7.0 diff --git a/charts/sonarqube/Chart.yaml b/charts/sonarqube/Chart.yaml index 155aa5c71..ff49f6808 100644 --- a/charts/sonarqube/Chart.yaml +++ b/charts/sonarqube/Chart.yaml @@ -38,6 +38,12 @@ annotations: description: "Support the installation of the Oracle JDBC Driver" - kind: changed description: "Support Kubernetes v1.31" + - kind: deprecated + description: "Deprecate the "community" value for the "edition" parameter" + - kind: deprecated + description: "Deprecate the default value of "image.tag" in favor of an empty string" + - kind: added + description: "Introduce the "community.enabled" and "community.buildNumber" parameters for SonarQube Community Build" artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/images: | - name: sonarqube diff --git a/charts/sonarqube/README.md b/charts/sonarqube/README.md index 52d5449be..92cb87e16 100644 --- a/charts/sonarqube/README.md +++ b/charts/sonarqube/README.md @@ -37,6 +37,13 @@ The [configuration](#configuration) section lists the parameters that can be con The default login is admin/admin. +## Installing the SonarQube Community Build chart + +The SonarQube Community Edition has been replaced by the SonarQube Community Build. +If you want to install the SonarQube Community Build chart, please set `community.enabled` to `true`. +The `community.buildNumber` parameter will be set to the latest Community Build. +The `community` value is deprecated and won't be supported for `edition` anymore. + ## Installing the SonarQube 9.9 LTA chart The version of the chart for the SonarQube 9.9 LTA is being distributed as the `8.x.x` version of this chart. @@ -227,26 +234,28 @@ The following table lists the configurable parameters of the SonarQube chart and ### Global -| Parameter | Description | Default | -| -------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------- | -| `deploymentType` | Deployment Type (supported values are `StatefulSet` or `Deployment`) | `StatefulSet` | -| `replicaCount` | Number of replicas deployed (supported values are 0 and 1) | `1` | -| `deploymentStrategy` | Deployment strategy | `{}` | -| `priorityClassName` | Schedule pods on priority (e.g. `high-priority`) | `None` | -| `schedulerName` | Kubernetes scheduler name | `None` | -| `affinity` | Node / Pod affinities | `{}` | -| `tolerations` | List of node taints to tolerate | `[]` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `hostAliases` | Aliases for IPs in /etc/hosts | `[]` | -| `podLabels` | Map of labels to add to the pods | `{}` | -| `env` | Environment variables to attach to the pods | `{}` | -| `annotations` | SonarQube Pod annotations | `{}` | -| `edition` | SonarQube Edition to use (e.g. `community`, `developer` or `enterprise`) | `community` | -| `sonarWebContext` | SonarQube web context, also serve as default value for `ingress.path`, `account.sonarWebContext` and probes path. | `` | -| `httpProxySecret` | Should contain `http_proxy`, `https_proxy` and `no_proxy` keys, will superseed every other proxy variables | `` | -| `httpProxy` | HTTP proxy for downloading JMX agent and install plugins, will superseed initContainer specific http proxy variables | `` | -| `httpsProxy` | HTTPS proxy for downloading JMX agent and install plugins, will superseed initContainer specific https proxy variable | `` | -| `noProxy` | No proxy for downloading JMX agent and install plugins, will superseed initContainer specific no proxy variables | `` | +| Parameter | Description | Default | +| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------- | +| `deploymentType` | Deployment Type (supported values are `StatefulSet` or `Deployment`) | `StatefulSet` | +| `replicaCount` | Number of replicas deployed (supported values are 0 and 1) | `1` | +| `deploymentStrategy` | Deployment strategy | `{}` | +| `priorityClassName` | Schedule pods on priority (e.g. `high-priority`) | `None` | +| `schedulerName` | Kubernetes scheduler name | `None` | +| `affinity` | Node / Pod affinities | `{}` | +| `tolerations` | List of node taints to tolerate | `[]` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `hostAliases` | Aliases for IPs in /etc/hosts | `[]` | +| `podLabels` | Map of labels to add to the pods | `{}` | +| `env` | Environment variables to attach to the pods | `{}` | +| `annotations` | SonarQube Pod annotations | `{}` | +| `edition` | SonarQube Edition to use (e.g. `community`, `developer` or `enterprise`). Please note that the default `community` value is deprecated. | `community` | +| `community.enabled` | Install SonarQube Community Build | `false` | +| `community.buildNumber` | The SonarQube Community Build number to install | `10.7.0` | +| `sonarWebContext` | SonarQube web context, also serve as default value for `ingress.path`, `account.sonarWebContext` and probes path. | `` | +| `httpProxySecret` | Should contain `http_proxy`, `https_proxy` and `no_proxy` keys, will superseed every other proxy variables | `` | +| `httpProxy` | HTTP proxy for downloading JMX agent and install plugins, will superseed initContainer specific http proxy variables | `` | +| `httpsProxy` | HTTPS proxy for downloading JMX agent and install plugins, will superseed initContainer specific https proxy variable | `` | +| `noProxy` | No proxy for downloading JMX agent and install plugins, will superseed initContainer specific no proxy variables | `` | ### NetworkPolicies @@ -273,13 +282,13 @@ The following table lists the configurable parameters of the SonarQube chart and ### Image -| Parameter | Description | Default | -| ------------------- | ---------------------------------------------------------- | ------------------------------ | -| `image.repository` | image repository | `sonarqube` | -| `image.tag` | `sonarqube` image tag. | `10.7.0-{{ .Values.edition }}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecret` | (DEPRECATED) imagePullSecret to use for private repository | `None` | -| `image.pullSecrets` | imagePullSecrets to use for private repository | `None` | +| Parameter | Description | Default | +| ------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------ | +| `image.repository` | image repository | `sonarqube` | +| `image.tag` | `sonarqube` image tag. Please note that the default `10.7.0-{{ .Values.edition }}` is deprecated. | `10.7.0-{{ .Values.edition }}` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.pullSecret` | (DEPRECATED) imagePullSecret to use for private repository | `None` | +| `image.pullSecrets` | imagePullSecrets to use for private repository | `None` | ### Security diff --git a/charts/sonarqube/templates/NOTES.txt b/charts/sonarqube/templates/NOTES.txt index 8af159dc4..0b36705bb 100644 --- a/charts/sonarqube/templates/NOTES.txt +++ b/charts/sonarqube/templates/NOTES.txt @@ -17,6 +17,11 @@ echo "Visit http://127.0.0.1:8080 to use your application" kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }} -n {{ .Release.Namespace }} {{- end }} +{{- if eq .Values.edition "community" }} +DEPRECATION NOTICE: The SonarQube Community Edition has been replaced by the SonarQube Community Build. + Please use "community.enabled=true" to use the latest SonarQube Community Build. + The "community" value is deprecated and won't be supported for "edition" anymore. +{{- end }} WARNING: Please note that the SonarQube image runs with a non-root user (uid=1000) belonging to the root group (guid=0). In this way, the chart can support arbitrary user ids as recommended in OpenShift. Please visit https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#use-uid_create-images for more information. diff --git a/charts/sonarqube/templates/_helpers.tpl b/charts/sonarqube/templates/_helpers.tpl index 5bd376be1..2d33af7d0 100644 --- a/charts/sonarqube/templates/_helpers.tpl +++ b/charts/sonarqube/templates/_helpers.tpl @@ -46,14 +46,29 @@ app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: sonarqube app.kubernetes.io/component: {{ include "sonarqube.fullname" . }} -app.kubernetes.io/version: {{ (tpl .Values.image.tag .) | trunc 63 | trimSuffix "-" | quote }} +app.kubernetes.io/version: {{ (tpl (include "image.tag" .) . ) | trunc 63 | trimSuffix "-" | quote }} {{- end -}} {{/* Expand the Application Image name. */}} {{- define "sonarqube.image" -}} -{{- printf "%s:%s" .Values.image.repository (tpl .Values.image.tag .) }} +{{- printf "%s:%s" .Values.image.repository (tpl (include "image.tag" .) .) }} +{{- end -}} + +{{/* + Define the image.tag value that computes the right tag to be used as `sonarqube.image` +*/}} +{{- define "image.tag" -}} +{{- if or (not (hasKey .Values.image "tag")) (empty .Values.image.tag) -}} +{{- if or (.Values.community.enabled) (and (not (empty .Values.edition)) (eq .Values.edition "community")) -}} +{{- printf "%s-%s" .Values.community.buildNumber "community" -}} +{{- else if and (not (empty .Values.edition)) (ne .Values.edition "community") -}} +{{- printf "%s-%s" .Chart.AppVersion .Values.edition -}} +{{- end -}} +{{- else -}} +{{- .Values.image.tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/charts/sonarqube/templates/tests/sonarqube-test.yaml b/charts/sonarqube/templates/tests/sonarqube-test.yaml index 111543927..a47ff4808 100644 --- a/charts/sonarqube/templates/tests/sonarqube-test.yaml +++ b/charts/sonarqube/templates/tests/sonarqube-test.yaml @@ -19,7 +19,7 @@ spec: {{- end }} containers: - name: {{ .Release.Name }}-ui-test - image: {{ .Values.tests.image | default (printf "%s:%s" .Values.image.repository (tpl .Values.image.tag .)) | quote }} + image: {{ .Values.tests.image | default (include "sonarqube.image" .) | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: ['wget'] args: [ diff --git a/charts/sonarqube/values.yaml b/charts/sonarqube/values.yaml index 8788e7cfa..3b3fcba98 100644 --- a/charts/sonarqube/values.yaml +++ b/charts/sonarqube/values.yaml @@ -46,10 +46,17 @@ OpenShift: # labels: # external: 'true' +# (DEPRECATED) The "community" value as the default of "edition" is deprecated and will be removed in the next release (in favor of an empty value). Please set "community" to "true", if you want to use SonarQube Community Build. edition: "community" +# Set the chart to use the latest released SonarQube Community Build +community: + enabled: true + buildNumber: "10.7.0" + image: repository: sonarqube + # (DEPRECATED) The "image.tag" parameter will be set to be empty as default. tag: 10.7.0-{{ .Values.edition }} pullPolicy: IfNotPresent # If using a private repository, the imagePullSecrets to use