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

SONAR-22219 add extra volume for dce ApplicationNodes #559

Merged
merged 1 commit into from
Sep 27, 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
1 change: 1 addition & 0 deletions charts/sonarqube-dce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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
* Support ApplicationNodes.extraVolumes and ApplicationNodes.extraVolumeMounts

## [10.6.0]
* Upgrade SonarQube to 10.6.0
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube-dce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ annotations:
description: "Refactor Route to be subparameter of OpenShift"
- kind: changed
description: "Make OpenShift.createSCC false by default"
- kind: added
description: "Support ApplicationNodes.extraVolumes and ApplicationNodes.extraVolumeMounts"
artifacthub.io/links: |
- name: support
url: https://community.sonarsource.com/
Expand Down
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 }}
3 changes: 3 additions & 0 deletions charts/sonarqube-dce/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ ApplicationNodes:
## command: ['sh', '-c', 'echo Hello && sleep 3600']
##
extraContainers: []
## Array of extra volumes and VolumeMounts to add to the SonarQube deployment
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
jCOTINEAU marked this conversation as resolved.
Show resolved Hide resolved
## 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 @@ -596,8 +596,13 @@ spec:
- mountPath: /opt/sonarqube/extensions
name: sonarqube
subPath: extensions
- mountPath: /extra-volume-mount
name: extra-volume
readOnly: true
serviceAccountName: default
volumes:
- emptyDir: {}
name: extra-volume
- name: config
configMap:
name: config-values.yaml-sonarqube-config
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"

10 changes: 9 additions & 1 deletion tests/unit-compatibility-test/sonarqube/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ sonarSecretProperties: some-secret

sonarSecretKey: "settings-encryption-secret"
elasticsearch:
bootstrapChecks: false
bootstrapChecks: false

extraVolumeMounts:
- name: "extra-volume"
mountPath: "/extra-volume-mount"
readOnly: true
extraVolumes:
- name: "extra-volume"
emptyDir: {}
Loading