mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
[dendrite] Fix postgresql init scripts for dendrite (#1368)
* fix(dendrite/postgresql): fix init scripts Init scripts for postgresql not are generated dynamically so the correct username is used. Additionally they are loaded from a configmap rather than injected into the values which did not work. Also refactored into separated file for easier maintenance. * docs(dendrite): Bump version and update changelog annotations * docs(dendrite): Generate README
This commit is contained in:
parent
50d0d5e7c8
commit
eee839e548
@ -3,7 +3,7 @@ apiVersion: v2
|
|||||||
appVersion: 0.5.1
|
appVersion: 0.5.1
|
||||||
description: Dendrite Matrix Homeserver
|
description: Dendrite Matrix Homeserver
|
||||||
name: dendrite
|
name: dendrite
|
||||||
version: 1.0.1
|
version: 1.0.2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- dendrite
|
- dendrite
|
||||||
@ -29,4 +29,8 @@ dependencies:
|
|||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/changes: |
|
artifacthub.io/changes: |
|
||||||
- kind: changed
|
- kind: changed
|
||||||
description: Upgraded `postgresql` chart dependency to version `10.14.4`.
|
description: Upgraded `postgresql` image version to "14.1.0"
|
||||||
|
- kind: fixed
|
||||||
|
description: "`initdbScripts` are now actually actually loaded"
|
||||||
|
- kind: added
|
||||||
|
description: "`postgresqlUsername` is used in `initdbScripts` rather than hardcoded value"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# dendrite
|
# dendrite
|
||||||
|
|
||||||
![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![AppVersion: 0.5.1](https://img.shields.io/badge/AppVersion-0.5.1-informational?style=flat-square)
|
![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![AppVersion: 0.5.1](https://img.shields.io/badge/AppVersion-0.5.1-informational?style=flat-square)
|
||||||
|
|
||||||
Dendrite Matrix Homeserver
|
Dendrite Matrix Homeserver
|
||||||
|
|
||||||
@ -109,6 +109,9 @@ N/A
|
|||||||
| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
|
| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
|
||||||
| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
|
| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
|
||||||
| postgresql.enabled | bool | See value.yaml | Enable and configure postgres as the database for dendrite. |
|
| postgresql.enabled | bool | See value.yaml | Enable and configure postgres as the database for dendrite. |
|
||||||
|
| postgresql.image.repository | string | `"bitnami/postgresql"` | |
|
||||||
|
| postgresql.image.tag | string | `"14.1.0"` | |
|
||||||
|
| postgresql.initdbScriptsConfigMap | string | `"dendrite-postgresql-init-scripts"` | |
|
||||||
| postgresql.persistence.enabled | bool | `false` | |
|
| postgresql.persistence.enabled | bool | `false` | |
|
||||||
| postgresql.postgresqlDatabase | string | `"dendrite"` | |
|
| postgresql.postgresqlDatabase | string | `"dendrite"` | |
|
||||||
| postgresql.postgresqlPassword | string | `"changeme"` | |
|
| postgresql.postgresqlPassword | string | `"changeme"` | |
|
||||||
@ -119,19 +122,19 @@ N/A
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
### Version 1.0.1
|
### Version 1.0.2
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|
||||||
N/A
|
* `postgresqlUsername` is used in `initdbScripts` rather than hardcoded value
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
* Upgraded `postgresql` chart dependency to version `10.14.4`.
|
* Upgraded `postgresql` image version to "14.1.0"
|
||||||
|
|
||||||
#### Fixed
|
#### Fixed
|
||||||
|
|
||||||
N/A
|
* `initdbScripts` are now actually actually loaded
|
||||||
|
|
||||||
### Older versions
|
### Older versions
|
||||||
|
|
||||||
|
@ -38,13 +38,5 @@ subPath:
|
|||||||
{{- $_ := set .Values.persistence "dendrite-key" (include "dendrite.keyVolume" . | fromYaml) -}}
|
{{- $_ := set .Values.persistence "dendrite-key" (include "dendrite.keyVolume" . | fromYaml) -}}
|
||||||
{{- $_ := set .Values.persistence "dendrite-config" (include "dendrite.configVolume" . | fromYaml) -}}
|
{{- $_ := set .Values.persistence "dendrite-config" (include "dendrite.configVolume" . | fromYaml) -}}
|
||||||
{{- $_ := set .Values.persistence "dendrite-tls" (include "dendrite.tlsVolume" . | fromYaml) -}}
|
{{- $_ := set .Values.persistence "dendrite-tls" (include "dendrite.tlsVolume" . | fromYaml) -}}
|
||||||
{{- define "postgresql.initdbScripts" -}}
|
|
||||||
create_db.sh: |
|
|
||||||
#!/bin/sh
|
|
||||||
for db in userapi_accounts userapi_devices mediaapi syncapi roomserver keyserver federationapi appservice naffka; do
|
|
||||||
createdb -U dendrite -O dendrite dendrite_$db
|
|
||||||
done
|
|
||||||
{{- end -}}
|
|
||||||
{{- $_ := set .Values.postgresql "initdbScripts" (include "postgresql.initdbScripts" . | fromYaml) -}}
|
|
||||||
|
|
||||||
{{ include "common.all" . }}
|
{{ include "common.all" . }}
|
||||||
|
14
charts/incubator/dendrite/templates/postgresql-initdb.yaml
Normal file
14
charts/incubator/dendrite/templates/postgresql-initdb.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{{- if .Values.postgresql.enabled }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: {{ .Values.postgresql.initdbScriptsConfigMap | quote }}
|
||||||
|
data:
|
||||||
|
create-db.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
for db in userapi_accounts userapi_devices mediaapi syncapi roomserver keyserver federationapi appservice naffka; do
|
||||||
|
createdb -U {{ .Values.postgresql.postgresqlUsername }} -O {{ .Values.postgresql.postgresqlUsername }} dendrite_$db
|
||||||
|
done
|
||||||
|
{{- end }}
|
@ -201,8 +201,12 @@ postgresql:
|
|||||||
# -- Enable and configure postgres as the database for dendrite.
|
# -- Enable and configure postgres as the database for dendrite.
|
||||||
# @default -- See value.yaml
|
# @default -- See value.yaml
|
||||||
enabled: false
|
enabled: false
|
||||||
|
image:
|
||||||
|
repository: bitnami/postgresql
|
||||||
|
tag: "14.1.0"
|
||||||
postgresqlUsername: dendrite
|
postgresqlUsername: dendrite
|
||||||
postgresqlPassword: changeme
|
postgresqlPassword: changeme
|
||||||
postgresqlDatabase: dendrite
|
postgresqlDatabase: dendrite
|
||||||
persistence:
|
persistence:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
initdbScriptsConfigMap: "dendrite-postgresql-init-scripts"
|
||||||
|
Loading…
Reference in New Issue
Block a user