diff --git a/charts/gitea/Chart.yaml b/charts/gitea/Chart.yaml index 981cf929272716f547c304e370c1fc905fb3e2cb..f3a25c274e23265ae778d655cefdefa535fdcb59 100644 --- a/charts/gitea/Chart.yaml +++ b/charts/gitea/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: groundhog2k # This is the chart version -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. appVersion: "1.15.0" diff --git a/charts/gitea/README.md b/charts/gitea/README.md index 1a5f4bcaae1fd679d682d961ca220199da4a63ae..24a327a2c233c922cf4661d5866d27af762c9694 100644 --- a/charts/gitea/README.md +++ b/charts/gitea/README.md @@ -1,6 +1,6 @@ # Gitea -   +   A Helm chart for Gitea on Kubernetes @@ -112,13 +112,25 @@ $ helm uninstall my-release | Key | Type | Default | Description | |-----|------|---------|-------------| +| externalCache.enabled | bool | `false` | Enable external Redis cache | +| externalCache.host | string | `nil` | External Redis host and port (host:port) | | redis.enabled | bool | `false` | Enable Redis cache deployment (will disable external cache settings) | | redis.storage | string | `nil` | Redis storage settings | +**Hint:** When no cache configuration is enabled, then all cache settings have to be provided manually in the `gitea.config` section. See [Gitea Config Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) for description of all settings. + ## Database settings | Key | Type | Default | Description | |-----|------|---------|-------------| +| fallbackToSqlite | bool | `true` | Falls back to internal SQLite when no database is configured | +| externalDatabase.enabled | bool | `false` | Enable usage of external database | +| externalDatabase.type | string | `nil` | External database type ("mysql", "postgres" are supported) | +| externalDatabase.charset | string | `"utf8mb4"` | Database charset to use (only relevant for mysql/mariadb) | +| externalDatabase.host | string | `nil` | External database host | +| externalDatabase.name | string | `nil` | External database name | +| externalDatabase.user | string | `nil` | External database user name | +| externalDatabase.password | string | `nil` | External database user password | | mariadb.enabled | bool | `false` | Enable MariaDB deployment (will disable external database settings) | | mariadb.settings.arguments[0] | string | `"--character-set-server=utf8mb4"` | Enable MariaDB UTF8MB4 character set| | mariadb.settings.arguments[1] | string | `"--collation-server=utf8mb4_unicode_ci"` | Enable UTF8MB4 unicode | @@ -134,6 +146,8 @@ $ helm uninstall my-release | postgres.userDatabase.user | string | `nil` | PostgreSQL Gitea database user | | postgres.userDatabase.password | string | `nil` | PostgreSQL Gitea database user password | +**Hint:** When no database configuration is enabled and fallbackToSqlite is set `false`, then all database settings have to be provided manually in the `gitea.config` section. See [Gitea Config Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) for description of all settings. + ## Gitea parameters | Key | Type | Default | Description | @@ -142,7 +156,7 @@ $ helm uninstall my-release | settings.defaultAdmin.name | string | `root` | Gitea administrator user | | settings.defaultAdmin.password | string | `admin` | Gitea admin user password (Must be changed during first login) | | settings.defaultAdmin.email | string | `root@admin.local` | Gitea administrator users email | -| gitea.config | object | `see values.yaml` | Gitea specific configuration as described in https://docs.gitea.io/en-us/config-cheat-sheet/ - More values and sections can be added | +| gitea.config | object | `see values.yaml` | Gitea specific configuration as described in the [Gitea Config Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) - More values and sections can be added | It's recommended to set the following Gitea configuration parameters: diff --git a/charts/gitea/templates/secureconfig.yaml b/charts/gitea/templates/secureconfig.yaml index e99640735d2af7e789ceec6afc1a7da6c88f10a8..9d68b2f465de7eea04facdb17f526c079a61cf18 100644 --- a/charts/gitea/templates/secureconfig.yaml +++ b/charts/gitea/templates/secureconfig.yaml @@ -41,15 +41,35 @@ stringData: {{- $_ := set .Values.gitea.config.database "USER" .Values.postgres.userDatabase.user -}} {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgres.userDatabase.password -}} {{- else }} + {{- if .Values.externalDatabase.enabled }} + {{- $_ := set .Values.gitea.config.database "SSL_MODE" "disable" -}} + {{- $_ := set .Values.gitea.config.database "DB_TYPE" .Values.externalDatabase.type -}} + {{- $_ := set .Values.gitea.config.database "CHARSET" .Values.externalDatabase.charset -}} + {{- $_ := set .Values.gitea.config.database "HOST" .Values.externalDatabase.host -}} + {{- $_ := set .Values.gitea.config.database "NAME" .Values.externalDatabase.name -}} + {{- $_ := set .Values.gitea.config.database "USER" .Values.externalDatabase.user -}} + {{- $_ := set .Values.gitea.config.database "PASSWD" .Values.externalDatabase.password -}} + {{- else }} + {{- if .Values.fallbackToSqlite }} {{- $_ := set .Values.gitea.config.database "DB_TYPE" "sqlite3" -}} {{- end }} {{- end }} + {{- end }} + {{- end }} {{- if .Values.redis.enabled }} {{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}} {{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}} {{- $_ := set .Values.gitea.config.cache "HOST" (printf "network=tcp,addr=%s:%s,db=0,pool_size=100,idle_timeout=180" (include "redis.servicename" .) (.Values.redis.service.serverPort | toString)) -}} {{- $_ := set .Values.gitea.config.session "PROVIDER" "redis" -}} {{- $_ := set .Values.gitea.config.session "PROVIDER_CONFIG" (printf "network=tcp,addr=%s:%s,db=0,pool_size=100,idle_timeout=180" (include "redis.servicename" .) (.Values.redis.service.serverPort | toString)) -}} + {{- else }} + {{- if .Values.externalCache.enabled }} + {{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}} + {{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}} + {{- $_ := set .Values.gitea.config.cache "HOST" (printf "network=tcp,addr=%s,db=0,pool_size=100,idle_timeout=180" (.Values.externalCache.host)) -}} + {{- $_ := set .Values.gitea.config.session "PROVIDER" "redis" -}} + {{- $_ := set .Values.gitea.config.session "PROVIDER_CONFIG" (printf "network=tcp,addr=%s,db=0,pool_size=100,idle_timeout=180" (.Values.externalCache.host)) -}} + {{- end }} {{- end }} {{- if not (hasKey .Values.gitea.config.server "ROOT_URL") -}} {{- if .Values.ingress.enabled -}} diff --git a/charts/gitea/values.yaml b/charts/gitea/values.yaml index bd1c746b3d0bbcac25e4bb4de6695c546327a0eb..8d15dcce7c26e3dda7279d2b3e1ec9af527a88e8 100644 --- a/charts/gitea/values.yaml +++ b/charts/gitea/values.yaml @@ -140,6 +140,40 @@ env: [] ## Arguments for the container entrypoint process args: [] +## Falls back to internal SQLite when no database is configured +fallbackToSqlite: true + +## External database settings (is used when mariadb.enabled is false and postgres.enabled is false) +externalDatabase: + ## Enable usage of external database (Default: disabled) + enabled: false + + ## Type of database ("mysql", "postgres" are supported) + type: + + ## Database charset to use (only relevant for mysql/mariadb) + charset: "utf8mb4" + + ## Name of the database + name: + + ## Database user + user: + + ## Database password + password: + + ## Database host (and optional port) + host: + +## External redis cache settings +externalCache: + ## Enable usage of redis as session storage and cache (Default: disabled) + enabled: false + + ## Redis host and port (host:port) + host: + ## Additional Gitea settings defined in this chart settings: ## Delay after installation before adminstrative user gets created (Database must be ready and connected)