Remove builtIn dependency values (#268)

⚠️ Breaking

Moved the values to enable the dependencies into the dependencies itself, this way we don't need a seperate field in the values and it is more obvious how to enable for example postgresql.

Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/268
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
luhahn 2021-12-22 23:41:35 +08:00
parent 7b0a1c7ae6
commit d97ea18626
4 changed files with 52 additions and 39 deletions

View File

@ -33,16 +33,16 @@ dependencies:
- name: memcached
repository: https://charts.bitnami.com/bitnami
version: 5.9.0
condition: gitea.cache.builtIn.enabled
condition: memcached.enabled
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 6.14.10
condition: gitea.database.builtIn.mysql.enabled
condition: mysql.enabled
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 10.3.17
condition: gitea.database.builtIn.postgresql.enabled
condition: postgresql.enabled
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 9.3.6
condition: gitea.database.builtIn.mariadb.enabled
condition: mariadb.enabled

View File

@ -42,6 +42,28 @@ helm install gitea gitea-charts/gitea
:warning: The most recent `5.0.0` update brings some major and breaking changes.
Please note the following changes in the Chart to upgrade successfully. :warning:
### Enable Dependencies
:warning: The values to enable the dependencies,
such as PostgreSQL, Memcached, MySQL and MariaDB
have been moved from `gitea.database.builtIn.` to the dependency values. :warning:
You can now enable the dependencies as followed:
```yaml
memcached:
enabled: true
postgresql:
enabled: true
mysql:
enabled: false
mariadb:
enabled: false
```
### App.ini generation
The app.ini generation has changed and now utilizes the environment-to-ini
@ -324,11 +346,6 @@ An external Database can be used instead of builtIn PostgreSQL or MySQL.
```yaml
gitea:
database:
builtIn:
postgresql:
enabled: false
config:
database:
DB_TYPE: mysql
@ -337,6 +354,9 @@ gitea:
USER: root
PASSWD: gitea
SCHEMA: gitea
postgresql:
enabled: false
```
### Ports and external url
@ -409,9 +429,7 @@ More about this issue [here](https://gitea.com/gitea/helm-chart/issues/161).
This helm chart can use a built in cache. The default is Memcached from bitnami.
```yaml
gitea:
cache:
builtIn:
memcached:
enabled: true
```
@ -782,8 +800,9 @@ enabled in the values. Complete Configuration can be taken from their website.
The following parameters are the defaults set by this chart
| Parameter | Description | Default |
| ------------------------ | -------------- | ------- |
| ------------------------ | --------------------------- | ------- |
| `memcached.service.port` | Memcached Port | 11211 |
| `memcached.enabled` | Enable Memcached dependency | `true` |
### MySQL BuiltIn
@ -800,6 +819,7 @@ The following parameters are the defaults set by this chart
| `mysql.db.name` | Name for new database to create. | `gitea` |
| `mysql.service.port` | Port to connect to MySQL service | `3306` |
| `mysql.persistence.size` | Persistence size for MySQL | `10Gi` |
| `mysql.enabled` | Enable MySQL dependency | `false` |
### PostgreSQL BuiltIn
@ -817,6 +837,7 @@ The following parameters are the defaults set by this chart
| `postgresql.global.postgresql.postgresqlPassword` | PostgreSQL admin password (overrides postgresqlPassword) | `gitea` |
| `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` |
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` |
| `postgresql.enabled` | Enable PostgreSQL dependency | `true` |
### MariaDB BuiltIn
@ -834,6 +855,7 @@ The following parameters are the defaults set by this chart
| `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` |
| `mariadb.enabled` | Enable MariaDB dependency | `false` |
## Local development & testing

View File

@ -64,11 +64,11 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "db.servicename" -}}
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
{{- if .Values.postgresql.enabled -}}
{{- printf "%s-postgresql" .Release.Name -}}
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
{{- else if .Values.mysql.enabled -}}
{{- printf "%s-mysql" .Release.Name -}}
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
{{- else if .Values.mariadb.enabled -}}
{{- printf "%s-mariadb" .Release.Name -}}
{{- else if ne .Values.gitea.config.database.DB_TYPE "sqlite3" -}}
{{- $parts := split ":" .Values.gitea.config.database.HOST -}}
@ -77,11 +77,11 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "db.port" -}}
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
{{- if .Values.postgresql.enabled -}}
{{ .Values.postgresql.global.postgresql.servicePort }}
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
{{- else if .Values.mysql.enabled -}}
{{ .Values.mysql.service.port }}
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
{{- else if .Values.mariadb.enabled -}}
{{ .Values.mariadb.primary.service.port }}
{{- else -}}
{{- end -}}
@ -222,7 +222,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}}
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}}
{{- end -}}
{{- if .Values.gitea.cache.builtIn.enabled -}}
{{- if .Values.memcached.enabled -}}
{{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}}
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "memcache" -}}
{{- if not (.Values.gitea.config.cache.HOST) -}}
@ -283,7 +283,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "gitea.inline_configuration.defaults.database" -}}
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
{{- if .Values.postgresql.enabled -}}
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
{{- if not (.Values.gitea.config.database.HOST) -}}
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
@ -291,7 +291,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- $_ := 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.gitea.database.builtIn.mysql.enabled -}}
{{- 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" .) -}}
@ -299,7 +299,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- $_ := 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.gitea.database.builtIn.mariadb.enabled -}}
{{- 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" .) -}}

View File

@ -213,19 +213,6 @@ gitea:
podAnnotations: {}
database:
builtIn:
postgresql:
enabled: true
mysql:
enabled: false
mariadb:
enabled: false
cache:
builtIn:
enabled: true
# Modify the liveness probe for your needs or completely disable it by commenting out.
livenessProbe:
tcpSocket:
@ -257,10 +244,12 @@ gitea:
# failureThreshold: 10
memcached:
enabled: true
service:
port: 11211
postgresql:
enabled: true
global:
postgresql:
postgresqlDatabase: gitea
@ -271,6 +260,7 @@ postgresql:
size: 10Gi
mysql:
enabled: false
root:
password: gitea
db:
@ -283,6 +273,7 @@ mysql:
size: 10Gi
mariadb:
enabled: false
auth:
database: gitea
username: gitea