Skip to content

Commit

Permalink
SONAR-23715 Set deploymentStrategy to Recreate
Browse files Browse the repository at this point in the history
  • Loading branch information
davividal authored Nov 22, 2024
1 parent 17e634b commit 3e07665
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 41 deletions.
1 change: 1 addition & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All changes to this chart will be documented in this file.
* Replace the example images in initContainers, initSysctl and initFs from `busybox:1.36` to `ubuntu:24.04`, which are commented out by default
* Make the `automountServiceAccountToken` configurable with `serviceAccount.automountToken` in PodSpec
* Deprecate `sonarqubeFolder`, `jdbcOverwrite.jdbcPassword` and `terminationGracePeriodSeconds`.
* Deprecate `deploymentStrategy.type`, which will be set to `Recreate`

## [10.7.0]
* Update Chart's version to 10.7.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 @@ -62,6 +62,8 @@ annotations:
description: "Make the 'automountServiceAccountToken' configurable with 'serviceAccount.automountToken' in PodSpec"
- kind: deprecated
description: "Deprecate `sonarqubeFolder`, `jdbcOverwrite.jdbcPassword` and `terminationGracePeriodSeconds`."
- kind: deprecated
description: "Deprecate `deploymentStrategy.type`, which will be set to `Recreate`"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/images: |
- name: sonarqube
Expand Down
74 changes: 37 additions & 37 deletions charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,29 +234,29 @@ 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`). Please note that the default `community` value is deprecated. | `community` |
| `community.enabled` | Install SonarQube Community Build. When set to `true`, this parameter replaces `edition=community` | `true` |
| `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 | `` |
| `ingress-nginx.enabled` | Install Nginx Ingress Helm | `false` |
| 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. Setting the strategy type is deprecated and it will be hardcoded to `Recreate` | `{type: Recreate}` |
| `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. When set to `true`, this parameter replaces `edition=community` | `true` |
| `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 | `` |
| `ingress-nginx.enabled` | Install Nginx Ingress Helm | `false` |

### NetworkPolicies

Expand Down Expand Up @@ -436,20 +436,20 @@ The following table lists the configurable parameters of the SonarQube chart and

### SonarQube Specific

| Parameter | Description | Default |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------| ---------------- |
| `jvmOpts` | (DEPRECATED) Values to add to `SONAR_WEB_JAVAOPTS`. Please set directly `SONAR_WEB_JAVAOPTS` or `sonar.web.javaOpts` | `""` |
| `jvmCeOpts` | (DEPRECATED) Values to add to `SONAR_CE_JAVAOPTS`. Please set directly `SONAR_CE_JAVAOPTS` or `sonar.ce.javaOpts` | `""` |
| `sonarqubeFolder` | (DEPRECATED) Directory name of SonarQube, Due to 1-1 mapping between helm version and docker version, there is no need for configuration | `/opt/sonarqube` |
| `sonarProperties` | Custom `sonar.properties` key-value pairs (e.g., "sonarProperties.sonar.forceAuthentication=true") | `None` |
| `sonarSecretProperties` | Additional `sonar.properties` key-value pairs to load from a secret | `None` |
| `sonarSecretKey` | Name of existing secret used for settings encryption | `None` |
| `monitoringPasscode` | Value for sonar.web.systemPasscode needed for LivenessProbes (encoded to Base64 format) | `define_it` |
| `monitoringPasscodeSecretName` | Name of the secret where to load `monitoringPasscode` | `None` |
| `monitoringPasscodeSecretKey` | Key of an existing secret containing `monitoringPasscode` | `None` |
| `extraContainers` | Array of extra containers to run alongside the `sonarqube` container (aka. Sidecars) | `[]` |
| `extraVolumes` | Array of extra volumes to add to the SonarQube deployment | `[]` |
| `extraVolumeMounts` | Array of extra volume mounts to add to the SonarQube deployment | `[]` |
| Parameter | Description | Default |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `jvmOpts` | (DEPRECATED) Values to add to `SONAR_WEB_JAVAOPTS`. Please set directly `SONAR_WEB_JAVAOPTS` or `sonar.web.javaOpts` | `""` |
| `jvmCeOpts` | (DEPRECATED) Values to add to `SONAR_CE_JAVAOPTS`. Please set directly `SONAR_CE_JAVAOPTS` or `sonar.ce.javaOpts` | `""` |
| `sonarqubeFolder` | (DEPRECATED) Directory name of SonarQube, Due to 1-1 mapping between helm version and docker version, there is no need for configuration | `/opt/sonarqube` |
| `sonarProperties` | Custom `sonar.properties` key-value pairs (e.g., "sonarProperties.sonar.forceAuthentication=true") | `None` |
| `sonarSecretProperties` | Additional `sonar.properties` key-value pairs to load from a secret | `None` |
| `sonarSecretKey` | Name of existing secret used for settings encryption | `None` |
| `monitoringPasscode` | Value for sonar.web.systemPasscode needed for LivenessProbes (encoded to Base64 format) | `define_it` |
| `monitoringPasscodeSecretName` | Name of the secret where to load `monitoringPasscode` | `None` |
| `monitoringPasscodeSecretKey` | Key of an existing secret containing `monitoringPasscode` | `None` |
| `extraContainers` | Array of extra containers to run alongside the `sonarqube` container (aka. Sidecars) | `[]` |
| `extraVolumes` | Array of extra volumes to add to the SonarQube deployment | `[]` |
| `extraVolumeMounts` | Array of extra volume mounts to add to the SonarQube deployment | `[]` |

### Resources

Expand Down
3 changes: 3 additions & 0 deletions charts/sonarqube/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ WARNING: The embedded PostgreSQL is intended for evaluation only, it is DEPRECAT
WARNING: The ingress nginx controller dependency has been upgraded to a major version (4.x), please carefully read the changelogs at https://github.com/kubernetes/ingress-nginx/releases and refer to the documentation at https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/.
Please also visit https://artifacthub.io/packages/helm/sonarqube/sonarqube#production-use-case for more information.
{{- end }}
{{ if hasKey .Values.deploymentStrategy "type" }}
WARNING: Setting the deployment strategy type is deprecated and will be removed in a future release. It will be hard-coded to Recreate.
{{- end }}
14 changes: 12 additions & 2 deletions charts/sonarqube/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,22 @@
{
"type": "string",
"deprecated": true,
"$comment": "(DEPRECATED) This value will is no longer required and will be droped in future releases"
"$comment": "(DEPRECATED) This value will is no longer required and will be dropped in future releases"
},
"terminationGracePeriodSeconds": {
"type": "integer",
"deprecated": true,
"$comment": "(DEPRECATED) This value is not used in the templates"
},
"deploymentStrategy": {
"type": "object",
"properties": {
"type": {
"type": "string",
"deprecated": true,
"$comment": "(DEPRECATED) This will be removed in future releases and set to `Recreate`"
}
}
}
}
}
}
5 changes: 3 additions & 2 deletions charts/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ replicaCount: 1
# How many revisions to retain (Deployment ReplicaSets or StatefulSets)
revisionHistoryLimit: 10

# This will use the default deployment strategy unless it is overriden
deploymentStrategy: {}
# (DEPRECATED) This will use the default deployment strategy unless it is overridden
deploymentStrategy:
type: Recreate
# Uncomment this to scheduler pods on priority
# priorityClassName: "high-priority"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ spec:
release: deployment-values.yaml
app.kubernetes.io/name: deployment-values.yaml
app.kubernetes.io/version: "10.7.0-community"
strategy:
type: Recreate
template:
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ spec:
release: sonar-web-context-deployment-deprecated-values.yaml
app.kubernetes.io/name: sonar-web-context-deployment-deprecated-values.yaml
app.kubernetes.io/version: "10.7.0-community"
strategy:
type: Recreate
template:
metadata:
annotations:
Expand Down

0 comments on commit 3e07665

Please sign in to comment.