Compare commits

...

8 Commits

Author SHA1 Message Date
a4e5943ca5 Upgrade mariadb Helm chart to 8.0.0 (#48)
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] 1206942b69
[2] https://github.com/bitnami/charts/issues/3884

Co-authored-by: Andre Schröder <andre.schroedr@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/48
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Co-Authored-By: schra <schra@noreply.gitea.io>
Co-Committed-By: schra <schra@noreply.gitea.io>
2020-10-22 13:13:37 +08:00
fc9c49179f Re-add lost commit: Enable LoadBalancer type service of http (#42) (#49)
Enable LoadBalancer type service of http (#42)

Enable LoadBalancer type service of http

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>

Co-authored-by: Martyn Ranyard <m@rtyn.berlin>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/42
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-Authored-By: iMartyn <imartyn@noreply.gitea.io>
Co-Committed-By: iMartyn <imartyn@noreply.gitea.io>

Co-authored-by: iMartyn <imartyn@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/49
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: schra <schra@noreply.gitea.io>
Co-Committed-By: schra <schra@noreply.gitea.io>
2020-10-21 20:38:01 +08:00
4c17cc839e Store gitea app data in PVC (#37)
Bump Chart version

Extend REAMDE

- add default handling explanation
- add MariaDB values

Add APP_DATA_PATH default to config

Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/37
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-10-06 09:03:20 +00:00
d1fac6ce7d Gitea 1.12.5 (#38)
Gitea 1.12.5

Co-authored-by: Matti R <matti@mdranta.net>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/38
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-10-02 14:06:19 +00:00
37bc343ca9 Use postgres v9.7.2 helm chart (#36)
Merge branch 'master' into postgres-version

Use postgres v9.7.2 helm chart

Co-authored-by: Matti R <matti@mdranta.net>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/36
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
2020-09-29 17:15:00 +00:00
b96da586db use alpine package version of helm (#35)
use alpine package version of helm

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/35
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.gitea.io>
2020-09-29 13:49:34 +00:00
0877cc81ca Update dependencies and add MariaDB builtIn (#33)
Update dependencies

- Update Postgres version from 8.6.4 to 9.7.3
- Update Mysql version from 6.14.8 to 6.14.10
- Add MariaDB as built in dependency

Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/33
Reviewed-by: Jonas Franz <jonasfranz@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-28 23:26:06 +00:00
4a618f245e Fix NodePort settings for ssh service (#32)
Fix NodePort settings for ssh service

Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/32
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-28 14:31:35 +00:00
8 changed files with 126 additions and 20 deletions

View File

@ -4,19 +4,19 @@ name: lint
platform: platform:
os: linux os: linux
arch: amd64 arch: arm64
steps: steps:
- name: lint - name: lint
pull: always pull: always
image: pelotech/drone-helm3 image: alpine:3.12
settings: commands:
helm_command: lint - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
chart: ./ - helm lint
- name: discord - name: discord
pull: always pull: always
image: appleboy/drone-discord:1.0.0 image: appleboy/drone-discord:1.2.4
environment: environment:
DISCORD_WEBHOOK_ID: DISCORD_WEBHOOK_ID:
from_secret: discord_webhook_id from_secret: discord_webhook_id
@ -44,8 +44,7 @@ steps:
pull: default pull: default
image: alpine:3.12 image: alpine:3.12
commands: commands:
- wget -q https://get.helm.sh/helm-v3.3.1-linux-arm64.tar.gz -O - | tar -xzO linux-arm64/helm > /usr/local/bin/helm - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- chmod +x /usr/local/bin/helm
- helm dependency update - helm dependency update
- helm package ./ - helm package ./
- mkdir gitea - mkdir gitea

View File

@ -2,8 +2,8 @@ apiVersion: v2
name: gitea name: gitea
description: Gitea Helm chart for Kubernetes description: Gitea Helm chart for Kubernetes
type: application type: application
version: 1.5.0 version: 2.0.0
appVersion: 1.12.4 appVersion: 1.12.5
icon: https://docs.gitea.io/images/gitea.png icon: https://docs.gitea.io/images/gitea.png
keywords: keywords:
@ -33,9 +33,13 @@ dependencies:
condition: gitea.cache.builtIn.enabled condition: gitea.cache.builtIn.enabled
- name: mysql - name: mysql
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 6.14.8 version: 6.14.10
condition: gitea.database.builtIn.mysql.enabled condition: gitea.database.builtIn.mysql.enabled
- name: postgresql - name: postgresql
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 8.6.4 version: 9.7.2
condition: gitea.database.builtIn.postgresql.enabled condition: gitea.database.builtIn.postgresql.enabled
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 8.0.0
condition: gitea.database.builtIn.mariadb.enabled

View File

@ -47,6 +47,56 @@ Gitea offers lots of configuration. This is fully described in the [Gitea Cheat
repository.pull-request: repository.pull-request:
WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:" WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:"
``` ```
### Default Configuration
This chart will set a few defaults in the gitea configuration based on the service and ingress settings. All defaults can be overwritten in gitea.config.
INSTALL_LOCK is always set to true, since we want to configure gitea with this helm chart and everything is taken care of.
*All default settings are made directly in the generated app.ini, not in the Values.*
#### Database defaults
If a builtIn database is enabled the database configuration is set automatically. For example postgresql builtIn which will appear in the app.ini as:
```
[database]
DB_TYPE = postgres
HOST = RELEASE-NAME-postgresql.default.svc.cluster.local:5432
NAME = gitea
PASSWD = gitea
USER = gitea
```
#### Memcached defaults
Memcached is handled the exakt same way as database builtIn. Once memcached builtIn is enabled, this chart will generate the following part in the app.ini:
```
[cache]
ADAPTER = memcache
ENABLED = true
HOST = RELEASE-NAME-memcached.default.svc.cluster.local:11211
```
#### Server defaults
The server defaults are a bit more complex.
If ingress is enabled, the ROOT_URL, DOMAIN and SSH_DOMAIN will be set accordingly. HTTP_PORT always defaults to 3000 as well as SSH_PORT to 22.
```
[server]
APP_DATA_PATH = /data
DOMAIN = git.example.com
HTTP_PORT = 3000
PROTOCOL = http
ROOT_URL = http://git.example.com
SSH_DOMAIN = git.example.com
SSH_LISTEN_PORT = 22
SSH_PORT = 22
```
### External Database ### External Database
An external Database can be used instead of builtIn postgresql or mysql. An external Database can be used instead of builtIn postgresql or mysql.
@ -104,6 +154,7 @@ If the built in cache should not be used simply configure the cache in gitea.con
INTERVAL: 60 INTERVAL: 60
HOST: 127.0.0.1:9090 HOST: 127.0.0.1:9090
``` ```
### Persistence ### Persistence
Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster
@ -193,7 +244,6 @@ Annotations can be added to the Gitea pod.
|statefulset.terminationGracePeriodSeconds| Image to start for this pod | gitea/gitea | |statefulset.terminationGracePeriodSeconds| Image to start for this pod | gitea/gitea |
|statefulset.env | Additional environment variables to pass to containers | [] | |statefulset.env | Additional environment variables to pass to containers | [] |
### Image ### Image
| Parameter | Description | Default | | Parameter | Description | Default |
@ -262,7 +312,7 @@ The following parameters are the defaults set by this chart
|mysql.mysqlPassword|Password for the new user. Ignored if existing secret is provided|gitea| |mysql.mysqlPassword|Password for the new user. Ignored if existing secret is provided|gitea|
|mysql.mysqlDatabase|Name for new database to create.|gitea| |mysql.mysqlDatabase|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|Persistence size for mysql |10Gi| |mysql.persistence.size|Persistence size for mysql |10Gi|
### Postgresql BuiltIn ### Postgresql BuiltIn
@ -277,3 +327,18 @@ 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|
### MariaDB BuiltIn
MariaDB is loaded as a dependency from bitnami. Configuration can be found from this [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/mariadb)
The following parameters are the defaults set by this chart
| Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------|
|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|

View File

@ -51,15 +51,13 @@ app.kubernetes.io/name: {{ include "gitea.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}} {{- end -}}
{{- define "postgresql.dns" -}}
{{- printf "%s-postgresql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.postgresql.global.postgresql.servicePort -}}
{{- end -}}
{{- define "db.servicename" -}} {{- define "db.servicename" -}}
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}} {{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
{{- printf "%s-postgresql" .Release.Name -}} {{- printf "%s-postgresql" .Release.Name -}}
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}} {{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
{{- printf "%s-mysql" .Release.Name -}} {{- printf "%s-mysql" .Release.Name -}}
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
{{- printf "%s-mariadb" .Release.Name -}}
{{- else -}} {{- else -}}
{{- $parts := split ":" .Values.gitea.config.database.HOST -}} {{- $parts := split ":" .Values.gitea.config.database.HOST -}}
{{- printf "%s %s" $parts._0 $parts._1 -}} {{- printf "%s %s" $parts._0 $parts._1 -}}
@ -71,14 +69,24 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{ .Values.postgresql.global.postgresql.servicePort }} {{ .Values.postgresql.global.postgresql.servicePort }}
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}} {{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
{{ .Values.mysql.service.port }} {{ .Values.mysql.service.port }}
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
{{ .Values.mariadb.primary.service.port }}
{{- else -}} {{- else -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- define "postgresql.dns" -}}
{{- printf "%s-postgresql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.postgresql.global.postgresql.servicePort -}}
{{- end -}}
{{- define "mysql.dns" -}} {{- define "mysql.dns" -}}
{{- printf "%s-mysql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}} {{- printf "%s-mysql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- define "mariadb.dns" -}}
{{- printf "%s-mariadb.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "memcached.dns" -}} {{- define "memcached.dns" -}}
{{- printf "%s-memcached.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}} {{- printf "%s-memcached.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}

View File

@ -62,6 +62,9 @@ stringData:
{{- if not (hasKey .Values.gitea.config.server "SSH_LISTEN_PORT") -}} {{- if not (hasKey .Values.gitea.config.server "SSH_LISTEN_PORT") -}}
{{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" .Values.gitea.config.server.SSH_PORT -}} {{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" .Values.gitea.config.server.SSH_PORT -}}
{{- end -}} {{- end -}}
{{- if not (hasKey .Values.gitea.config.server "APP_DATA_PATH") -}}
{{- $_ := set .Values.gitea.config.server "APP_DATA_PATH" "/data" -}}
{{- end -}}
{{- /* database default settings */ -}} {{- /* database default settings */ -}}
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}} {{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
@ -80,6 +83,14 @@ stringData:
{{- $_ := 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 -}}
{{- $_ := 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 -}}
{{- /* cache default settings */ -}} {{- /* cache default settings */ -}}

View File

@ -6,7 +6,12 @@ metadata:
{{- include "gitea.labels" . | nindent 4 }} {{- include "gitea.labels" . | nindent 4 }}
spec: spec:
type: {{ .Values.service.http.type }} type: {{ .Values.service.http.type }}
{{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
{{- end }}
{{ if eq .Values.service.http.type "ClusterIP" }}
clusterIP: None clusterIP: None
{{- end }}
ports: ports:
- name: http - name: http
port: {{ .Values.service.http.port }} port: {{ .Values.service.http.port }}

View File

@ -11,7 +11,7 @@ spec:
{{- if and .Values.service.ssh.loadBalancerIP (eq .Values.service.ssh.type "LoadBalancer") }} {{- if and .Values.service.ssh.loadBalancerIP (eq .Values.service.ssh.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.service.ssh.loadBalancerIP }} loadBalancerIP: {{ .Values.service.ssh.loadBalancerIP }}
{{- end }} {{- end }}
{{- if ne .Values.service.ssh.type "LoadBalancer" }} {{- if eq .Values.service.ssh.type "ClusterIP" }}
clusterIP: None clusterIP: None
{{- end }} {{- end }}
{{- if .Values.service.ssh.externalIPs }} {{- if .Values.service.ssh.externalIPs }}

View File

@ -6,7 +6,7 @@ replicaCount: 1
image: image:
repository: gitea/gitea repository: gitea/gitea
version: 1.12.4 version: 1.12.5
pullPolicy: Always pullPolicy: Always
imagePullSecrets: [] imagePullSecrets: []
@ -106,6 +106,8 @@ gitea:
enabled: true enabled: true
mysql: mysql:
enabled: false enabled: false
mariadb:
enabled: false
cache: cache:
builtIn: builtIn:
@ -136,3 +138,15 @@ mysql:
port: 3306 port: 3306
persistence: persistence:
size: 10Gi size: 10Gi
mariadb:
auth:
database: gitea
username: gitea
password: gitea
rootPassword: gitea
primary:
service:
port: 3306
persistence:
size: 10Gi