Skip to content

Commit

Permalink
SONAR-20449 community PR to fix PDB typo on top of #402
Browse files Browse the repository at this point in the history
* BREAKING change for PDB typo

* Renamed template as well

* Note deprecation in schema and changelog; use flow control to prefer podDisruptionBudget ad fallback to podDistributionBudget

* Remove sonarqube-dce prefix

* Move change detail under 10.4

* SONAR-20449 add chart.yml changelog

* SONAR-20449 fix deprecation behavior, invertong if logic

* SONAR-20449 address PR comment

rephrase changelog
explicitly keep deprecated value as comment

---------

Co-authored-by: Wayne Khan <[email protected]>
  • Loading branch information
jCOTINEAU and waynekhan authored Jan 19, 2024
1 parent f472272 commit a419456
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 15 deletions.
1 change: 1 addition & 0 deletions charts/sonarqube-dce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All changes to this chart will be documented in this file.
* Improve the description of deprecated `ApplicationNodes.jvmOpts` and `ApplicationNodes.jvmCeOpts` values
* Run the initSysctl init-container as root to prevent 'permission denied' issues
* Add revisionHistoryLimit configuration for SonarQube application Deployment ReplicaSets
* Introduce `ApplicationNodes.podDisruptionBudget` and `searchNodes.podDisruptionBudget` and deprecate `ApplicationNodes.podDistributionBudget` and `searchNodes.podDistributionBudget`.

## [10.3.0]
* Upgrade SonarQube to 10.3.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 @@ -35,6 +35,8 @@ annotations:
description: "Run the initSysctl init-container as root to prevent 'permission denied' issues"
- kind: changed
description: "Add revisionHistoryLimit configuration for SonarQube application Deployment ReplicaSets"
- kind: deprecated
description: "Introduce `ApplicationNodes.podDisruptionBudget` and `searchNodes.podDisruptionBudget` and deprecate `ApplicationNodes.podDistributionBudget` and `searchNodes.podDistributionBudget`."
artifacthub.io/links: |
- name: support
url: https://community.sonarsource.com/
Expand Down
6 changes: 4 additions & 2 deletions charts/sonarqube-dce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ The following table lists the configurable parameters of the SonarQube chart and
| `searchNodes.searchAuthentication.keyStorePasswordSecret` | Existing secret for Password to Keystore/Truststore used in search nodes (optional) | `nil` |
| `searchNodes.searchAuthentication.userPassword` | A User Password that will be used to authenticate against the Search Cluster | `""` |
| `searchNodes.replicaCount` | Replica count of the Search Nodes | `3` |
| `searchNodes.podDistributionBudget` | PodDisruptionBudget for the Search Nodes | `minAvailable: 2` |
| `searchNodes.podDisruptionBudget` | PodDisruptionBudget for the Search Nodes | `minAvailable: 2` |
| `searchNodes.podDistributionBudget` | (DEPRECATED typo) PodDisruptionBudget for the Search Nodes | `minAvailable: 2` |
| `searchNodes.securityContext.fsGroup` | Group applied to mounted directories/files on search nodes | `1000` |
| `searchNodes.containerSecurityContext` | SecurityContext for search container in sonarqube pod | [Restricted podSecurityStandard](#kubernetes---pod-security-standards) |
| `searchNodes.readinessProbe.initialDelaySeconds` | ReadinessProbe initial delay for Search Node checking | `60` |
Expand Down Expand Up @@ -235,7 +236,8 @@ The following table lists the configurable parameters of the SonarQube chart and
| `ApplicationNodes.sonarSecretProperties` | Additional `sonar.properties` key-value pairs for App Nodes to load from a secret | `None` |
| `ApplicationNodes.sonarSecretKey` | Name of existing secret used for settings encryption | `None` |
| `ApplicationNodes.replicaCount` | Replica count of the app Nodes | `2` |
| `ApplicationNodes.podDistributionBudget` | PodDisruptionBudget for the App Nodes | `minAvailable: 1` |
| `ApplicationNodes.podDisruptionBudget` | PodDisruptionBudget for the App Nodes | `minAvailable: 1` |
| `ApplicationNodes.podDistributionBudget` | (DEPRECATED typo) PodDisruptionBudget for the App Nodes | `minAvailable: 1` |
| `ApplicationNodes.securityContext.fsGroup` | Group applied to mounted directories/files on app nodes | `1000` |
| `ApplicationNodes.containerSecurityContext` | SecurityContext for app container in sonarqube pod | [Restricted podSecurityStandard](#kubernetes---pod-security-standards) |
| `ApplicationNodes.readinessProbe.initialDelaySeconds` | ReadinessProbe initial delay for app Node checking | `60` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- with .Values.searchNodes.podDistributionBudget }}
{{ toYaml . | indent 2 }}
{{- end }}
{{ if .Values.searchNodes.podDistributionBudget }}
{{- with .Values.searchNodes.podDistributionBudget -}}
{{ toYaml . | indent 2 -}}
{{ end -}}
{{ else }}
{{- with .Values.searchNodes.podDisruptionBudget -}}
{{ toYaml . | indent 2 -}}
{{ end }}
{{ end }}
selector:
matchLabels:
sonarqube.datacenter/type: "search"

---
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
Expand All @@ -27,9 +32,15 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- with .Values.ApplicationNodes.podDistributionBudget }}
{{ toYaml . | indent 2 }}
{{- end }}
{{ if .Values.ApplicationNodes.podDistributionBudget }}
{{- with .Values.ApplicationNodes.podDistributionBudget -}}
{{ toYaml . | indent 2 -}}
{{ end -}}
{{ else }}
{{- with .Values.ApplicationNodes.podDisruptionBudget -}}
{{ toYaml . | indent 2 -}}
{{ end }}
{{ end }}
selector:
matchLabels:
sonarqube.datacenter/type: "app"
sonarqube.datacenter/type: "app"
26 changes: 25 additions & 1 deletion charts/sonarqube-dce/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,32 @@
"$comment": "(DEPRECATED) please use sonarWebContext at the value top level"
}
}
},
"podDisruptionBudget": {
"type": "object",
"deprecated": true,
"$comment": "PodDisruptionBudget for the Application Nodes"
},
"podDistributionBudget": {
"type": "object",
"deprecated": true,
"$comment": "(DEPRECATED) Please use ApplicationNodes.podDisruptionBudget"
}
}
},
"searchNodes": {
"properties": {
"podDisruptionBudget": {
"type": "object",
"deprecated": false,
"$comment": "PodDisruptionBudget for the Search Nodes"
},
"podDistributionBudget": {
"type": "object",
"deprecated": true,
"$comment": "(DEPRECATED) Please use SearchNodes.podDisruptionBudget"
}
}
}
}
}
}
16 changes: 12 additions & 4 deletions charts/sonarqube-dce/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ searchNodes:

replicaCount: 3

# Pod Distribution Budget for search nodes
podDistributionBudget:
# Pod Disruption Budget for search nodes
podDisruptionBudget:
minAvailable: 2

# (DEPRECATED typo) Please use searchNodes.podDisruptionBudget instead
# podDistributionBudget:
# minAvailable: 2

# Set security context for sonarqube search pods
securityContext:
fsGroup: 1000
Expand Down Expand Up @@ -175,10 +179,14 @@ ApplicationNodes:
# How many revisions to retain (Deployment ReplicaSets)
revisionHistoryLimit: 10

# Pod Distribution Budget for app nodes
podDistributionBudget:
# Pod Disruption Budget for app nodes
podDisruptionBudget:
minAvailable: 1

# (DEPRECATED typo) Please use searchNodes.podDisruptionBudget instead
# podDistributionBudget:
# minAvailable: 2

# Set security context for sonarqube app pods
securityContext:
fsGroup: 1000
Expand Down

0 comments on commit a419456

Please sign in to comment.