Compare commits

...

5 Commits

Author SHA1 Message Date
luhahn
ec8a26ecfc Update Gitea version to 1.13.5 (#134)
Co-authored-by: luhahn <lucas.hahn@novum-rgi.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/134
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: luhahn <luhahn@noreply.gitea.io>
Co-committed-by: luhahn <luhahn@noreply.gitea.io>
2021-03-22 21:01:33 +08:00
kaipmdh
8d8dd0d84e Update README.md for typo fixes and grammar (#131)
Minor changes to grammar, minor typo fixes.

Signed-off-by: kaipmdh <kaipmdh@noreply.gitea.io>

Co-authored-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/131
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Co-authored-by: kaipmdh <kaipmdh@noreply.gitea.io>
Co-committed-by: kaipmdh <kaipmdh@noreply.gitea.io>
2021-03-17 08:09:44 +08:00
Nakrez
0f1e991889 Add possibiliy to define statefulset labels (#130)
This change adds a new value *statefulset.labels* to allow the user to add custom labels to the StatefulSet.

An example of where this could be useful is if gitea's pvc is stored on OpenEBS. With this new option, the user can add the extra *openebs.io/sts-target-affinity* label to specify that the volume target pod should run on the same node as gitea's StatefulSet.

Co-authored-by: Baptiste Covolato <b.covolato@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/130
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Co-authored-by: Nakrez <nakrez@noreply.gitea.io>
Co-committed-by: Nakrez <nakrez@noreply.gitea.io>
2021-03-17 08:07:42 +08:00
Nakrez
1eb0eee3bc Make the chart work with a sqlite3 database (#124)
There are currently 2 issues that prevent using this chart to deploy gitea with a SQLite3 database.

1) The value from *gitea.config.database.HOST* is used to set *db.servicename* when  all the databases under *gitea.database.buildIn* are not enabled. This causes a type error during the template processing:
`Error: UPGRADE FAILED: template: gitea/templates/gitea/init.yaml:24:20: executing "gitea/templates/gitea/init.yaml" at <include "db.servicename" .>: error calling include: template: gitea/templates/_helpers.tpl:64:31: executing "db.servicename" at <.Values.gitea.config.database.HOST>: wrong type for value; expected string; got interface {}`

2) In *init_gitea.sh*, we use the value *db.servicename* and *db.port* to ping the database. If this database responds to ping, we proceed with the init. The problem here is that *db.port* is not set when all the databases under *gitea.database.buildIn* are disabled. In turn, this raises an error from busybox's *nc*, because no parameter is passed for *PORT*. This causes the init container to go in *CrashLoopBackOff* forever.

The simple fix that is proposed in this PR is to check wether or not *.Values.gitea.config.database.DB_TYPE* is set to determine the value *db.servicename*. If *DB_TYPE* is *'sqlite3'*, leave *db.servicename* empty and use that to bypass the database ping.

Co-authored-by: Baptiste Covolato <b.covolato@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/124
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Co-authored-by: Nakrez <nakrez@noreply.gitea.io>
Co-committed-by: Nakrez <nakrez@noreply.gitea.io>
2021-03-04 16:43:52 +08:00
luhahn
9106d68cdc Fix ServiceMonitor selector labels (#125)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/125
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Co-authored-by: luhahn <luhahn@noreply.gitea.io>
Co-committed-by: luhahn <luhahn@noreply.gitea.io>
2021-03-02 17:10:38 +08:00
7 changed files with 26 additions and 17 deletions

View File

@ -3,7 +3,7 @@ name: gitea
description: Gitea Helm chart for Kubernetes
type: application
version: 0.0.0
appVersion: 1.13.2
appVersion: 1.13.5
icon: https://docs.gitea.io/images/gitea.png
keywords:

View File

@ -5,12 +5,12 @@
## Introduction
This helm chart has taken some inspiration from <https://github.com/jfelten/gitea-helm-chart>
But takes a completly different approach in providing database and cache with dependencies.
Also this chart provides LDAP and admin user configuration with values as well as it is deployed as statefulset to retain stored repositories.
But takes a completely different approach in providing a database and cache with dependencies.
Additionally, this chart provides LDAP and admin user configuration with values, as well as being deployed as a statefulset to retain stored repositories.
## Dependencies
Gitea can be run with external database and cache. This chart provides those dependencies, which can be
Gitea can be run with an external database and cache. This chart provides those dependencies, which can be
enabled, or disabled via [configuration](#configuration).
Dependencies:
@ -36,7 +36,7 @@ Dependencies:
### Gitea Configuration
Gitea offers lots of configuration. This is fully described in the [Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
Gitea offers lots of configuration options. This is fully described in the [Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
```yaml
gitea:
@ -58,7 +58,7 @@ INSTALL_LOCK is always set to true, since we want to configure gitea with this h
#### 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:
If a builtIn database is enabled the database configuration is set automatically. For example, postgresql builtIn will appear in the app.ini as:
```ini
[database]
@ -71,7 +71,7 @@ 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:
Memcached is handled the exact same way as database builtIn. Once memcached builtIn is enabled, this chart will generate the following part in the app.ini:
```ini
[cache]
@ -140,7 +140,7 @@ By default port 3000 is used for web traffic and 22 for ssh. Those can be change
port: 22
```
This helmchart automatically configures the clone urls to use the correct ports. You can change these ports by hand using the gitea.config dict. However you should know what you're doing.
This helm chart automatically configures the clone urls to use the correct ports. You can change these ports by hand using the gitea.config dict. However you should know what you're doing.
### ClusterIP
@ -196,8 +196,8 @@ If the built in cache should not be used simply configure the cache in gitea.con
### Persistence
Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster
everything else will be taken care of. The following example will create a PVC as a part of the statefulset. This PVC will not be deleted
even if you uninstall the chart.
everything else will be taken care of. The following example will create a PVC as a part of the statefulset. This PVC will not be deleted even if you uninstall the chart.
When using Postgresql as dependency, this will also be deployed as a statefulset by default.
If you want to manage your own PVC you can simply pass the PVC name to the chart.
@ -246,7 +246,7 @@ You cannot use `admin` as username.
### LDAP Settings
Like the admin user the LDAP settings can be updated but also disabled or deleted.
Like the admin user the LDAP settings can be updated, but also disabled or deleted.
All LDAP values from <https://docs.gitea.io/en-us/command-line/#admin> are available.
You can either use them in camel case or kebab case.
@ -375,7 +375,7 @@ Annotations can be added to the Gitea pod.
| Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------|
|image.repository| Image to start for this pod | gitea/gitea |
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.13.2 |
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.13.5 |
|image.pullPolicy| Image pull policy | Always |
### Persistence
@ -472,7 +472,7 @@ The following parameters are the defaults set by this chart
### Postgresql BuiltIn
Postgresql is loaded as a dependency from bitnami. Configuration can be found from this [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/postgresql)
Postgresql is loaded as a dependency from Bitnami. The chart configuration can be found from this [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/postgresql) repository.
The following parameters are the defaults set by this chart

View File

@ -60,7 +60,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- printf "%s-mysql" .Release.Name -}}
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
{{- printf "%s-mariadb" .Release.Name -}}
{{- else -}}
{{- else if ne .Values.gitea.config.database.DB_TYPE "sqlite3" -}}
{{- $parts := split ":" .Values.gitea.config.database.HOST -}}
{{- printf "%s %s" $parts._0 $parts._1 -}}
{{- end -}}

View File

@ -21,7 +21,9 @@ stringData:
mkdir -p /data/gitea/conf
cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
chmod a+rwx /data/gitea/conf/app.ini
{{- if include "db.servicename" . }}
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
{{- end }}
su git -c ' \
set -x; \
gitea migrate; \

View File

@ -5,8 +5,8 @@ metadata:
name: {{ include "gitea.fullname" . }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
{{- if .Values.metrics.serviceMonitor.prometheusSelector }}
prometheus: {{ .Values.metrics.serviceMonitor.prometheusSelector }}
{{- if .Values.gitea.metrics.serviceMonitor.prometheusSelector }}
prometheus: {{ .Values.gitea.metrics.serviceMonitor.prometheusSelector }}
{{- end }}
spec:
selector:

View File

@ -9,6 +9,9 @@ spec:
selector:
matchLabels:
{{- include "gitea.selectorLabels" . | nindent 6 }}
{{- if .Values.statefulset.labels }}
{{- toYaml .Values.statefulset.labels | nindent 6 }}
{{- end }}
serviceName: {{ include "gitea.fullname" . }}
template:
metadata:
@ -21,6 +24,9 @@ spec:
{{- end }}
labels:
{{- include "gitea.labels" . | nindent 8 }}
{{- if .Values.statefulset.labels }}
{{- toYaml .Values.statefulset.labels | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:

View File

@ -8,7 +8,7 @@ clusterDomain: cluster.local
image:
repository: gitea/gitea
tag: 1.13.2
tag: 1.13.5
pullPolicy: Always
imagePullSecrets: []
@ -69,6 +69,7 @@ statefulset:
# - name: VARIABLE
# value: my-value
terminationGracePeriodSeconds: 60
labels: {}
persistence:
enabled: true