2020-08-23 17:56:55 +00:00
# Gitea Helm Chart
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
[Gitea ](https://gitea.io/en-us/ ) is a community managed lightweight code hosting
solution written in Go. It is published under the MIT license.
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
## Introduction
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
This helm chart has taken some inspiration from [jfelten's helm
chart](https://github.com/jfelten/gitea-helm-chart). 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.
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
## Dependencies
2021-11-05 12:06:48 +08:00
Gitea can be run with an external database and cache. This chart provides those
dependencies, which can be enabled, or disabled via
[configuration ](#configuration ).
2020-08-23 17:56:55 +00:00
Dependencies:
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
- PostgreSQL
- Memcached
- MySQL
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
## Installing
2020-12-21 06:53:45 +08:00
```sh
2021-11-05 12:06:48 +08:00
helm repo add gitea-charts https://dl.gitea.io/charts/
helm repo update
helm install gitea gitea-charts/gitea
2020-08-23 17:56:55 +00:00
```
2019-12-12 13:38:31 -05:00
## Prerequisites
2021-11-05 12:06:48 +08:00
- Kubernetes 1.12+
- Helm 3.0+
- PV provisioner for persistent data support
2019-12-12 13:38:31 -05:00
2021-11-20 05:15:45 +08:00
## Chart upgrade to 5.0.0
: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:
2021-12-22 23:41:35 +08:00
### 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
```
2021-11-20 05:15:45 +08:00
### App.ini generation
The app.ini generation has changed and now utilizes the environment-to-ini
script provided by newer Gitea versions.
2021-12-13 16:50:08 +08:00
> :boom: The Helm Chart now requires Gitea versions of at least 1.11.0.
2021-11-20 05:15:45 +08:00
This change ensures, that the app.ini is now persistent.
#### Secret Key generation
Gitea secret keys (SECRET_KEY, INTERNAL_TOKEN, JWT_SECRET) are now generated
automatically in certain situations:
- New install: By default the secrets are created automatically. If you provide
secrets via `gitea.config` they will be used instead of automatic generation.
- Existing installs: The secrets won't be deployed, neither via
configuration nor via auto generation. We explicitly prevent to set new secrets.
2021-12-13 16:50:08 +08:00
> :rotating_light: It would be possible to set new secret keys manually by entering
2021-11-20 05:15:45 +08:00
the running container and rewriting the app.ini by hand. However, this it is
not advisable to do so for existing installations. Certain settings like
_LDAP_ would not be readable anymore.
2021-12-13 16:50:08 +08:00
### Probes
> :boom: `gitea.customLivenessProbe`, `gitea.customReadinessProbe` and `gitea.customStartupProbe`
have been removed.
They are replaced by the settings `gitea.livenessProbe` , `gitea.readinessProbe`
and `gitea.startupProbe` which are now fully configurable and used _as-is_ for
a Chart deployment.
If you have customized their values instead of using the `custom` prefixed settings,
please ensure that you remove the `enabled` property from each of them.
In case you want to disable one of these probes, let's say the `livenessProbe` , add
the following to your values. The `podAnnotation` is just there to have a bit more
context.
```diff
gitea:
+ livenessProbe:
podAnnotations: {}
```
2021-12-23 21:43:21 +08:00
### Multiple OAuth and LDAP authentication sources
2021-12-20 22:43:55 +08:00
With `5.0.0` of this Chart it is now possible to configure Gitea with multiple
2021-12-23 21:43:21 +08:00
OAuth and LDAP sources. As a result, you need to update an existing OAuth/LDAP configuration
2021-12-20 22:43:55 +08:00
in your customized `values.yaml` by replacing the object with settings to a list
2021-12-23 21:43:21 +08:00
of settings objects. See [OAuth2 Settings ](#oauth-settings ) and
[LDAP Settings ](#ldap-settings ) section for details.
2021-12-20 22:43:55 +08:00
2021-07-13 01:33:38 +08:00
## Chart upgrade from 3.x.x to 4.0.0
2021-11-05 12:06:48 +08:00
:warning: The most recent `4.0.0` update brings some breaking changes. Please note
the following changes in the Chart to upgrade successfully. :warning:
2021-07-13 01:33:38 +08:00
### Ingress changes
2021-11-05 12:06:48 +08:00
To provide a more flexible Ingress configuration we now support not only host
settings but also provide configuration for the path and pathType. So this
change changes the hosts from a simple string list, to a list containing a more
complex object for more configuration.
2021-07-13 01:33:38 +08:00
```diff
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
- hosts:
- - git.example.com
+ hosts:
+ - host: git.example.com
+ paths:
+ - path: /
+ pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - git.example.com
```
2021-11-05 12:06:48 +08:00
If you want everything as it was before, you can simply add the following code
to all your host entries.
2021-07-13 01:33:38 +08:00
```yaml
paths:
- path: /
pathType: Prefix
```
### Dropped kebab-case support
2021-11-05 12:06:48 +08:00
In 3.x.x it was possible to provide an ldap configuration via kebab-case, this
support has now been dropped and only camel case is supported. See [LDAP
section](#ldap-settings) for more information.
2021-07-13 01:33:38 +08:00
### Dependency update
2021-11-05 12:06:48 +08:00
The chart comes with multiple databases and Memcached as dependency, the latest
release updated the dependencies.
2021-07-13 01:33:38 +08:00
2021-11-05 12:06:48 +08:00
- Memcached: `4.2.20` -> `5.9.0`
- PostgreSQL: `9.7.2` -> `10.3.17`
- MariaDB: `8.0.0` -> `9.3.6`
2021-07-13 01:33:38 +08:00
2021-11-05 12:06:48 +08:00
If you're using the builtin databases you will most likely redeploy the chart in
order to update the database correctly.
2021-07-13 01:33:38 +08:00
### Execution of initPreScript
2021-11-05 12:06:48 +08:00
Generally spoken, this might not be a breaking change, but it is worth to be
mentioned.
2021-09-28 03:52:37 +08:00
2021-11-05 12:06:48 +08:00
Prior to `4.0.0` only one init container was used to both setup directories and
configure Gitea. As of now the actual Gitea configuration is separated from the
other pre-execution. This also includes the execution of _initPreScript_ . If you
have such script, please be aware of this. Dynamically prepare the Gitea setup
during execution by e.g. adding environment variables to the execution context
won't work anymore.
2021-07-13 01:33:38 +08:00
2021-04-29 17:12:48 +08:00
## Gitea Version 1.14.X repository ROOT
2021-11-05 12:06:48 +08:00
Previously the ROOT folder for the Gitea repositories was located at
`/data/git/gitea-repositories` . In version `1.14` has the path been changed to
`/data/gitea-repositories` .
2021-04-29 17:12:48 +08:00
2021-11-05 12:06:48 +08:00
This chart will set the `gitea.config.repository.ROOT` value default to
`/data/git/gitea-repositories` .
2021-04-29 17:12:48 +08:00
2021-06-30 03:23:32 +08:00
## Configure Commit Signing
2021-11-05 12:06:48 +08:00
When using the rootless image the gpg key folder was is not persistent by
default. If you consider using signed commits for internal Gitea activities
(e.g. initial commit), you'd need to provide a signing key. Prior to
[PR186 ](https://gitea.com/gitea/helm-chart/pulls/186 ), imported keys had to be
re-imported once the container got replaced by another.
2021-09-28 03:52:37 +08:00
2021-11-05 12:06:48 +08:00
The mentioned PR introduced a new configuration object `signing` allowing you to
configure prerequisites for commit signing. By default this section is disabled
to maintain backwards compatibility.
2021-06-30 03:23:32 +08:00
```yaml
2021-11-05 12:06:48 +08:00
signing:
enabled: false
gpgHome: /data/git/.gnupg
2021-06-30 03:23:32 +08:00
```
2020-08-23 17:56:55 +00:00
## Examples
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Gitea Configuration
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
Gitea offers lots of configuration options. This is fully described in the
[Gitea Cheat Sheet ](https://docs.gitea.io/en-us/config-cheat-sheet/ ).
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
```yaml
2021-11-05 12:06:48 +08:00
gitea:
config:
APP_NAME: "Gitea: With a cup of tea."
repository:
ROOT: "~/gitea-repositories"
repository.pull-request:
WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:"
2019-12-12 13:38:31 -05:00
```
2020-10-06 09:03:20 +00:00
### Default Configuration
2021-11-05 12:06:48 +08:00
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` .
2020-10-06 09:03:20 +00:00
2021-11-05 12:06:48 +08:00
INSTALL_LOCK is always set to true, since we want to configure Gitea with this
helm chart and everything is taken care of.
2020-10-06 09:03:20 +00:00
2022-02-10 23:44:41 +08:00
_All default settings are made directly in the generated app.ini, not in the Values._
2020-10-06 09:03:20 +00:00
#### Database defaults
2021-11-05 12:06:48 +08:00
If a builtIn database is enabled the database configuration is set
automatically. For example, PostgreSQL builtIn will appear in the app.ini as:
2020-10-06 09:03:20 +00:00
2020-12-21 06:53:45 +08:00
```ini
2020-10-06 09:03:20 +00:00
[database]
DB_TYPE = postgres
HOST = RELEASE-NAME-postgresql.default.svc.cluster.local:5432
NAME = gitea
PASSWD = gitea
USER = gitea
```
#### Memcached defaults
2021-11-05 12:06:48 +08:00
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` :
2020-10-06 09:03:20 +00:00
2020-12-21 06:53:45 +08:00
```ini
2020-10-06 09:03:20 +00:00
[cache]
ADAPTER = memcache
ENABLED = true
HOST = RELEASE-NAME-memcached.default.svc.cluster.local:11211
```
#### Server defaults
2021-11-05 12:06:48 +08:00
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` .
2020-10-06 09:03:20 +00:00
2020-12-21 06:53:45 +08:00
```ini
2020-10-06 09:03:20 +00:00
[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
2021-01-21 23:45:26 +08:00
ENABLE_PPROF = false
```
#### Metrics defaults
The Prometheus `/metrics` endpoint is disabled by default.
```ini
[metrics]
ENABLED = false
2020-10-06 09:03:20 +00:00
```
2021-12-22 18:44:04 +08:00
### Additional _app.ini_ settings
> **The [generic](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default)
section cannot be defined that way.**
Some settings inside _app.ini_ (like passwords or whole authentication configurations)
must be considered sensitive and therefore should not be passed via plain text
inside the _values.yaml_ file. In times of _GitOps_ the values.yaml could be stored
in a Git repository where sensitive data should never be accessible.
The Helm Chart supports this approach and let the user define custom sources like
Kubernetes Secrets to be loaded as environment variables during _app.ini_ creation
or update.
```yaml
gitea:
additionalConfigSources:
- secret:
secretName: gitea-app-ini-oauth
- configMap:
name: gitea-app-ini-plaintext
```
This would mount the two additional volumes (`oauth` and `some-additionals` )
from different sources to the init containerwhere the _app.ini_ gets updated.
All files mounted that way will be read and converted to environment variables
and then added to the _app.ini_ using [environment-to-ini ](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini ).
The key of such additional source represents the section inside the _app.ini_ .
The value for each key can be multiline ini-like definitions.
In example, the referenced `gitea-app-ini-plaintext` could look like this.
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: gitea-app-ini-plaintext
data:
session: |
PROVIDER=memory
SAME_SITE=strict
cron.archive_cleanup: |
ENABLED=true
```
2022-02-14 16:00:47 +08:00
Or when using a Kubernetes secret, having the same data structure:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: gitea-security-related-configuration
type: Opaque
stringData:
security: |
PASSWORD_COMPLEXITY=off
session: |
SAME_SITE=strict
```
2022-03-09 14:47:55 +08:00
#### User defined environment variables in app.ini
Users are able to define their own environment variables,
which are loaded into the containers. We also support to
directly interact with the generated _app.ini_ .
To inject self defined variables into the _app.ini_ a
certain format needs to be honored. This is
described in detail on the [env-to-ini ](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini )
page.
Note that the Prefix on this helm chart is `ENV_TO_INI` .
For example a database setting needs to have the following
format:
```yaml
gitea:
additionalConfigFromEnvs:
- name: ENV_TO_INI__DATABASE__HOST
value: my.own.host
- name: ENV_TO_INI__DATABASE__PASSWD
valueFrom:
secretKeyRef:
name: postgres-secret
key: password
```
Priority (highest to lowest) for defining app.ini variables:
1. Environment variables prefixed with `ENV_TO_INI`
2. Additional config sources
3. Values defined in `gitea.config`
2020-09-03 21:27:11 +00:00
### External Database
2021-11-05 12:06:48 +08:00
An external Database can be used instead of builtIn PostgreSQL or MySQL.
2020-09-03 21:27:11 +00:00
```yaml
2021-11-05 12:06:48 +08:00
gitea:
config:
2020-09-03 21:27:11 +00:00
database:
2021-11-05 12:06:48 +08:00
DB_TYPE: mysql
HOST: 127.0.0.1:3306
NAME: gitea
USER: root
PASSWD: gitea
SCHEMA: gitea
2021-12-22 23:41:35 +08:00
postgresql:
enabled: false
2020-09-03 21:27:11 +00:00
```
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Ports and external url
2021-11-05 12:06:48 +08:00
By default port `3000` is used for web traffic and `22` for ssh. Those can be changed:
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
```yaml
2021-11-05 12:06:48 +08:00
service:
http:
port: 3000
ssh:
port: 22
2019-12-12 13:38:31 -05:00
```
2021-11-05 12:06:48 +08:00
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.
2020-08-23 17:56:55 +00:00
2020-12-16 20:37:47 +08:00
### ClusterIP
2021-11-05 12:06:48 +08:00
By default the clusterIP will be set to None, which is the default for headless
services. However if you want to omit the clusterIP field in the service, use
the following values:
2020-12-16 20:37:47 +08:00
```yaml
service:
http:
type: ClusterIP
port: 3000
clusterIP:
ssh:
type: ClusterIP
port: 22
clusterIP:
```
2020-12-10 17:16:13 +08:00
### SSH and Ingress
2022-03-26 02:28:39 +08:00
If you're using ingress and want to use SSH, keep in mind, that ingress is not
2021-11-05 12:06:48 +08:00
able to forward SSH Ports. You will need a LoadBalancer like `metallb` and a
setting in your ssh service annotations.
2020-12-10 17:16:13 +08:00
```yaml
service:
ssh:
annotations:
metallb.universe.tf/allow-shared-ip: test
```
2021-07-01 23:02:56 +08:00
### SSH on crio based kubernetes cluster
If you use crio as container runtime it is not possible to read from a remote
repository. You should get an error message like this:
```bash
$ git clone git@k8s-demo.internal:admin/test.git
Cloning into 'test'...
Connection reset by 192.168.179.217 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```
To solve this problem add the capability `SYS_CHROOT` to the `securityContext` .
More about this issue [here ](https://gitea.com/gitea/helm-chart/issues/161 ).
2020-08-23 17:56:55 +00:00
### Cache
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
This helm chart can use a built in cache. The default is Memcached from bitnami.
2019-12-12 13:38:31 -05:00
```yaml
2021-12-22 23:41:35 +08:00
memcached:
enabled: true
2019-12-12 13:38:31 -05:00
```
2021-11-05 12:06:48 +08:00
If the built in cache should not be used simply configure the cache in
`gitea.config` .
2019-12-12 13:38:31 -05:00
```yaml
2021-11-05 12:06:48 +08:00
gitea:
config:
cache:
ENABLED: true
ADAPTER: memory
INTERVAL: 60
HOST: 127.0.0.1:9090
2019-12-12 13:38:31 -05:00
```
2020-10-06 09:03:20 +00:00
2020-08-23 17:56:55 +00:00
### Persistence
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
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.
2021-03-17 08:09:44 +08:00
2021-11-05 12:06:48 +08:00
Please note, that an empty storageClass in the persistence will result in
kubernetes using your default storage class.
2021-06-08 01:53:01 +08:00
If you want to use your own storageClass define it as followed:
```yaml
persistence:
enabled: true
storageClass: myOwnStorageClass
```
2021-11-05 12:06:48 +08:00
When using PostgreSQL as dependency, this will also be deployed as a statefulset
by default.
2019-12-12 13:38:31 -05:00
2020-12-21 06:53:45 +08:00
If you want to manage your own PVC you can simply pass the PVC name to the chart.
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
```yaml
persistence:
enabled: true
existingClaim: MyAwesomeGiteaClaim
```
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
In case that peristence has been disabled it will simply use an empty dir volume.
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
PostgreSQL handles the persistence in the exact same way.
2020-08-23 17:56:55 +00:00
You can interact with the postgres settings as displayed in the following example:
2019-12-12 13:38:31 -05:00
```yaml
2020-08-23 17:56:55 +00:00
postgresql:
persistence:
enabled: true
existingClaim: MyAwesomeGiteaPostgresClaim
2019-12-12 13:38:31 -05:00
```
2021-11-05 12:06:48 +08:00
MySQL also handles persistence the same, even though it is not deployed as a statefulset.
2020-08-23 17:56:55 +00:00
You can interact with the postgres settings as displayed in the following example:
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
```yaml
mysql:
persistence:
enabled: true
existingClaim: MyAwesomeGiteaMysqlClaim
```
### Admin User
2021-11-05 12:06:48 +08:00
This chart enables you to create a default admin user. It is also possible to
update the password for this user by upgrading or redeloying the chart. It is
not possible to delete an admin user after it has been created. This has to be
done in the ui. You cannot use `admin` as username.
2019-12-12 13:38:31 -05:00
```yaml
2020-08-23 17:56:55 +00:00
gitea:
admin:
username: "MyAwesomeGiteaAdmin"
password: "AReallyAwesomeGiteaPassword"
email: "gi@tea.com"
2019-12-12 13:38:31 -05:00
```
2021-06-10 19:13:33 +08:00
You can also use an existing Secret to configure the admin user:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: gitea-admin-secret
type: Opaque
stringData:
username: MyAwesomeGiteaAdmin
password: AReallyAwesomeGiteaPassword
```
```yaml
gitea:
admin:
existingSecret: gitea-admin-secret
```
2020-08-23 17:56:55 +00:00
### LDAP Settings
2021-10-08 20:16:24 +08:00
Like the admin user the LDAP settings can be updated.
2020-12-21 06:53:45 +08:00
All LDAP values from < https: / / docs . gitea . io / en-us / command-line / # admin > are available.
2019-12-12 13:38:31 -05:00
2021-10-08 20:16:24 +08:00
Multiple LDAP sources can be configured with additional LDAP list items.
2019-12-12 13:38:31 -05:00
```yaml
2020-08-23 17:56:55 +00:00
gitea:
ldap:
2021-10-08 20:16:24 +08:00
- name: MyAwesomeGiteaLdap
securityProtocol: unencrypted
host: "127.0.0.1"
port: "389"
userSearchBase: ou=Users,dc=example,dc=com
userFilter: sAMAccountName=%s
adminFilter: CN=Admin,CN=Group,DC=example,DC=com
emailAttribute: mail
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
bindPassword: JustAnotherBindPw
usernameAttribute: CN
publicSSHKeyAttribute: publicSSHKey
2019-12-12 13:38:31 -05:00
```
2021-06-10 19:13:33 +08:00
You can also use an existing secret to set the bindDn and bindPassword:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: gitea-ldap-secret
type: Opaque
stringData:
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
bindPassword: JustAnotherBindPw
```
```yaml
gitea:
ldap:
2021-10-08 20:16:24 +08:00
- existingSecret: gitea-ldap-secret
...
2021-06-10 19:13:33 +08:00
```
2021-11-05 12:06:48 +08:00
:warning: Some options are just flags and therefore don't any values. If they
are defined in `gitea.ldap` configuration, they will be passed to the Gitea cli
without any value. Affected options:
2021-06-30 04:09:16 +08:00
2021-07-06 13:28:13 +08:00
- notActive
- skipTlsVerify
- allowDeactivateAll
- synchronizeUsers
- attributesInBind
2021-06-30 04:09:16 +08:00
2021-03-01 20:24:11 +08:00
### OAuth2 Settings
2021-11-05 12:06:48 +08:00
Like the admin user, OAuth2 settings can be updated and disabled but not
deleted. Deleting OAuth2 settings has to be done in the ui. All OAuth2 values,
which are documented [here ](https://docs.gitea.io/en-us/command-line/#admin ), are
available.
2021-03-01 20:24:11 +08:00
2021-12-20 22:43:55 +08:00
Multiple OAuth2 sources can be configured with additional OAuth list items.
2021-03-01 20:24:11 +08:00
```yaml
2021-11-05 12:06:48 +08:00
gitea:
oauth:
2021-12-20 22:43:55 +08:00
- name: 'MyAwesomeGiteaOAuth'
provider: 'openidConnect'
key: 'hello'
secret: 'world'
autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration'
#useCustomUrls:
#customAuthUrl:
#customTokenUrl:
#customProfileUrl:
#customEmailUrl:
```
You can also use an existing secret to set the `key` and `secret` :
```yaml
apiVersion: v1
kind: Secret
metadata:
name: gitea-oauth-secret
type: Opaque
stringData:
key: hello
secret: world
```
```yaml
gitea:
oauth:
- name: 'MyAwesomeGiteaOAuth'
existingSecret: gitea-oauth-secret
...
2021-03-01 20:24:11 +08:00
```
2021-01-21 23:45:26 +08:00
### Metrics and profiling
2021-11-05 12:06:48 +08:00
A Prometheus `/metrics` endpoint on the `HTTP_PORT` and `pprof` profiling
endpoints on port 6060 can be enabled under `gitea` . Beware that the metrics
endpoint is exposed via the ingress, manage access using ingress annotations for
example.
2021-01-21 23:45:26 +08:00
2021-11-05 12:06:48 +08:00
To deploy the `ServiceMonitor` , you first need to ensure that you have deployed
`prometheus-operator` and its
[CRDs ](https://github.com/prometheus-operator/prometheus-operator#customresourcedefinitions ).
2021-01-21 23:45:26 +08:00
```yaml
gitea:
metrics:
enabled: true
serviceMonitor:
enabled: true
config:
server:
2021-02-17 17:44:40 +08:00
ENABLE_PPROF: true
2021-01-21 23:45:26 +08:00
```
2020-09-24 16:32:11 +00:00
### Pod Annotations
Annotations can be added to the Gitea pod.
```yaml
2021-11-05 12:06:48 +08:00
gitea:
podAnnotations: {}
2020-09-24 16:32:11 +00:00
```
2020-08-23 17:56:55 +00:00
## Configuration
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Others
2019-12-12 13:38:31 -05:00
2021-11-20 05:15:45 +08:00
| Parameter | Description | Default |
| ------------------------------------------- | -------------------------------------------------------------------- | ------- |
2022-04-21 23:55:53 +08:00
| `statefulset.annotations` | Annotations for the Gitea StatefulSet to be created | `{}` |
2021-11-20 05:15:45 +08:00
| `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
| `statefulset.env` | Additional environment variables to pass to containers | `[]` |
| `extraVolumes` | Additional volumes to mount to the Gitea statefulset | `{}` |
| `extraVolumeMounts` | Additional volume mounts for the Gitea containers | `{}` |
| `initPreScript` | Bash script copied verbatim to start of init container | |
2021-12-18 19:10:48 +08:00
| `podSecurityContext.fsGroup` | Set the shared file system group for all containers | 1000 |
2021-12-20 19:58:44 +08:00
| `containerSecurityContext` | Run init and Gitea containers as a specific securityContext | `{}` |
2021-11-20 05:15:45 +08:00
| `schedulerName` | Use an alternate scheduler, e.g. "stork" | |
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Image
2019-12-12 13:38:31 -05:00
2022-03-01 22:55:44 +08:00
| 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 ) | see [Chart.AppVersion ](Chart.yaml ) |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.rootless` | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `false` |
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Persistence
2019-12-12 13:38:31 -05:00
2021-11-20 05:15:45 +08:00
| Parameter | Description | Default |
| --------------------------- | ---------------------------------------------------------- | ------- |
| `persistence.enabled` | Enable persistence for Gitea | `true` |
| `persistence.existingClaim` | Use an existing claim to store repository information | |
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
| `persistence.accessModes` | AccessMode for persistence | |
| `persistence.storageClass` | Storage class for repository persistence | |
2021-12-20 19:58:44 +08:00
| `persistence.subPath` | Subdirectory of the volume to mount at | |
2021-11-20 05:15:45 +08:00
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
| `persistence.annotations` | Annotations for the persistence volume claim to be created | `{}` |
2019-12-12 13:38:31 -05:00
2020-08-23 17:56:55 +00:00
### Ingress
2019-12-12 13:38:31 -05:00
2021-12-20 19:54:37 +08:00
| Parameter | Description | Default |
| ------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------- |
| `ingress.enabled` | enable ingress | `false` |
| `ingress.annotations` | add ingress annotations | |
| `ingress.hosts[0].host` | add hosts for ingress | `git.example.com` |
| `ingress.hosts[0].paths[0].path` | add path for each ingress host | `/` |
| `ingress.hosts[0].paths[0].pathType` | add ingress path type | `Prefix` |
| `ingress.tls` | add ingress tls settings | `[]` |
| `ingress.className` | add ingress class name. Only used in k8s 1.19+ | |
| `ingress.apiVersion` | specify APIVersion of ingress object. Mostly would only be used for argocd. | version indicated by helm's `Capabilities` object. |
2020-08-23 17:56:55 +00:00
### Service
2021-06-20 03:35:21 +08:00
#### Web
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
| `service.http.type` | Kubernetes service type for web traffic | `ClusterIP` |
| `service.http.port` | Port for web traffic | `3000` |
| `service.http.clusterIP` | ClusterIP setting for http autosetup for statefulset is None | `None` |
| `service.http.loadBalancerIP` | LoadBalancer Ip setting | |
| `service.http.nodePort` | NodePort for http service | |
| `service.http.externalTrafficPolicy` | If `service.http.type` is `NodePort` or `LoadBalancer` , set this to `Local` to enable source IP preservation | |
| `service.http.externalIPs` | http service external IP addresses | |
2022-04-25 19:56:25 +08:00
| `service.http.ipFamilyPolicy` | http service dual-stack policy | |
| `service.http.ipFamilies` | http service dual-stack familiy selection | |
2021-11-05 12:06:48 +08:00
| `service.http.loadBalancerSourceRanges` | Source range filter for http loadbalancer | `[]` |
| `service.http.annotations` | http service annotations | |
2021-06-08 01:53:01 +08:00
2022-04-25 19:56:25 +08:00
For dual-stack parameters see official kubernetes [dual-stack concept documentation ](https://kubernetes.io/docs/concepts/services-networking/dual-stack/ ).
2021-06-20 03:35:21 +08:00
#### SSH
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------- |
| `service.ssh.type` | Kubernetes service type for ssh traffic | `ClusterIP` |
| `service.ssh.port` | Port for ssh traffic | `22` |
| `service.ssh.loadBalancerIP` | LoadBalancer Ip setting | |
| `service.ssh.nodePort` | NodePort for ssh service | |
2022-02-25 17:18:57 +08:00
| `service.ssh.hostPort` | HostPort for ssh service | |
2021-11-05 12:06:48 +08:00
| `service.ssh.externalTrafficPolicy` | If `service.ssh.type` is `NodePort` or `LoadBalancer` , set this to `Local` to enable source IP preservation | |
| `service.ssh.externalIPs` | ssh service external IP addresses | |
2022-04-25 19:56:25 +08:00
| `service.ssh.ipFamilyPolicy` | ssh service dual-stack policy | |
| `service.ssh.ipFamilies` | ssh service dual-stack familiy selection | |
2021-11-05 12:06:48 +08:00
| `service.ssh.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` |
| `service.ssh.annotations` | ssh service annotations | |
2020-08-23 17:56:55 +00:00
2022-04-25 19:56:25 +08:00
For dual-stack parameters see official kubernetes [dual-stack concept documentation ](https://kubernetes.io/docs/concepts/services-networking/dual-stack/ ).
2020-08-23 17:56:55 +00:00
### Gitea Configuration
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| -------------- | ---------------------------------------------------------------------------------------------------- | ------- |
| `gitea.config` | Everything in `app.ini` can be configured with this dict. See [Examples ](#examples ) for more details | `{}` |
2020-08-23 17:56:55 +00:00
2021-03-01 22:46:05 +08:00
### Gitea Probes
2021-11-05 12:06:48 +08:00
Configure Liveness, Readiness and Startup
[Probes ](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ ).
2021-12-13 16:50:08 +08:00
#### Liveness probe
- Default status: Enabled
- Default action: tcp socket connect
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| ------------------------------------------ | -------------------------------------------------------------------- | ------- |
| `gitea.livenessProbe.initialDelaySeconds` | Delay before probe start | `200` |
| `gitea.livenessProbe.timeoutSeconds` | probe timeout | `1` |
| `gitea.livenessProbe.periodSeconds` | period between probes | `10` |
| `gitea.livenessProbe.successThreshold` | Minimum consecutive success probes | `1` |
| `gitea.livenessProbe.failureThreshold` | Minimum consecutive error probes | `10` |
2021-12-13 16:50:08 +08:00
#### Readiness probe
- Default status: Enabled
- Default action: tcp socket connect
| Parameter | Description | Default |
| ------------------------------------------ | -------------------------------------------------------------------- | ------- |
2021-11-05 12:06:48 +08:00
| `gitea.readinessProbe.initialDelaySeconds` | Delay before probe start | `5` |
| `gitea.readinessProbe.timeoutSeconds` | probe timeout | `1` |
| `gitea.readinessProbe.periodSeconds` | period between probes | `10` |
| `gitea.readinessProbe.successThreshold` | Minimum consecutive success probes | `1` |
| `gitea.readinessProbe.failureThreshold` | Minimum consecutive error probes | `3` |
2021-12-13 16:50:08 +08:00
#### Startup probe
- Default status: Disabled
- Default action: tcp socket connect
| Parameter | Description | Default |
| ------------------------------------------ | -------------------------------------------------------------------- | ------- |
2021-11-05 12:06:48 +08:00
| `gitea.startupProbe.initialDelaySeconds` | Delay before probe start | `60` |
| `gitea.startupProbe.timeoutSeconds` | probe timeout | `1` |
| `gitea.startupProbe.periodSeconds` | period between probes | `10` |
| `gitea.startupProbe.successThreshold` | Minimum consecutive success probes | `1` |
| `gitea.startupProbe.failureThreshold` | Minimum consecutive error probes | `10` |
2021-03-01 22:46:05 +08:00
2020-08-23 17:56:55 +00:00
### Memcached BuiltIn
2021-11-05 12:06:48 +08:00
Memcached is loaded as a dependency from
[Bitnami ](https://github.com/bitnami/charts/tree/master/bitnami/memcached ) if
enabled in the values. Complete Configuration can be taken from their website.
2020-08-23 17:56:55 +00:00
The following parameters are the defaults set by this chart
2021-12-22 23:41:35 +08:00
| Parameter | Description | Default |
| ------------------------ | --------------------------- | ------- |
| `memcached.service.port` | Memcached Port | 11211 |
| `memcached.enabled` | Enable Memcached dependency | `true` |
2020-08-23 17:56:55 +00:00
2021-11-05 12:06:48 +08:00
### MySQL BuiltIn
2020-08-23 17:56:55 +00:00
2021-11-05 12:06:48 +08:00
MySQL is loaded as a dependency from stable. Configuration can be found on this
[website ](https://github.com/helm/charts/tree/master/stable/mysql ).
2020-08-23 17:56:55 +00:00
The following parameters are the defaults set by this chart
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| ------------------------ | ------------------------------------------------------------------ | ------- |
| `mysql.root.password` | Password for the root user. Ignored if existing secret is provided | `gitea` |
| `mysql.db.user` | Username of new user to create. | `gitea` |
| `mysql.db.password` | Password for the new user. Ignored if existing secret is provided | `gitea` |
| `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` |
2021-12-22 23:41:35 +08:00
| `mysql.enabled` | Enable MySQL dependency | `false` |
2020-08-23 17:56:55 +00:00
2021-11-05 12:06:48 +08:00
### PostgreSQL BuiltIn
2020-08-23 17:56:55 +00:00
2021-11-05 12:06:48 +08:00
PostgreSQL is loaded as a dependency from Bitnami. The chart configuration can
be found in this
[Bitnami ](https://github.com/bitnami/charts/tree/master/bitnami/postgresql )
repository.
2020-08-23 17:56:55 +00:00
The following parameters are the defaults set by this chart
2019-12-12 13:38:31 -05:00
2021-11-05 12:06:48 +08:00
| Parameter | Description | Default |
| ------------------------------------------------- | -------------------------------------------------------- | ------- |
| `postgresql.global.postgresql.postgresqlDatabase` | PostgreSQL database (overrides postgresqlDatabase) | `gitea` |
| `postgresql.global.postgresql.postgresqlUsername` | PostgreSQL username (overrides postgresqlUsername) | `gitea` |
| `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` |
2021-12-22 23:41:35 +08:00
| `postgresql.enabled` | Enable PostgreSQL dependency | `true` |
2020-10-06 09:03:20 +00:00
### MariaDB BuiltIn
2021-11-05 12:06:48 +08:00
MariaDB is loaded as a dependency from bitnami. Configuration can be found in
this [Bitnami ](https://github.com/bitnami/charts/tree/master/bitnami/mariadb )
repository.
2020-10-06 09:03:20 +00:00
The following parameters are the defaults set by this chart
2021-11-05 12:06:48 +08:00
| 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` |
2021-12-22 23:41:35 +08:00
| `mariadb.enabled` | Enable MariaDB dependency | `false` |
2021-09-28 03:52:37 +08:00
## Local development & testing
2021-11-05 12:06:48 +08:00
For local development and testing of pull requests, the following workflow can
be used:
2021-09-28 03:52:37 +08:00
1. Install `minikube` and `helm` .
2. Start a `minikube` cluster via `minikube start` .
2021-11-05 12:06:48 +08:00
3. From the `gitea/helm-chart` directory execute the following command. This
will install the dependencies listed in `Chart.yml` and deploy the current
state of the helm chart found locally. If you want to test a branch, make
sure to switch to the respective branch first.
`helm install --dependency-update gitea . -f values.yaml` .
4. Gitea is now deployed in `minikube` . To access it, it's port needs to be
forwarded first from `minikube` to localhost first via `kubectl --namespace
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
[http://localhost:3000 ](http://localhost:3000 ).