Skip to content

Commit

Permalink
SONAR-22219 add extra volume and extra volume mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
jCOTINEAU committed Sep 26, 2024
1 parent 76f19a5 commit 078b42b
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 2 deletions.
2 changes: 2 additions & 0 deletions charts/sonarqube-dce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ The following table lists the configurable parameters of the SonarQube chart and
| `ApplicationNodes.jwtSecret` | A HS256 key encoded with base64 (_This value must be set before installing the chart, see [the documentation](https://docs.sonarsource.com/sonarqube/latest/setup-and-upgrade/deploy-on-kubernetes/cluster/)_) | `""` |
| `ApplicationNodes.existingJwtSecret` | secret that contains the `jwtSecret` | `nil` |
| `ApplicationNodes.extraContainers` | Array of extra containers to run alongside | `[]` |
| `ApplicationNodes.extraVolumes` | Array of extra volumes to add to the SonarQube deployment | `[]` |
| `ApplicationNodes.extraVolumeMounts` | Array of extra volume mounts to add to the SonarQube deployment | `[]` |
| `ApplicationNodes.hpa.enabled` | Enable the HorizontalPodAutoscaler (HPA) for the app deployment | `false` |
| `ApplicationNodes.hpa.minReplicas` | Minimum number of replicas for the HPA | `2` |
| `ApplicationNodes.hpa.maxReplicas` | Maximum number of replicas for the HPA | `10` |
Expand Down
6 changes: 6 additions & 0 deletions charts/sonarqube-dce/templates/sonarqube-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ spec:
name: es-secret
readOnly: true
{{- end }}
{{- with .Values.ApplicationNodes.extraVolumeMounts -}}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
Expand Down Expand Up @@ -444,3 +447,6 @@ spec:
- name : concat-dir
emptyDir: {{- toYaml .Values.emptyDir | nindent 10 -}}
{{- end }}
{{- with .Values.ApplicationNodes.extraVolumes -}}
{{- toYaml . | nindent 6 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/sonarqube-dce/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ ApplicationNodes:
## command: ['sh', '-c', 'echo Hello && sleep 3600']
##
extraContainers: []
extraVolumes: []
extraVolumeMounts: []

# Define the Horizontal Pod Autoscaler for the app deployment
hpa:
Expand Down
1 change: 1 addition & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ All changes to this chart will be documented in this file.
* Remove socketTimeout from jdbcOverwrite.jdbcUrl's default value
* Refactor Route to be subparameter of OpenShift
* Make OpenShift.createSCC false by default
* Deprecate peristence.volumes and persistence.mounts in favor or extraVolumes and extraVolumeMounts

## [10.6.0]
* Update SonarQube to 10.6.0
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ annotations:
description: "Refactor Route to be subparameter of OpenShift"
- kind: changed
description: "Make OpenShift.createSCC false by default"
- kind: changed
description: "Deprecate peristence.volumes and persistence.mounts in favor or extraVolumes and extraVolumeMounts"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/images: |
- name: sonarqube
Expand Down
4 changes: 2 additions & 2 deletions charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ The following table lists the configurable parameters of the SonarQube chart and
| `persistence.storageClass` | Storage class to be used | `""` |
| `persistence.accessMode` | Volumes access mode to be set | `ReadWriteOnce` |
| `persistence.size` | Size of the volume | `5Gi` |
| `persistence.volumes` | Specify extra volumes. Refer to ".spec.volumes" specification | `[]` |
| `persistence.mounts` | Specify extra mounts. Refer to ".spec.containers.volumeMounts" specification | `[]` |
| `persistence.volumes` | (DEPRECATED) Please use extraVolumes instead | `[]` |
| `persistence.mounts` | (DEPRECATED) Please use extraVolumeMounts instead | `[]` |
| `persistence.uid` | UID used for init-fs container | `1000` |
| `persistence.guid` | GUID used for init-fs container | `0` |
| `emptyDir` | Configuration of resources for `emptyDir` | `{}` |
Expand Down
15 changes: 15 additions & 0 deletions charts/sonarqube/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
"replicaCount"
],
"properties": {
"persistence": {
"type": "object",
"properties": {
"volumes": {
"type": "array",
"deprecated": true,
"$comment": "(DEPRECATED) Please use `extraVolumes` instead"
},
"mounts": {
"type": "array",
"deprecated": true,
"$comment": "(DEPRECATED) Please use `extraVolumeMounts` instead"
}
}
},
"networkPolicy": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions charts/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ extraInitContainers: {}
## command: ['sh', '-c', 'echo Hello && sleep 3600']
##
extraContainers: []
extraVolumes: []
extraVolumeMounts: []

## Provide a secret containing one or more certificate files in the keys that will be added to cacerts
## The cacerts file will be set via SONARQUBE_WEB_JVM_OPTS and SONAR_CE_JAVAOPTS
Expand Down Expand Up @@ -468,8 +470,10 @@ persistence:
uid: 1000
guid: 0

## DEPRECATED please use root level extraVolumes value
## Specify extra volumes. Refer to ".spec.volumes" specification : https://kubernetes.io/fr/docs/concepts/storage/volumes/
volumes: []
## DEPRECATED please use root level extraVolumeMounts value
## Specify extra mounts. Refer to ".spec.containers.volumeMounts" specification : https://kubernetes.io/fr/docs/concepts/storage/volumes/
mounts: []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,9 @@ spec:
subPath: logs
- mountPath: /tmp
name: tmp-dir
- mountPath: /extra-volume-mount
name: extra-volume
readOnly: true
serviceAccountName: default
volumes:
- name: config
Expand Down Expand Up @@ -607,6 +610,8 @@ spec:
- name : concat-dir
emptyDir:
{}
- emptyDir: {}
name: extra-volume
---
# Source: sonarqube-dce/charts/postgresql/templates/statefulset.yaml
apiVersion: apps/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ ApplicationNodes:
sonarProperties:
prop: yes
otherProp: false
extraVolumeMounts:
- name: "extra-volume"
mountPath: "/extra-volume-mount"
readOnly: true
extraVolumes:
- name: "extra-volume"
emptyDir: {}

sonarSecretKey: "settings-encryption-secret"

0 comments on commit 078b42b

Please sign in to comment.