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

Fix postgresql-isready image - adds postgresql.image.registry from values.yaml #471

Merged
merged 4 commits into from
Dec 15, 2023
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
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 4.5.5
version: 4.5.6
appVersion: 27.1.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
71 changes: 37 additions & 34 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,40 +209,43 @@ For convenience, we packages the following Bitnami charts for databases (feel fr
If you choose to use one of the prepackaged Bitnami helm charts, you must configure both the `externalDatabase` parameters, and the parameters for the chart you choose. For instance, if you choose to use the Bitnami PostgreSQL chart that we've prepackaged, you need to also configure all the parameters for `postgresql`. You do not need to use the Bitnami helm charts. If you want to use an already configured database that you have externally, just set `internalDatabase.enabled` to `false`, and configure the `externalDatabase` parameters below.


| Parameter | Description | Default |
|----------------------------------------------------------------------|----------------------------------------------------------------------------------------|-----------------|
| `internalDatabase.enabled` | Whether to use internal sqlite database | `true` |
| `internalDatabase.database` | Name of the existing database | `nextcloud` |
| `externalDatabase.enabled` | Whether to use external database | `false` |
| `externalDatabase.type` | External database type: `mysql`, `postgresql` | `mysql` |
| `externalDatabase.host` | Host of the external database in form of `host:port` | `nil` |
| `externalDatabase.database` | Name of the existing database | `nextcloud` |
| `externalDatabase.user` | Existing username in the external db | `nextcloud` |
| `externalDatabase.password` | Password for the above username | `nil` |
| `externalDatabase.existingSecret.enabled` | Whether to use a existing secret or not | `false` |
| `externalDatabase.existingSecret.secretName` | Name of the existing secret | `nil` |
| `externalDatabase.existingSecret.usernameKey` | Name of the key that contains the username | `nil` |
| `externalDatabase.existingSecret.passwordKey` | Name of the key that contains the password | `nil` |
| `externalDatabase.existingSecret.hostKey` | Name of the key that contains the database hostname or IP address | `nil` |
| `externalDatabase.existingSecret.databaseKey` | Name of the key that contains the database name | `nil` |
| `mariadb.enabled` | Whether to use the MariaDB chart | `false` |
| `mariadb.auth.database` | Database name to create | `nextcloud` |
| `mariadb.auth.username` | Database user to create | `nextcloud` |
| `mariadb.auth.password` | Password for the database | `changeme` |
| `mariadb.auth.rootPassword` | MariaDB admin password | `nil` |
| `mariadb.auth.existingSecret` | Use existing secret for MariaDB password details; see values.yaml for more detail | `''` |
| `mariadb.primary.persistence.enabled` | Whether or not to Use a PVC on MariaDB primary | `false` |
| `mariadb.primary.persistence.existingClaim` | Use an existing PVC for MariaDB primary | `nil` |
| `postgresql.enabled` | Whether to use the PostgreSQL chart | `false` |
| `postgresql.global.postgresql.auth.database` | Database name to create | `nextcloud` |
| `postgresql.global.postgresql.auth.username` | Database user to create | `nextcloud` |
| `postgresql.global.postgresql.auth.password` | Password for the database | `changeme` |
| `postgresql.global.postgresql.auth.existingSecret` | Name of existing secret to use for PostgreSQL credentials | `''` |
| `postgresql.global.postgresql.auth.secretKeys.adminPasswordKey` | Name of key in existing secret to use for PostgreSQL admin password | `''` |
| `postgresql.global.postgresql.auth.secretKeys.userPasswordKey` | Name of key in existing secret to use for PostgreSQL user password | `''` |
| `postgresql.global.postgresql.auth.secretKeys.replicationPasswordKey`| Name of key in existing secret to use for PostgreSQL replication password | `''` |
| `postgresql.primary.persistence.enabled` | Whether or not to use PVC on PostgreSQL primary | `false` |
| `postgresql.primary.persistence.existingClaim` | Use an existing PVC for PostgreSQL primary | `nil` |
| Parameter | Description | Default |
|----------------------------------------------------------------------|----------------------------------------------------------------------------------------|-----------------------|
| `internalDatabase.enabled` | Whether to use internal sqlite database | `true` |
| `internalDatabase.database` | Name of the existing database | `nextcloud` |
| `externalDatabase.enabled` | Whether to use external database | `false` |
| `externalDatabase.type` | External database type: `mysql`, `postgresql` | `mysql` |
| `externalDatabase.host` | Host of the external database in form of `host:port` | `nil` |
| `externalDatabase.database` | Name of the existing database | `nextcloud` |
| `externalDatabase.user` | Existing username in the external db | `nextcloud` |
| `externalDatabase.password` | Password for the above username | `nil` |
| `externalDatabase.existingSecret.enabled` | Whether to use a existing secret or not | `false` |
| `externalDatabase.existingSecret.secretName` | Name of the existing secret | `nil` |
| `externalDatabase.existingSecret.usernameKey` | Name of the key that contains the username | `nil` |
| `externalDatabase.existingSecret.passwordKey` | Name of the key that contains the password | `nil` |
| `externalDatabase.existingSecret.hostKey` | Name of the key that contains the database hostname or IP address | `nil` |
| `externalDatabase.existingSecret.databaseKey` | Name of the key that contains the database name | `nil` |
| `mariadb.enabled` | Whether to use the MariaDB chart | `false` |
| `mariadb.auth.database` | Database name to create | `nextcloud` |
| `mariadb.auth.username` | Database user to create | `nextcloud` |
| `mariadb.auth.password` | Password for the database | `changeme` |
| `mariadb.auth.rootPassword` | MariaDB admin password | `nil` |
| `mariadb.auth.existingSecret` | Use existing secret for MariaDB password details; see values.yaml for more detail | `''` |
| `mariadb.primary.persistence.enabled` | Whether or not to Use a PVC on MariaDB primary | `false` |
| `mariadb.primary.persistence.existingClaim` | Use an existing PVC for MariaDB primary | `nil` |
| `postgresql.enabled` | Whether to use the PostgreSQL chart | `false` |
| `postgresql.image.registry` | PostgreSQL image registry | `docker.io` |
| `postgresql.image.repository` | PostgreSQL image repository | `bitnami/postgresql` |
| `postgresql.image.tag` | PostgreSQL image tag | `15.4.0-debian-11-r10`|
| `postgresql.global.postgresql.auth.database` | Database name to create | `nextcloud` |
| `postgresql.global.postgresql.auth.username` | Database user to create | `nextcloud` |
| `postgresql.global.postgresql.auth.password` | Password for the database | `changeme` |
| `postgresql.global.postgresql.auth.existingSecret` | Name of existing secret to use for PostgreSQL credentials | `''` |
| `postgresql.global.postgresql.auth.secretKeys.adminPasswordKey` | Name of key in existing secret to use for PostgreSQL admin password | `''` |
| `postgresql.global.postgresql.auth.secretKeys.userPasswordKey` | Name of key in existing secret to use for PostgreSQL user password | `''` |
| `postgresql.global.postgresql.auth.secretKeys.replicationPasswordKey`| Name of key in existing secret to use for PostgreSQL replication password | `''` |
| `postgresql.primary.persistence.enabled` | Whether or not to use PVC on PostgreSQL primary | `false` |
| `postgresql.primary.persistence.existingClaim` | Use an existing PVC for PostgreSQL primary | `nil` |

Is there a missing parameter for one of the Bitnami helm charts listed above? Please feel free to submit a PR to add that parameter in our values.yaml, but be sure to also update this README file :)

Expand Down
2 changes: 1 addition & 1 deletion charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ spec:
- {{ printf "until mysql --host=%s-mariadb --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --execute=\"SELECT 1;\"; do echo waiting for mysql; sleep 2; done;" .Release.Name }}
{{- else if .Values.postgresql.enabled }}
- name: postgresql-isready
image: {{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
image: {{ .Values.postgresql.image.registry | default "docker.io" }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: {{ .Values.postgresql.image.registry | default "docker.io" }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
image: {{ template "postgresql.v1.image" .Subcharts.postgresql }}

We could also do this now that I think about it, which is less wordy. It templates this:

https://github.com/bitnami/charts/blob/0fa3d414009575ed81ff876fd883338afac1ee77/bitnami/postgresql/templates/_helpers.tpl#L44-L49

Which does all the fancy logic here:
https://github.com/bitnami/charts/blob/0fa3d414009575ed81ff876fd883338afac1ee77/bitnami/common/templates/_images.tpl#L6-L30

env:
- name: POSTGRES_USER
valueFrom:
Expand Down