[bitnami/*] Take 'global.postgresql' values into account (#9314)

This commit is contained in:
Juan Ariza Toledano
2022-03-07 13:49:09 +01:00
committed by GitHub
parent 42d2adcd31
commit dd428a0661
21 changed files with 199 additions and 510 deletions

View File

@@ -35,4 +35,4 @@ sources:
- https://github.com/bitnami/bitnami-docker-argo-workflow-controller
- https://github.com/bitnami/bitnami-docker-argo-workflow-exec
- https://argoproj.github.io/workflows/
version: 1.0.1
version: 1.0.2

View File

@@ -7,7 +7,7 @@ Argo Workflows is meant to orchestrate Kubernetes jobs in parallel. It uses DAG
[Overview of Argo Workflows](https://argoproj.github.io/workflows)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```console
@@ -449,11 +449,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### To 1.0.0
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/infrastructure/argo-workflows/administration/upgrade/).
## License
@@ -469,4 +465,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -38,7 +38,6 @@ Create a default fully qualified postgresql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "argo-workflows.postgresql.fullname" -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
@@ -47,7 +46,6 @@ Create a default fully qualified mysql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "argo-workflows.mysql.fullname" -}}
{{- $name := default "mysql" .Values.mysql.nameOverride -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "mysql" "chartValues" .Values.mysql "context" $) -}}
{{- end -}}
@@ -116,7 +114,15 @@ Return the proper database username
*/}}
{{- define "argo-workflows.controller.database.username" -}}
{{- if .Values.postgresql.enabled -}}
{{- .Values.postgresql.auth.username -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- end -}}
{{- if .Values.mysql.enabled -}}
{{- .Values.mysql.auth.username -}}
@@ -138,7 +144,19 @@ Return the proper database password secret
*/}}
{{- define "argo-workflows.controller.database.password.secret" -}}
{{- if .Values.postgresql.enabled -}}
{{- include "argo-workflows.postgresql.fullname" . -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "argo-workflows.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "argo-workflows.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "argo-workflows.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- end -}}
{{- if .Values.mysql.enabled -}}
{{- include "argo-workflows.mysql.fullname" . -}}

View File

@@ -26,4 +26,4 @@ name: jupyterhub
sources:
- https://github.com/bitnami/bitnami-docker-jupyterhub
- https://github.com/jupyterhub/jupyterhub
version: 1.0.1
version: 1.0.2

View File

@@ -7,7 +7,7 @@ JupyterHub brings the power of notebooks to groups of users. It gives users acce
[Overview of JupyterHub](https://jupyter.org/hub)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```console
@@ -520,15 +520,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
```bash
$ helm upgrade my-release bitnami/jupyterhub
```
### To 1.0.0
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/infrastructure/jupyterhub/administration/upgrade/).
## License
@@ -544,4 +536,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -59,9 +59,5 @@ APP VERSION: {{ .Chart.AppVersion }}
{{- $passwordValidationErrors = append $passwordValidationErrors $requiredHubPasswordError -}}
{{- end }}
{{- $postgresqlSecretName := include "jupyterhub.databaseSecretName" . -}}
{{- $postgresqlPasswordValidationErrors := include "common.validations.values.postgresql.passwords" (dict "secret" $postgresqlSecretName "subchart" true "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $postgresqlPasswordValidationErrors -}}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}
{{- include "jupyterhub.validateValues" . }}

View File

@@ -142,24 +142,29 @@ Create a default fully qualified postgresql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "jupyterhub.postgresql.fullname" -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
{{/*
Get the Postgresql credentials secret.
*/}}
{{- define "jupyterhub.databaseSecretName" -}}
{{- if and (.Values.postgresql.enabled) (not .Values.postgresql.existingSecret) -}}
{{- printf "%s" (include "jupyterhub.postgresql.fullname" .) -}}
{{- else if and (.Values.postgresql.enabled) (.Values.postgresql.existingSecret) -}}
{{- printf "%s" .Values.postgresql.existingSecret -}}
{{- else }}
{{- if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
{{- if .Values.postgresql.enabled }}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "jupyterhub.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "jupyterhub.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{ printf "%s-%s" .Release.Name "externaldb" }}
{{- default (include "jupyterhub.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (printf "%s-externaldb" .Release.Name) (tpl .Values.externalDatabase.existingSecret $) -}}
{{- end -}}
{{- end -}}

View File

@@ -26,4 +26,4 @@ name: keycloak
sources:
- https://github.com/bitnami/bitnami-docker-keycloak
- https://github.com/keycloak/keycloak
version: 7.0.2
version: 7.0.3

View File

@@ -2,12 +2,12 @@
# Keycloak packaged by Bitnami
Keycloak is a high performance Java-based identity and access management solution. It lets developers add an authentication layer to their applications with minimum effort.
Keycloak is a high performance Java-based identity and access management solution. It lets developers add an authentication layer to their applications with minimum effort.
[Overview of Keycloak](https://www.keycloak.org/)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```console
@@ -378,6 +378,7 @@ The chart also facilitates the creation of TLS secrets for use with the Ingress
### Use with ingress offloading SSL
If your ingress controller has the SSL Termination, you should set `proxyAddressForwarding` to `true` or you should add the following env vars in `extraEnvVars`
```yaml
- name: KEYCLOAK_PROXY_ADDRESS_FORWARDING
value: "true"
@@ -401,20 +402,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### To 6.0.0
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
### To 5.2.0
If you use `KUBE_PING` as discovery method you have to enable mounting of ServiceAccountTokens by setting `serviceAccount.automountServiceAccountToken` to `true`.
### To 1.0.0
[On November 13, 2020, Helm v2 support formally ended](https://github.com/helm/charts#status-of-the-project). This major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
[Learn more about this change and related upgrade considerations](https://docs.bitnami.com/kubernetes/apps/keycloak/administration/upgrade-helm3/).
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/apps/keycloak/administration/upgrade/).
## License
@@ -430,4 +418,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -63,16 +63,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "keycloak.postgresql.fullname" -}}
{{- if .Values.postgresql.fullnameOverride -}}
{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
{{/*
@@ -110,22 +101,14 @@ Return true if a configmap object should be created
Return the Database hostname
*/}}
{{- define "keycloak.databaseHost" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" (include "keycloak.postgresql.fullname" .) -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.host -}}
{{- end -}}
{{- ternary (include "keycloak.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}}
{{- end -}}
{{/*
Return the Database port
*/}}
{{- define "keycloak.databasePort" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "5432" | quote -}}
{{- else -}}
{{- .Values.externalDatabase.port | quote -}}
{{- end -}}
{{- ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled | quote -}}
{{- end -}}
{{/*
@@ -133,9 +116,17 @@ Return the Database database name
*/}}
{{- define "keycloak.databaseName" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.database -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.database .Values.postgresql.auth.database -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.database -}}
{{- .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
@@ -144,9 +135,17 @@ Return the Database user
*/}}
{{- define "keycloak.databaseUser" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.username -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.user -}}
{{- .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
@@ -155,17 +154,21 @@ Return the Database encrypted password
*/}}
{{- define "keycloak.databaseSecretName" -}}
{{- if .Values.postgresql.enabled }}
{{- if .Values.postgresql.auth.existingSecret -}}
{{- printf "%s" .Values.postgresql.auth.existingSecret -}}
{{- else }}
{{- printf "%s" (include "keycloak.postgresql.fullname" .) -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" (include "common.secrets.name" (dict "existingSecret" .Values.externalDatabase.existingSecret "context" $)) -}}
{{- else -}}
{{- printf "%s" (include "common.secrets.name" (dict "existingSecret" .Values.auth.existingSecret "context" $)) -}}
{{- end }}
{{- default (tpl .Values.auth.existingSecret $) (tpl .Values.externalDatabase.existingSecret $) -}}
{{- end -}}
{{- end -}}

View File

@@ -27,4 +27,4 @@ name: odoo
sources:
- https://github.com/bitnami/bitnami-docker-odoo
- https://www.odoo.com/
version: 21.0.0
version: 21.0.1

View File

@@ -7,7 +7,7 @@ Odoo is an open source ERP and CRM platform, formerly known as OpenERP, that can
[Overview of Odoo](https://www.odoo.com/)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```console
@@ -337,191 +337,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### 21.0.0
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
### 19.0.0
The [Bitnami Odoo](https://github.com/bitnami/bitnami-docker-odoo) image was refactored and now the source code is published in GitHub in the [`rootfs`](https://github.com/bitnami/bitnami-docker-odoo/tree/master/14/debian-10/rootfs) folder of the container image repository.
Upgrades from previous versions require to specify `--set volumePermissions.enabled=true` in order for all features to work properly:
```console
$ helm upgrade odoo bitnami/odoo \
--set odooPassword=$DISCOURSE_PASSWORD \
--set postgresql.auth.password=$POSTGRESQL_PASSWORD \
--set postgresql.persistence.existingClaim=$POSTGRESQL_PVC \
--set volumePermissions.enabled=true
```
Full compatibility is not guaranteed due to the amount of involved changes, however no breaking changes are expected aside from the ones mentioned above.
### To 17.0.0
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
**What changes were introduced in this major version?**
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
- Move dependency information from the *requirements.yaml* to the *Chart.yaml*
- After running `helm dependency update`, a *Chart.lock* file is generated containing the same structure used in the previous *requirements.lock*
- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
- This chart depends on the **PostgreSQL 10** instead of **PostgreSQL 9**. Apart from the same changes that are described in this section, there are also other major changes due to the master/slave nomenclature was replaced by primary/readReplica. [Here](https://github.com/bitnami/charts/pull/4385) you can find more information about the changes introduced
**Considerations when upgrading to this version**
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3
- If you want to upgrade to this version from a previous one installed with Helm v3, it should be done reusing the PVC used to hold the PostgreSQL data on your previous release. To do so, follow the instructions below (the following example assumes that the release name is `odoo`):
> NOTE: Please, create a backup of your database before running any of those actions.
##### Export secrets and required values to update
```console
$ export ODOO_PASSWORD=$(kubectl get secret --namespace default odoo -o jsonpath="{.data.odoo-password}" | base64 --decode)
$ export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace default odoo-postgresql -o jsonpath="{.data.password}" | base64 --decode)
$ export POSTGRESQL_PVC=$(kubectl get pvc -l app.kubernetes.io/instance=odoo,app.kubernetes.io/name=postgresql,role=master -o jsonpath="{.items[0].metadata.name}")
```
##### Delete statefulsets
Delete the Odoo deployment and delete the PostgreSQL statefulset. Notice the option `--cascade=false` in the latter:
```
$ kubectl delete statefulsets.apps --cascade=false odoo-postgresql
```
##### Upgrade the chart release
```console
$ helm upgrade odoo bitnami/odoo \
--set odooPassword=$ODOO_PASSWORD \
--set postgresql.auth.password=$POSTGRESQL_PASSWORD \
--set postgresql.persistence.existingClaim=$POSTGRESQL_PVC
```
##### Force new statefulset to create a new pod for postgresql
```console
$ kubectl delete pod odoo-postgresql-0
```
Finally, you should see the lines below in the PostgreSQL container logs:
```console
$ kubectl logs $(kubectl get pods -l app.kubernetes.io/instance=postgresql,app.kubernetes.io/name=postgresql,role=primary -o jsonpath="{.items[0].metadata.name}")
...
postgresql 08:05:12.59 INFO ==> Deploying PostgreSQL with persisted data...
...
```
**Useful links**
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
- https://helm.sh/docs/topics/v2_v3_migration/
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
### To 18.0.0
This version standardizes the way of defining Ingress rules. When configuring a single hostname for the Ingress rule, set the `ingress.hostname` value. When defining more than one, set the `ingress.extraHosts` array. Apart from this case, no issues are expected to appear when upgrading.
### To 16.0.0
In this version the application version itself was bumped to the new major, odoo 14, and the database schemas where changed. Please refer to the [upstream upgrade process documentation](https://www.odoo.com/documentation/14.0/webservices/upgrade.html) in order to upgrade from the previous version.
### To 15.0.0
This major version includes two main changes:
- Major change in the PostgreSQL subchart labeling. Check [PostgreSQL Upgrading Notes](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#900) for more information.
- Re-labeling so as to follow Helm label best practices (see [PR 3021](https://github.com/bitnami/charts/pull/3021))
- Adaptation to use common Bitnami chart standards. The following common elements have been included: extra volumes, extra volume mounts, common annotations and labels, pod annotations and labels, pod and container security contexts, affinity settings, node selectors, tolerations, init and sidecar containers, support for existing secrets, custom commands and arguments, extra env variables and custom liveness/readiness probes.
As a consequence, backwards compatibility from previous versions is not guaranteed during the upgrade. To upgrade to `9.0.0`, it should be done reusing the PVCs used to hold both the PostgreSQL and Odoo data on your previous release. To do so, follow the instructions below (the following example assumes that the release name is `odoo`):
> NOTE: Please, create a backup of your database before running any of those actions.
- Old version is up and running
```console
$ helm ls
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
odoo default 1 2020-10-21 13:11:29.028263 +0200 CEST deployed odoo-14.0.21 13.0.20201010
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
odoo-odoo-984f954b9-tk8t8 1/1 Running 0 16m
odoo-postgresql-0 1/1 Running 0 16m
```
- Export both database and Odoo credentials in order to provide them in the update
```console
$ export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace default odoo-postgresql -o jsonpath="{.data.password}" | base64 --decode)
$ export ODOO_PASSWORD=$(kubectl get secret --namespace default odoo-odoo -o jsonpath="{.data.odoo-password}" | base64 --decode)
```
- The upgrade to the latest (`15.X.X`) version is going to fail
```console
$ helm upgrade odoo bitnami/odoo --set odooPassword=$ODOO_PASSWORD --set postgresql.auth.password=$POSTGRESQL_PASSWORD
Error: UPGRADE FAILED: cannot patch "odoo-odoo" with kind Deployment: Deployment.apps "odoo-odoo" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"odoo", "app.kubernetes.io/name":"odoo"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
```
- Delete both the statefulset and recplicaset (PostgreSQL and Odoo respectively). Notice the option `--cascade=false` for the former.
```console
$ kubectl delete deployment.apps/odoo-odoo
deployment.apps "odoo-odoo" deleted
$ kubectl delete statefulset.apps/odoo-postgresql --cascade=false
statefulset.apps "odoo-postgresql" deleted
```
- Now the upgrade works
```console
$ helm upgrade odoo bitnami/odoo --set odooPassword=$ODOO_PASSWORD --set postgresql.auth.password=$POSTGRESQL_PASSWORD
$ helm ls
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
odoo default 3 v2020-10-21 13:35:27.255118 +0200 CEST deployed odoo-15.0.0 13.0.20201010
```
- You can kill the existing PostgreSQL pod and the new statefulset is going to create a new one
```console
$ kubectl delete pod odoo-postgresql-0
pod "odoo-postgresql-0" deleted
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
odoo-odoo-854b9cd5fb-282md 1/1 Running 0 9m12s
odoo-postgresql-0 1/1 Running 0 7m19s
```
Please, note that without the --cascade=false both objects (statefulset and pod) are going to be removed and both objects will be deployed again with the helm upgrade command
### To 12.0.0
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.
In https://github.com/helm/charts/pull/17352 the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.
This major version signifies this change.
### To 3.0.0
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is odoo:
```console
$ kubectl patch deployment odoo-odoo --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
$ kubectl patch deployment odoo-postgresql --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
```
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/apps/odoo/administration/upgrade/).
## Community supported solution
@@ -545,4 +361,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -19,7 +19,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "odoo.postgresql.fullname" -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
{{/*
@@ -54,22 +54,14 @@ Return the proper Storage Class
Return the Postgresql hostname
*/}}
{{- define "odoo.databaseHost" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" (include "odoo.postgresql.fullname" .) -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.host -}}
{{- end -}}
{{- ternary (include "odoo.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled | quote -}}
{{- end -}}
{{/*
Return the Postgresql port
*/}}
{{- define "odoo.databasePort" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "5432" | quote -}}
{{- else -}}
{{- .Values.externalDatabase.port | quote -}}
{{- end -}}
{{- ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled | quote -}}
{{- end -}}
{{/*
@@ -77,9 +69,17 @@ Return the Postgresql database name
*/}}
{{- define "odoo.databaseName" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.database -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.database .Values.postgresql.auth.database -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.database -}}
{{- .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
@@ -88,9 +88,17 @@ Return the Postgresql user
*/}}
{{- define "odoo.databaseUser" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.username -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.user -}}
{{- .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
@@ -99,15 +107,21 @@ Return the PostgreSQL Secret Name
*/}}
{{- define "odoo.databaseSecretName" -}}
{{- if .Values.postgresql.enabled }}
{{- if .Values.postgresql.auth.existingSecret }}
{{- printf "%s" .Values.postgresql.auth.existingSecret -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "odoo.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "odoo.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" (include "odoo.postgresql.fullname" .) -}}
{{- default (include "odoo.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else if .Values.externalDatabase.existingSecret }}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
{{- else -}}
{{- printf "%s-externaldb" (include "common.names.fullname" .) -}}
{{- default (printf "%s-externaldb" .Release.Name) (tpl .Values.externalDatabase.existingSecret $) -}}
{{- end -}}
{{- end -}}

View File

@@ -36,4 +36,4 @@ name: redmine
sources:
- https://github.com/bitnami/bitnami-docker-redmine
- https://www.redmine.org/
version: 18.0.2
version: 18.0.3

View File

@@ -7,7 +7,7 @@ Redmine is an open source management application. It includes a tracking issue s
[Overview of Redmine](http://www.redmine.org/)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```bash
@@ -540,173 +540,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### To 18.0.0
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
The `mariadb` sub-chart was also upgraded to `10.x.x`. No issues are expected during upgrades.
### To 17.0.0
In this version, the `image` block is defined once and is used in the different templates, while in the previous version, the `image` block was duplicated for the main container and the mail receiver one
```yaml
image:
registry: docker.io
repository: bitnami/redmine
tag: 4.2.2
```
VS
```yaml
image:
registry: docker.io
repository: bitnami/redmine
tag: 4.2.2
---
mailReceiver:
image:
registry: docker.io
repository: bitnami/redmine
tag: 4.2.2
```
See [PR#7114](https://github.com/bitnami/charts/pull/7114) for more info about the implemented changes
### To 16.0.0
The [Bitnami Redmine](https://github.com/bitnami/bitnami-docker-redmine) image was refactored and now the source code is published in GitHub in the [`rootfs`](https://github.com/bitnami/bitnami-docker-redmine/tree/master/4/debian-10/rootfs) folder of the container image repository.
Upgrades from previous versions require to specify `--set volumePermissions.enabled=true` in order for all features to work properly:
```console
$ helm upgrade example bitnami/redmine --set redminePassword=$REDMINE_PASSWORD --set mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD --set mariadb.auth.password=$MARIADB_PASSWORD --set volumePermissions.enabled=true
```
In addition, the `replicas` parameter was renamed to `replicaCount`.
Full compatibility is not guaranteed due to the amount of involved changes, however no breaking changes are expected aside from the ones mentioned above.
### To 15.0.0
[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version includes all the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL.
#### What changes were introduced in this major version?
- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field.
- Move dependency information from the _requirements.yaml_ to the _Chart.yaml_
- After running `helm dependency update`, a _Chart.lock_ file is generated containing the same structure used in the previous _requirements.lock_
- The different fields present in the _Chart.yaml_ file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts
- PostgreSQL dependency version was bumped to a new major version `10.X.X`, which includes changes that do no longer guarantee backwards compatibility. Check [PostgreSQL Upgrading Notes](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading) for more information.
- MariaDB dependency version was bumped to a new major version `9.X.X`, which includes changes that do no longer guarantee backwards compatibility. Check [MariaDB Upgrading Notes](https://github.com/bitnami/charts/tree/master/bitnami/mariadb#upgrading) for more information.
- Inclusion of the`bitnami/common` library chart, standardizations and adaptation of labels to follow helm's standards.
- `securityContext.*` is deprecated in favor of `podSecurityContext`, `containerSecurityContext`, `mailReceiver.podSecurityContext`, and `mailReceiver.containerSecurityContext`.
#### Considerations when upgrading to this version
- If you want to upgrade to this version from a previous one installed with Helm v3, please follow the instructions below.
- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore
- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3.
- This chart depends on the **PostgreSQL 10** instead of **PostgreSQL 8**. Apart from the changes that are described in this section, there are also other major changes due to the `master/slave` nomenclature was replaced by `primary/readReplica` or the standardization of Helm labels. For further details regarding the changes introduced, refer to [version 10 changes](https://github.com/bitnami/charts/pull/4385) or [version 9 changes](https://github.com/bitnami/charts/pull/3021) respectively.
As a consequence, backwards compatibility from previous versions is not guaranteed during the upgrade. To upgrade to this new version `15.0.0` there are two alternatives:
- Install a new Redmine chart and follow the [official guide on how to backup/restore](https://www.redmine.org/projects/redmine/wiki/RedmineBackupRestore).
- Reuse the PVC used to hold the PostgreSQL/MariaDB data on your previous release. To do so, follow the instructions below.
**Upgrade instructions**
> NOTE: The instructions suppose your DatabaseType is MariaDB. The process is analogous for PostgreSQL instances.
> WARNING: Please, make sure to create or have a backup of your database before running any of those actions.
1. Old version is up and running
```console
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
example-mariadb-0 1/1 Running 0 40s
example-redmine-9f8c7b54d-trns2 1/1 Running 0 72s
```
2. Export both MariaDB and Redmine credentials in order to provide them in the update
```console
$ export REDMINE_PASSWORD=$(kubectl get secret --namespace default example-redmine -o jsonpath="{.data.redmine-password}" | base64 --decode)
$ export MARIADB_ROOT_PASSWORD=$(kubectl get secret --namespace default example-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
$ export MARIADB_PASSWORD=$(kubectl get secret --namespace default example-mariadb -o jsonpath="{.data.mariadb-password}" | base64 --decode)
```
3. Delete the Redmine deployment and delete the MariaDB statefulset. Notice the option `--cascade=false` in the latter.
```console
$ kubectl delete deployment.apps/example-redmine
deployment.apps "example-redmine" deleted
$ kubectl delete statefulset.apps/example-mariadb --cascade=false
statefulset.apps "example-mariadb" deleted
```
4. Now the upgrade works
```console
$ helm upgrade example bitnami/redmine --set redminePassword=$REDMINE_PASSWORD --set mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD --set mariadb.auth.password=$MARIADB_PASSWORD
$ helm ls
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
example default 1 2020-10-29 20:33:17.776769 +0100 CET deployed redmine-15.0.0 4.1.1
```
5. You should kill the existing MariaDB pod now and the new statefulset is going to create a new one
```console
$ kubectl delete pod example-mariadb-0
pod "example-mariadb-0" deleted
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
example-mariadb-0 1/1 Running 0 19s
example-redmine-766c69d549-4zlgh 1/1 Running 2 2m26s
```
#### Useful links
- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/
- https://helm.sh/docs/topics/v2_v3_migration/
- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/
### To 14.0.0
- Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
- The `databaseType` parameters is no longer an object but a string. Allowed values are "mariadb" and "postgresql".
- Ingress configuration was standardized to simplify the way to configure the main host.
- Ports names were prefixed with the protocol to comply with Istio (see https://istio.io/docs/ops/deployment/requirements/).
### To 13.0.0
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.
In https://github.com/helm/charts/pull/17309 the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.
This major version signifies this change.
### To 5.0.0
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
Use the workaround below to upgrade from versions previous to 5.0.0. The following example assumes that the release name is redmine:
```console
$ kubectl patch deployment redmine-redmine --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
# If using postgresql as database
$ kubectl patch deployment redmine-postgresql --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
# If using mariadb as database
$ kubectl delete statefulset redmine-mariadb --cascade=false
```
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/apps/redmine/administration/upgrade/).
## Community supported solution
@@ -730,4 +564,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -76,10 +76,7 @@ You have 4 alternatives:
{{- $passwordValidationErrors = append $passwordValidationErrors $requiredRedminePasswordError -}}
{{- end -}}
{{- if eq .Values.databaseType "postgresql" }}
{{- $dbPasswordValidationErrors := include "common.validations.values.postgresql.passwords" (dict "secret" $dbSecretName "subchart" true "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $dbPasswordValidationErrors -}}
{{- else }}
{{- if eq .Values.databaseType "mariadb" }}
{{- $dbPasswordValidationErrors := include "common.validations.values.mariadb.passwords" (dict "secret" $dbSecretName "subchart" true "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $dbPasswordValidationErrors -}}
{{- end }}

View File

@@ -4,7 +4,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "redmine.mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "mariadb" "chartValues" .Values.mariadb "context" $) -}}
{{- end -}}
{{/*
@@ -12,7 +12,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "redmine.postgresql.fullname" -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
{{/*
@@ -125,7 +125,15 @@ Return the database name for Redmine
{{- if and (eq .Values.databaseType "mariadb") (.Values.mariadb.enabled) -}}
{{- .Values.mariadb.auth.database | quote }}
{{- else if and (eq .Values.databaseType "postgresql") (.Values.postgresql.enabled) -}}
{{- .Values.postgresql.auth.database | quote }}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.database .Values.postgresql.auth.database | quote -}}
{{- else -}}
{{- .Values.postgresql.auth.database | quote -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.database | quote -}}
{{- end -}}
{{- else }}
{{- .Values.externalDatabase.database | quote }}
{{- end -}}
@@ -138,7 +146,15 @@ Return the database username for Redmine
{{- if and (eq .Values.databaseType "mariadb") (.Values.mariadb.enabled) -}}
{{- .Values.mariadb.auth.username | quote }}
{{- else if and (eq .Values.databaseType "postgresql") (.Values.postgresql.enabled) -}}
{{- .Values.postgresql.auth.username | quote }}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username | quote -}}
{{- else -}}
{{- .Values.postgresql.auth.username | quote -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.username | quote -}}
{{- end -}}
{{- else }}
{{- .Values.externalDatabase.user | quote }}
{{- end -}}
@@ -155,10 +171,18 @@ Return the name of the database secret with its credentials
{{- printf "%s" (include "redmine.mariadb.fullname" .) -}}
{{- end -}}
{{- else if and (eq .Values.databaseType "postgresql") (.Values.postgresql.enabled) -}}
{{- if .Values.postgresql.auth.existingSecret -}}
{{- printf "%s" .Values.postgresql.auth.existingSecret -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "redmine.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "redmine.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" (include "redmine.postgresql.fullname" .) -}}
{{- default (include "redmine.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- if .Values.externalDatabase.existingSecret -}}

View File

@@ -28,4 +28,4 @@ name: sonarqube
sources:
- https://github.com/bitnami/bitnami-docker-sonarqube
- https://github.com/SonarSource/sonarqube
version: 1.0.0
version: 1.0.1

View File

@@ -7,7 +7,7 @@ SonarQube is an open source quality management platform that analyzes and measur
[Overview of SonarQube](http://www.sonarqube.org)
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
## TL;DR
```console
@@ -398,11 +398,7 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### To 1.0.0.
The `postgresql` sub-chart was upgraded to `11.x.x`. Several values of the sub-chart were changed, so please check the [upgrade notes](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/).
It will be necessary to migrate between PostgreSQL versions.
Refer to the [chart documentation for more information about how to upgrade from previous releases](https://docs.bitnami.com/kubernetes/apps/sonarqube/administration/upgrade/).
## License
@@ -418,4 +414,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@@ -94,8 +94,4 @@ You can access the JMX Prometheus metrics following the steps below:
{{- $requiredSonarQubePasswordError := include "common.validations.values.single.empty" $requiredSonarQubePassword -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $requiredSonarQubePasswordError -}}
{{- end }}
{{- if .Values.postgresql.enabled }}
{{- $dbSecretName := include "sonarqube.database.secretName" . -}}
{{- $dbPasswordValidationErrors := include "common.validations.values.postgresql.passwords" (dict "secret" $dbSecretName "subchart" true "context" $) -}}
{{- end }}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}

View File

@@ -49,29 +49,21 @@ Create a default fully qualified app name for PostgreSQL
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "sonarqube.postgresql.fullname" -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}}
{{- end -}}
{{/*
Return the Database Hostname
*/}}
{{- define "sonarqube.database.host" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" (include "sonarqube.postgresql.fullname" .) -}}
{{- else -}}
{{- .Values.externalDatabase.host -}}
{{- end -}}
{{- ternary (include "sonarqube.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled -}}
{{- end -}}
{{/*
Return the Database Port
*/}}
{{- define "sonarqube.database.port" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "5432" -}}
{{- else -}}
{{- .Values.externalDatabase.port -}}
{{- end -}}
{{- ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled -}}
{{- end -}}
{{/*
@@ -79,7 +71,15 @@ Return the Database Name
*/}}
{{- define "sonarqube.database.name" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.database -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.database .Values.postgresql.auth.database -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.database -}}
{{- end -}}
{{- else -}}
{{- .Values.externalDatabase.database -}}
{{- end -}}
@@ -90,7 +90,15 @@ Return the Database User
*/}}
{{- define "sonarqube.database.username" -}}
{{- if .Values.postgresql.enabled }}
{{- printf "%s" .Values.postgresql.auth.username -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- .Values.postgresql.auth.username -}}
{{- end -}}
{{- else -}}
{{- .Values.externalDatabase.user -}}
{{- end -}}
@@ -101,15 +109,21 @@ Return the Database Secret Name
*/}}
{{- define "sonarqube.database.secretName" -}}
{{- if .Values.postgresql.enabled }}
{{- if .Values.postgresql.auth.existingSecret -}}
{{- printf "%s" .Values.postgresql.auth.existingSecret -}}
{{- if .Values.global.postgresql }}
{{- if .Values.global.postgresql.auth }}
{{- if .Values.global.postgresql.auth.existingSecret }}
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
{{- else -}}
{{- default (include "sonarqube.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- default (include "sonarqube.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" (include "sonarqube.postgresql.fullname" .) -}}
{{- default (include "sonarqube.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
{{- end -}}
{{- else if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
{{- else -}}
{{- printf "%s-externaldb" (include "common.names.fullname" .) -}}
{{- default (printf "%s-externaldb" .Release.Name) (tpl .Values.externalDatabase.existingSecret $) -}}
{{- end -}}
{{- end -}}