From 0300c8a10eeced221709d8a5d87053dc8a230e66 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 25 Mar 2023 11:05:53 +0100 Subject: [PATCH 1/5] remove mysql and mariadb --- .markdownlint.yaml | 2 -- Chart.lock | 10 ++----- Chart.yaml | 8 ------ README.md | 59 ++++++++++-------------------------------- templates/_helpers.tpl | 25 ------------------ values.yaml | 44 ------------------------------- 6 files changed, 15 insertions(+), 133 deletions(-) diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 6320f35..1ca2b5b 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -131,8 +131,6 @@ MD044: names: - Gitea - PostgreSQL - - MariaDB - - MySQL - Memcached - Prometheus - Git diff --git a/Chart.lock b/Chart.lock index bf9e60f..0734462 100644 --- a/Chart.lock +++ b/Chart.lock @@ -2,14 +2,8 @@ dependencies: - name: memcached repository: oci://registry-1.docker.io/bitnamicharts version: 6.3.7 -- name: mysql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 6.14.10 - name: postgresql repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami version: 10.3.17 -- name: mariadb - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 9.3.6 -digest: sha256:eb786e862718ddd8c66d66b0a7d3501bd7fbb3c8edef12a406c9544159971965 -generated: "2023-02-26T13:51:59.1429398+01:00" +digest: sha256:64a01d4296ba5ab931fc1ca7d95f3fdf570cef1738432639a7a5278d87e5cca9 +generated: "2023-03-25T11:05:21.627487+01:00" diff --git a/Chart.yaml b/Chart.yaml index 4f0bc4c..784fd46 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -37,15 +37,7 @@ dependencies: repository: oci://registry-1.docker.io/bitnamicharts version: 6.3.7 condition: memcached.enabled -- name: mysql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 6.14.10 - condition: mysql.enabled - name: postgresql repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami version: 10.3.17 condition: postgresql.enabled -- name: mariadb - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 9.3.6 - condition: mariadb.enabled diff --git a/README.md b/README.md index 2c8d12c..6896ee4 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ Dependencies: - PostgreSQL ([configuration](#postgresql)) - Memcached ([configuration](#memcached)) -- MySQL ([configuration](#mysql)) -- MariaDB ([configuration](#mariadb)) ## Installing @@ -235,14 +233,18 @@ Priority (highest to lowest) for defining app.ini variables: ### External Database -An external Database can be used instead of builtIn PostgreSQL or MySQL. +Any external Database listed in [https://docs.gitea.io/en-us/database-prep/](https://docs.gitea.io/en-us/database-prep/) can be used instead of the built-in PostgreSQL. +In fact, it is **highly recommended** to use an external database to ensure a stable Gitea installation longterm. +The built-in dependency is mainly for testing and development purposes. + +If an external database is used, no matter which type, make sure to set `postgresql.enabled` to `false` to disable the use of the built-in PostgreSQL. ```yaml gitea: config: database: DB_TYPE: mysql - HOST: 127.0.0.1:3306 + HOST: NAME: gitea USER: root PASSWD: gitea @@ -368,7 +370,7 @@ persistence: existingClaim: MyAwesomeGiteaClaim ``` -In case that peristence has been disabled it will simply use an empty dir volume. +In case that persistence has been disabled it will simply use an empty dir volume. PostgreSQL handles the persistence in the exact same way. You can interact with the postgres settings as displayed in the following example: @@ -380,16 +382,6 @@ postgresql: existingClaim: MyAwesomeGiteaPostgresClaim ``` -MySQL also handles persistence the same, even though it is not deployed as a statefulset. -You can interact with the postgres settings as displayed in the following example: - -```yaml -mysql: - persistence: - enabled: true - existingClaim: MyAwesomeGiteaMysqlClaim -``` - ### Admin User This chart enables you to create a default admin user. It is also possible to @@ -790,30 +782,6 @@ gitea: | `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` | | `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` | -### MySQL - -| Name | Description | Value | -| ------------------------ | ------------------------------------------------------------------ | ------- | -| `mysql.enabled` | Enable MySQL | `false` | -| `mysql.root.password` | Password for the root user. Ignored if existing secret is provided | `gitea` | -| `mysql.db.user` | Username of new user to create. | `gitea` | -| `mysql.db.password` | Password for the new user.Ignored if existing secret is provided | `gitea` | -| `mysql.db.name` | Name for new database to create. | `gitea` | -| `mysql.service.port` | Port to connect to MySQL service | `3306` | -| `mysql.persistence.size` | PVC Storage Request for MySQL volume | `10Gi` | - -### MariaDB - -| Name | Description | Value | -| ---------------------------------- | ----------------------------------------------------------------- | ------- | -| `mariadb.enabled` | Enable MariaDB | `false` | -| `mariadb.auth.database` | Name of the database to create. | `gitea` | -| `mariadb.auth.username` | Username of the new user to create. | `gitea` | -| `mariadb.auth.password` | Password for the new user. Ignored if existing secret is provided | `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` | - ### Advanced | Name | Description | Value | @@ -834,6 +802,11 @@ See [CONTRIBUTORS GUIDE](CONTRIBUTING.md) for details. This section lists major and breaking changes of each Helm Chart version. Please read them carefully to upgrade successfully. +### To 8.0.0 + +In this version support for DB chart dependencies of MySQL and MariaDB have been removed to simplify the maintenance of the helm chart. +External MySQL and MariaDB databases are still supported and will be in the future. + ### To 7.0.0 #### Gitea 1.18.1 @@ -877,7 +850,7 @@ after the upgrade. #### Enable Dependencies The values to enable the dependencies, -such as PostgreSQL, Memcached, MySQL and MariaDB +such as PostgreSQL or Memcached. have been moved from `gitea.database.builtIn.` to the dependency values. You can now enable the dependencies as followed: @@ -888,12 +861,6 @@ memcached: postgresql: enabled: true - -mysql: - enabled: false - -mariadb: - enabled: false ``` #### App.ini generation diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 5bdcca9..c7a07b5 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -95,14 +95,6 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.servicePort -}} {{- end -}} -{{- define "mysql.dns" -}} -{{- printf "%s-mysql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "mariadb.dns" -}} -{{- printf "%s-mariadb.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}} -{{- end -}} - {{- define "memcached.dns" -}} {{- printf "%s-memcached.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -295,23 +287,6 @@ https {{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.postgresqlDatabase -}} {{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}} {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}} - {{- else if .Values.mysql.enabled -}} - {{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}} - {{- if not (.Values.gitea.config.database.HOST) -}} - {{- $_ := set .Values.gitea.config.database "HOST" (include "mysql.dns" .) -}} - {{- end -}} - {{- $_ := set .Values.gitea.config.database "NAME" .Values.mysql.db.name -}} - {{- $_ := set .Values.gitea.config.database "USER" .Values.mysql.db.user -}} - {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mysql.db.password -}} - {{- else if .Values.mariadb.enabled -}} - {{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}} - {{- 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.auth.database -}} - {{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.auth.username -}} - {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}} - {{- end -}} {{- end -}} {{- define "gitea.init-additional-mounts" -}} diff --git a/values.yaml b/values.yaml index b67508d..dc822c2 100644 --- a/values.yaml +++ b/values.yaml @@ -440,50 +440,6 @@ postgresql: persistence: size: 10Gi -## @section MySQL -# -## @param mysql.enabled Enable MySQL -## @param mysql.root.password Password for the root user. Ignored if existing secret is provided -## @param mysql.db.user Username of new user to create. -## @param mysql.db.password Password for the new user.Ignored if existing secret is provided -## @param mysql.db.name Name for new database to create. -## @param mysql.service.port Port to connect to MySQL service -## @param mysql.persistence.size PVC Storage Request for MySQL volume -mysql: - enabled: false - root: - password: gitea - db: - user: gitea - password: gitea - name: gitea - service: - port: 3306 - persistence: - size: 10Gi - -## @section MariaDB -# -## @param mariadb.enabled Enable MariaDB -## @param mariadb.auth.database Name of the database to create. -## @param mariadb.auth.username Username of the new user to create. -## @param mariadb.auth.password Password for the new user. Ignored if existing secret is provided -## @param mariadb.auth.rootPassword Password for the root user. -## @param mariadb.primary.service.port Port to connect to MariaDB service -## @param mariadb.primary.persistence.size Persistence size for MariaDB -mariadb: - enabled: false - auth: - database: gitea - username: gitea - password: gitea - rootPassword: gitea - primary: - service: - port: 3306 - persistence: - size: 10Gi - # By default, removed or moved settings that still remain in a user defined values.yaml will cause Helm to fail running the install/update. # Set it to false to skip this basic validation check. ## @section Advanced -- 2.40.1 From 24229e024d10677d8cf46f9432bc6a169ec7a108 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 25 Mar 2023 11:12:37 +0100 Subject: [PATCH 2/5] add missing {{- end -}} --- templates/_helpers.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index c7a07b5..1a60009 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -287,6 +287,7 @@ https {{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.postgresqlDatabase -}} {{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}} {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}} + {{- end -}} {{- end -}} {{- define "gitea.init-additional-mounts" -}} -- 2.40.1 From 3567f7c9f02c923532385504496cffca0d7599f5 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 27 Mar 2023 19:22:01 +0200 Subject: [PATCH 3/5] restore readme entries --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 573ad1c..e2a9796 100644 --- a/README.md +++ b/README.md @@ -880,7 +880,7 @@ after the upgrade. #### Enable Dependencies The values to enable the dependencies, -such as PostgreSQL or Memcached. +such as PostgreSQL, Memcached, MySQL and MariaDB. have been moved from `gitea.database.builtIn.` to the dependency values. You can now enable the dependencies as followed: @@ -891,6 +891,12 @@ memcached: postgresql: enabled: true + +mysql: + enabled: false + +mariadb: + enabled: false ``` #### App.ini generation -- 2.40.1 From b7c69f79cff75b1c1177cb2394153567997d2e51 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 27 Mar 2023 19:23:45 +0200 Subject: [PATCH 4/5] remove dev/testing sentence --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e2a9796..05dbeca 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,6 @@ Priority (highest to lowest) for defining app.ini variables: Any external Database listed in [https://docs.gitea.io/en-us/database-prep/](https://docs.gitea.io/en-us/database-prep/) can be used instead of the built-in PostgreSQL. In fact, it is **highly recommended** to use an external database to ensure a stable Gitea installation longterm. -The built-in dependency is mainly for testing and development purposes. If an external database is used, no matter which type, make sure to set `postgresql.enabled` to `false` to disable the use of the built-in PostgreSQL. -- 2.40.1 From a3ab735a37875eec579ceba55ee1c2e1d4d15b63 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 27 Mar 2023 19:27:28 +0200 Subject: [PATCH 5/5] lint --- README.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/README.md b/README.md index 05dbeca..ccc06b5 100644 --- a/README.md +++ b/README.md @@ -781,30 +781,6 @@ gitea: | `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`) | `5432` | | `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` | -### MySQL - -| Name | Description | Value | -| ------------------------ | ------------------------------------------------------------------ | ------- | -| `mysql.enabled` | Enable MySQL | `false` | -| `mysql.root.password` | Password for the root user. Ignored if existing secret is provided | `gitea` | -| `mysql.db.user` | Username of new user to create. | `gitea` | -| `mysql.db.password` | Password for the new user.Ignored if existing secret is provided | `gitea` | -| `mysql.db.name` | Name for new database to create. | `gitea` | -| `mysql.service.port` | Port to connect to MySQL service | `3306` | -| `mysql.persistence.size` | PVC Storage Request for MySQL volume | `10Gi` | - -### MariaDB - -| Name | Description | Value | -| ---------------------------------- | ----------------------------------------------------------------- | ------- | -| `mariadb.enabled` | Enable MariaDB | `false` | -| `mariadb.auth.database` | Name of the database to create. | `gitea` | -| `mariadb.auth.username` | Username of the new user to create. | `gitea` | -| `mariadb.auth.password` | Password for the new user. Ignored if existing secret is provided | `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` | - ### Advanced | Name | Description | Value | -- 2.40.1