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 - name: memcached
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 5.9.0 version: 5.9.0
condition: gitea.cache.builtIn.enabled condition: memcached.enabled
- name: mysql - name: mysql
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 6.14.10 version: 6.14.10
condition: gitea.database.builtIn.mysql.enabled condition: mysql.enabled
- name: postgresql - name: postgresql
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 10.3.17 version: 10.3.17
condition: gitea.database.builtIn.postgresql.enabled condition: postgresql.enabled
- name: mariadb - name: mariadb
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 9.3.6 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. :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: 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 ### App.ini generation
The app.ini generation has changed and now utilizes the environment-to-ini 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 ```yaml
gitea: gitea:
database:
builtIn:
postgresql:
enabled: false
config: config:
database: database:
DB_TYPE: mysql DB_TYPE: mysql
@ -337,6 +354,9 @@ gitea:
USER: root USER: root
PASSWD: gitea PASSWD: gitea
SCHEMA: gitea SCHEMA: gitea
postgresql:
enabled: false
``` ```
### Ports and external url ### 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. This helm chart can use a built in cache. The default is Memcached from bitnami.
```yaml ```yaml
gitea: memcached:
cache:
builtIn:
enabled: true 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 The following parameters are the defaults set by this chart
| Parameter | Description | Default | | Parameter | Description | Default |
| ------------------------ | -------------- | ------- | | ------------------------ | --------------------------- | ------- |
| `memcached.service.port` | Memcached Port | 11211 | | `memcached.service.port` | Memcached Port | 11211 |
| `memcached.enabled` | Enable Memcached dependency | `true` |
### MySQL BuiltIn ### 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.db.name` | Name for new database to create. | `gitea` |
| `mysql.service.port` | Port to connect to MySQL service | `3306` | | `mysql.service.port` | Port to connect to MySQL service | `3306` |
| `mysql.persistence.size` | Persistence size for MySQL | `10Gi` | | `mysql.persistence.size` | Persistence size for MySQL | `10Gi` |
| `mysql.enabled` | Enable MySQL dependency | `false` |
### PostgreSQL BuiltIn ### 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.postgresqlPassword` | PostgreSQL admin password (overrides postgresqlPassword) | `gitea` |
| `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` | | `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` |
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` | | `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` |
| `postgresql.enabled` | Enable PostgreSQL dependency | `true` |
### MariaDB BuiltIn ### 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.auth.rootPassword` | Password for the root user. | `gitea` |
| `mariadb.primary.service.port` | Port to connect to MariaDB service | `3306` | | `mariadb.primary.service.port` | Port to connect to MariaDB service | `3306` |
| `mariadb.primary.persistence.size` | Persistence size for MariaDB | `10Gi` | | `mariadb.primary.persistence.size` | Persistence size for MariaDB | `10Gi` |
| `mariadb.enabled` | Enable MariaDB dependency | `false` |
## Local development & testing ## Local development & testing

View File

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

View File

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