From a4e5943ca530fd96659da6ba84e6f0db74c6bc26 Mon Sep 17 00:00:00 2001 From: schra Date: Thu, 22 Oct 2020 13:13:37 +0800 Subject: [PATCH] Upgrade mariadb Helm chart to 8.0.0 (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade mariadb Helm chart to 8.0.0 The names of the values changed in the new Helm chart, see [1]. Thus the Helm chart ships breaking changes and therefore bump the major version of this Chart.yaml (not sure if you use semver?) Furthermore, there is a bug [2] where not setting the root password results in the mariadb entering a CrashLoopBackOff when re-installing it. Thus set it (as done in the mysql values already). [1] https://github.com/bitnami/charts/commit/1206942b69c02a140a60e4e5ab59bf6d53d5b7e6 [2] https://github.com/bitnami/charts/issues/3884 Co-authored-by: Andre Schröder Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/48 Reviewed-by: Andrew Thornton Reviewed-by: luhahn Co-Authored-By: schra Co-Committed-By: schra --- Chart.yaml | 4 ++-- README.md | 11 ++++++----- templates/_helpers.tpl | 4 ++-- templates/gitea/config.yaml | 6 +++--- values.yaml | 13 +++++++------ 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 827fbc9..4f82a6c 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: gitea description: Gitea Helm chart for Kubernetes type: application -version: 1.5.5 +version: 2.0.0 appVersion: 1.12.5 icon: https://docs.gitea.io/images/gitea.png @@ -41,5 +41,5 @@ dependencies: condition: gitea.database.builtIn.postgresql.enabled - name: mariadb repository: https://charts.bitnami.com/bitnami - version: 7.10.2 + version: 8.0.0 condition: gitea.database.builtIn.mariadb.enabled diff --git a/README.md b/README.md index 9790e74..4d33673 100644 --- a/README.md +++ b/README.md @@ -336,8 +336,9 @@ The following parameters are the defaults set by this chart | Parameter | Description | Default | |---------------------|-----------------------------------|------------------------------| -|mariadb.db.user |Username of new user to create.|gitea| -|mariadb.db.password|Password for the new user. Ignored if existing secret is provided|gitea| -|mariadb.db.name|Name for new database to create.|gitea| -|mariadb.service.port|Port to connect to mariadb service|3306| -|mariadb.master.persistence.size|Persistence size for mysql |10Gi| +|mariadb.auth.username|Username of new user to create.|gitea| +|mariadb.auth.password|Password for the new user. Ignored if existing secret is provided|gitea| +|mariadb.auth.database|Name for new database to create.|gitea| +|mariadb.auth.rootPassword|Password for the root user.|gitea| +|mariadb.primary.service.port|Port to connect to mariadb service|3306| +|mariadb.primary.persistence.size|Persistence size for mariadb |10Gi| diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 910912d..01194dc 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -70,7 +70,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- else if .Values.gitea.database.builtIn.mysql.enabled -}} {{ .Values.mysql.service.port }} {{- else if .Values.gitea.database.builtIn.mariadb.enabled -}} -{{ .Values.mariadb.service.port }} +{{ .Values.mariadb.primary.service.port }} {{- else -}} {{- end -}} {{- end -}} @@ -84,7 +84,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} {{- define "mariadb.dns" -}} -{{- printf "%s-mariadb.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-mariadb.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "memcached.dns" -}} diff --git a/templates/gitea/config.yaml b/templates/gitea/config.yaml index d7f805b..33c47f9 100644 --- a/templates/gitea/config.yaml +++ b/templates/gitea/config.yaml @@ -88,9 +88,9 @@ stringData: {{- if not (.Values.gitea.config.database.HOST) -}} {{- $_ := set .Values.gitea.config.database "HOST" (include "mariadb.dns" .) -}} {{- end -}} - {{- $_ := set .Values.gitea.config.database "NAME" .Values.mariadb.db.name -}} - {{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.db.user -}} - {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.db.password -}} + {{- $_ := set .Values.gitea.config.database "NAME" .Values.mariadb.auth.database -}} + {{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.auth.username -}} + {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}} {{- end -}} {{- /* cache default settings */ -}} diff --git a/values.yaml b/values.yaml index 3e23c9c..237f449 100644 --- a/values.yaml +++ b/values.yaml @@ -140,12 +140,13 @@ mysql: size: 10Gi mariadb: - db: - name: gitea - user: gitea + auth: + database: gitea + username: gitea password: gitea - service: - port: 3306 - master: + rootPassword: gitea + primary: + service: + port: 3306 persistence: size: 10Gi \ No newline at end of file