2023-01-03 16:47:23 +00:00
# Forgejo Helm Chart
2019-12-12 18:38:31 +00:00
2023-03-22 09:14:18 +00:00
[](https://ci.dachary.org/forgejo-contrib/forgejo-helm)
2023-01-03 16:47:23 +00:00
[Forgejo ](https://forgejo.org/ ) is a community managed lightweight code hosting
2021-11-05 04:06:48 +00:00
solution written in Go. It is published under the MIT license.
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
## Introduction
2019-12-12 18:38:31 +00:00
2023-01-03 22:04:26 +00:00
This helm chart is based on official [Gitea helm chart ](https://gitea.com/gitea/helm-chart ).
2023-04-19 15:01:03 +00:00
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 18:38:31 +00:00
2023-03-08 17:14:33 +00:00
## Update and versioning policy
2023-05-10 08:19:12 +00:00
The Forgejo helm chart versioning does not follow Forgejo's versioning.
2023-03-08 17:14:33 +00:00
The latest chart version can be looked up in [https://dl.gitea.com/charts ](https://dl.gitea.com/charts ) or in the [repository releases ](https://gitea.com/gitea/helm-chart/releases ).
2023-05-10 08:19:12 +00:00
The chart aims to follow Forgejo's releases closely.
There might be times when the chart is behind the latest Forgejo release.
2023-03-08 17:14:33 +00:00
This might be caused by different reasons, most often due to time constraints of the maintainers (remember, all work here is done voluntarily in the spare time of people).
2023-05-10 08:19:12 +00:00
If you're eager to use the latest Forgejo version earlier than this chart catches up, then change the tag in `values.yaml` to the latest Forgejo version.
Note that besides the exact Forgejo version one can also use the `:1` tag to automatically follow the latest Forgejo version.
2023-03-08 17:14:33 +00:00
This should be combined with `image.pullPolicy: "Always"` .
Important: Using the `:1` will also automatically jump to new minor release (e.g. from 1.13 to 1.14) which may eventually cause incompatibilities if major/breaking changes happened between these versions.
2023-05-10 08:19:12 +00:00
This is due to Forgejo not strictly following [semantic versioning ](https://semver.org/#summary ) as breaking changes do not increase the major version.
2023-03-08 17:14:33 +00:00
I.e., "minor" version bumps are considered "major".
Yet most often no issues will be encountered and the chart maintainers aim to communicate early/upfront if this would be the case.
2020-08-23 17:56:55 +00:00
## Dependencies
2023-05-10 08:19:12 +00:00
Forgejo can be run with an external database and cache.
2023-04-19 15:01:03 +00:00
This chart provides those dependencies, which can be enabled, or disabled via configuration.
2020-08-23 17:56:55 +00:00
Dependencies:
2019-12-12 18:38:31 +00:00
2022-07-15 17:27:48 +00:00
- PostgreSQL ([configuration](#postgresql))
- Memcached ([configuration](#memcached))
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
## Installing
2020-12-20 22:53:45 +00:00
```sh
2023-03-03 07:59:26 +00:00
helm install forgejo oci://codeberg.org/forgejo-contrib/forgejo
```
In case you want to supply values, you can reference a `values.yaml` file:
```sh
helm install forgejo -f values.yaml oci://codeberg.org/forgejo-contrib/forgejo
2020-08-23 17:56:55 +00:00
```
2019-12-12 18:38:31 +00:00
2023-04-19 15:01:03 +00:00
When upgrading, please refer to the [Upgrading ](#upgrading ) section at the bottom of this document for major and breaking changes.
2022-07-15 17:27:48 +00:00
2019-12-12 18:38:31 +00:00
## Prerequisites
2021-11-05 04:06:48 +00:00
- Kubernetes 1.12+
- Helm 3.0+
- PV provisioner for persistent data support
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
## Examples
2019-12-12 18:38:31 +00:00
2023-01-03 16:47:23 +00:00
### Forgejo Configuration
2019-12-12 18:38:31 +00:00
2023-05-10 08:19:12 +00:00
Forgejo offers lots of configuration options.
2023-04-19 15:01:03 +00:00
This is fully described in the [Gitea Cheat Sheet ](https://docs.gitea.io/en-us/config-cheat-sheet/ ).
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
```yaml
2021-11-05 04:06:48 +00:00
gitea:
config:
2023-01-03 16:47:23 +00:00
APP_NAME: 'Forgejo: With a cup of tea.'
2021-11-05 04:06:48 +00:00
repository:
2023-01-03 16:47:23 +00:00
ROOT: '~/gitea-repositories'
2021-11-05 04:06:48 +00:00
repository.pull-request:
2023-01-03 16:47:23 +00:00
WORK_IN_PROGRESS_PREFIXES: 'WIP:,[WIP]:'
2019-12-12 18:38:31 +00:00
```
2020-10-06 09:03:20 +00:00
### Default Configuration
2023-05-10 08:19:12 +00:00
This chart will set a few defaults in the Forgejo configuration based on the service and ingress settings.
2023-04-19 15:01:03 +00:00
All defaults can be overwritten in `gitea.config` .
2020-10-06 09:03:20 +00:00
2023-05-10 08:19:12 +00:00
INSTALL_LOCK is always set to true, since we want to configure Forgejo with this helm chart and everything is taken care of.
2020-10-06 09:03:20 +00:00
2022-02-10 15:44:41 +00: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
2023-04-19 15:01:03 +00: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-20 22:53:45 +00: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
2023-04-19 15:01:03 +00: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-20 22:53:45 +00: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
2023-04-19 15:01:03 +00: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-20 22:53:45 +00: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 15:45:26 +00: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 10:44:04 +00:00
### Additional _app.ini_ settings
> **The [generic](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default)
2023-01-03 16:47:23 +00:00
> section cannot be defined that way.**
2021-12-22 10:44:04 +00:00
2023-04-19 15:01:03 +00:00
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.
2021-12-22 10:44:04 +00:00
The Helm Chart supports this approach and let the user define custom sources like
2023-04-19 15:01:03 +00:00
Kubernetes Secrets to be loaded as environment variables during _app.ini_ creation or update.
2021-12-22 10:44:04 +00:00
```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.
2023-04-19 15:01:03 +00:00
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 ).
2021-12-22 10:44:04 +00:00
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 08:00:47 +00: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 06:47:55 +00:00
#### User defined environment variables in app.ini
2023-04-19 15:01:03 +00:00
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_ .
2022-03-09 06:47:55 +00:00
2023-04-19 15:01:03 +00:00
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.
2022-03-09 06:47:55 +00:00
Note that the Prefix on this helm chart is `ENV_TO_INI` .
2023-04-19 15:01:03 +00:00
For example a database setting needs to have the following format:
2022-03-09 06:47:55 +00:00
```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`
2023-04-19 15:01:03 +00:00
1. Additional config sources
1. Values defined in `gitea.config`
2022-03-09 06:47:55 +00:00
2020-09-03 21:27:11 +00:00
### External Database
2023-03-28 17:02:04 +00:00
Any external Database listed in [https://docs.gitea.io/en-us/database-prep/ ](https://docs.gitea.io/en-us/database-prep/ ) can be used instead of the built-in PostgreSQL.
2023-05-10 08:19:12 +00:00
In fact, it is **highly recommended** to use an external database to ensure a stable Forgejo installation longterm.
2023-03-28 17:02:04 +00:00
If an external database is used, no matter which type, make sure to set `postgresql.enabled` to `false` to disable the use of the built-in PostgreSQL.
2020-09-03 21:27:11 +00:00
```yaml
2021-11-05 04:06:48 +00:00
gitea:
config:
2020-09-03 21:27:11 +00:00
database:
2021-11-05 04:06:48 +00:00
DB_TYPE: mysql
2023-03-28 17:02:04 +00:00
HOST: < mysql HOST >
2021-11-05 04:06:48 +00:00
NAME: gitea
USER: root
PASSWD: gitea
SCHEMA: gitea
2021-12-22 15:41:35 +00:00
postgresql:
enabled: false
2020-09-03 21:27:11 +00:00
```
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
### Ports and external url
2023-04-19 15:01:03 +00:00
By default port `3000` is used for web traffic and `22` for ssh.
Those can be changed:
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
```yaml
2021-11-05 04:06:48 +00:00
service:
http:
port: 3000
ssh:
port: 22
2019-12-12 18:38:31 +00:00
```
2023-04-19 15:01:03 +00: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 12:37:47 +00:00
### ClusterIP
2023-04-19 15:01:03 +00: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 12:37:47 +00:00
```yaml
service:
http:
type: ClusterIP
port: 3000
clusterIP:
ssh:
type: ClusterIP
port: 22
clusterIP:
```
2020-12-10 09:16:13 +00:00
### SSH and Ingress
2023-04-19 15:01:03 +00:00
If you're using ingress and want to use SSH, keep in mind, that ingress is not able to forward SSH Ports.
You will need a LoadBalancer like `metallb` and a setting in your ssh service annotations.
2020-12-10 09:16:13 +00:00
```yaml
service:
ssh:
annotations:
metallb.universe.tf/allow-shared-ip: test
```
2021-07-01 15:02:56 +00:00
### SSH on crio based kubernetes cluster
2023-04-19 15:01:03 +00:00
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:
2021-07-01 15:02:56 +00:00
```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 18:38:31 +00:00
2023-04-19 15:01:03 +00:00
This helm chart can use a built in cache.
The default is Memcached from bitnami.
2019-12-12 18:38:31 +00:00
```yaml
2021-12-22 15:41:35 +00:00
memcached:
enabled: true
2019-12-12 18:38:31 +00:00
```
2023-04-19 15:01:03 +00:00
If the built in cache should not be used simply configure the cache in `gitea.config` .
2019-12-12 18:38:31 +00:00
```yaml
2021-11-05 04:06:48 +00:00
gitea:
config:
cache:
ENABLED: true
ADAPTER: memory
INTERVAL: 60
HOST: 127.0.0.1:9090
2019-12-12 18:38:31 +00:00
```
2020-10-06 09:03:20 +00:00
2020-08-23 17:56:55 +00:00
### Persistence
2019-12-12 18:38:31 +00:00
2023-05-10 08:19:12 +00:00
Forgejo will be deployed as a statefulset.
2023-04-19 15:01:03 +00:00
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 00:09:44 +00:00
2023-04-19 15:01:03 +00:00
Please note, that an empty storageClass in the persistence will result in kubernetes using your default storage class.
2021-06-07 17:53:01 +00:00
2023-04-19 15:01:03 +00:00
If you want to use your own storage class define it as follows:
2021-06-07 17:53:01 +00:00
```yaml
persistence:
enabled: true
storageClass: myOwnStorageClass
```
2023-04-19 15:01:03 +00:00
When using PostgreSQL as dependency, this will also be deployed as a statefulset by default.
2019-12-12 18:38:31 +00:00
2020-12-20 22:53:45 +00:00
If you want to manage your own PVC you can simply pass the PVC name to the chart.
2019-12-12 18:38:31 +00:00
2020-08-23 17:56:55 +00:00
```yaml
2023-01-03 16:47:23 +00:00
persistence:
enabled: true
existingClaim: MyAwesomeGiteaClaim
2020-08-23 17:56:55 +00:00
```
2019-12-12 18:38:31 +00:00
2023-03-27 17:12:29 +00:00
In case that persistence has been disabled it will simply use an empty dir volume.
2019-12-12 18:38:31 +00:00
2021-11-05 04:06:48 +00: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 18:38:31 +00:00
```yaml
2023-01-03 16:47:23 +00:00
postgresql:
2023-03-07 19:50:40 +00:00
persistence:
enabled: true
existingClaim: MyAwesomeGiteaPostgresClaim
2020-08-23 17:56:55 +00:00
```
### Admin User
2023-04-19 15:01:03 +00: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 18:38:31 +00:00
```yaml
2023-01-03 16:47:23 +00:00
gitea:
admin:
username: 'MyAwesomeForgejoAdmin'
password: 'AReallyAwesomeForgejoPassword'
email: 'forge@jo.com'
2019-12-12 18:38:31 +00:00
```
2021-06-10 11:13:33 +00: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:
2023-01-03 16:47:23 +00:00
admin:
existingSecret: gitea-admin-secret
2021-06-10 11:13:33 +00:00
```
2020-08-23 17:56:55 +00:00
### LDAP Settings
2021-10-08 12:16:24 +00:00
Like the admin user the LDAP settings can be updated.
2020-12-20 22:53:45 +00:00
All LDAP values from < https: / / docs . gitea . io / en-us / command-line / # admin > are available.
2019-12-12 18:38:31 +00:00
2021-10-08 12:16:24 +00:00
Multiple LDAP sources can be configured with additional LDAP list items.
2019-12-12 18:38:31 +00:00
```yaml
2023-01-03 16:47:23 +00:00
gitea:
ldap:
- 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 18:38:31 +00:00
```
2023-04-19 15:01:03 +00:00
You can also use an existing secret to set the `bindDn` and `bindPassword` :
2021-06-10 11:13:33 +00:00
```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:
2023-01-03 22:00:20 +00:00
ldap:
- existingSecret: gitea-ldap-secret
2021-06-10 11:13:33 +00:00
```
2023-04-19 15:01:03 +00:00
⚠️ Some options are just flags and therefore don't have any values.
2023-05-10 08:19:12 +00:00
If they are defined in `gitea.ldap` configuration, they will be passed to the Forgejo CLI without any value.
2023-04-19 15:01:03 +00:00
Affected options:
2021-06-29 20:09:16 +00:00
2021-07-06 05:28:13 +00:00
- notActive
- skipTlsVerify
- allowDeactivateAll
- synchronizeUsers
- attributesInBind
2021-06-29 20:09:16 +00:00
2021-03-01 12:24:11 +00:00
### OAuth2 Settings
2023-04-19 15:01:03 +00: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
2021-11-05 04:06:48 +00:00
available.
2021-03-01 12:24:11 +00:00
2021-12-20 14:43:55 +00:00
Multiple OAuth2 sources can be configured with additional OAuth list items.
2021-03-01 12:24:11 +00:00
```yaml
2021-11-05 04:06:48 +00:00
gitea:
oauth:
2023-03-07 19:50:40 +00:00
- name: "MyAwesomeGiteaOAuth"
provider: "openidConnect"
key: "hello"
secret: "world"
autoDiscoverUrl: "https://gitea.example.com/.well-known/openid-configuration"
2021-12-20 14:43:55 +00:00
#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:
2023-03-07 19:50:40 +00:00
- name: "MyAwesomeGiteaOAuth"
2021-12-20 14:43:55 +00:00
existingSecret: gitea-oauth-secret
2021-03-01 12:24:11 +00:00
```
2023-01-19 13:45:32 +00:00
## Configure commit signing
2023-04-19 15:01:03 +00:00
When using the rootless image the gpg key folder is not persistent by default.
2023-05-10 08:19:12 +00:00
If you consider using signed commits for internal Forgejo activities (e.g. initial commit), you'd need to provide a signing key.
2023-04-19 15:01:03 +00:00
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.
2023-01-19 13:45:32 +00:00
2023-04-19 15:01:03 +00: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.
2023-01-19 13:45:32 +00:00
```yaml
signing:
enabled: false
gpgHome: /data/git/.gnupg
```
2023-04-19 15:01:03 +00:00
Regardless of the used container image the `signing` object allows to specify a private gpg key.
Either using the `signing.privateKey` to define the key inline, or refer to an existing secret containing the key data by using `signing.existingSecret` .
2023-01-19 13:45:32 +00:00
```yaml
apiVersion: v1
kind: Secret
metadata:
name: custom-gitea-gpg-key
type: Opaque
stringData:
privateKey: |-
-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----
```
```yaml
signing:
existingSecret: custom-gitea-gpg-key
```
2023-05-10 08:19:12 +00:00
To use the gpg key, Forgejo needs to be configured accordingly.
2023-04-19 15:01:03 +00:00
A detailed description can be found in the [official Gitea documentation ](https://docs.gitea.io/en-us/signing/#general-configuration ).
2023-01-19 13:45:32 +00:00
2021-01-21 15:45:26 +00:00
### Metrics and profiling
2023-04-19 15:01:03 +00: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 15:45:26 +00:00
2023-04-19 15:01:03 +00: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 15:45:26 +00:00
```yaml
gitea:
metrics:
enabled: true
serviceMonitor:
enabled: true
config:
server:
2021-02-17 09:44:40 +00:00
ENABLE_PPROF: true
2021-01-21 15:45:26 +00:00
```
2020-09-24 16:32:11 +00:00
### Pod Annotations
2023-01-03 16:47:23 +00:00
Annotations can be added to the Forgejo pod.
2020-09-24 16:32:11 +00:00
```yaml
2021-11-05 04:06:48 +00:00
gitea:
podAnnotations: {}
2020-09-24 16:32:11 +00:00
```
2022-06-09 11:21:25 +00:00
## Parameters
2019-12-12 18:38:31 +00:00
2022-06-09 11:21:25 +00:00
### Global
2019-12-12 18:38:31 +00:00
2022-06-09 11:21:25 +00:00
| Name | Description | Value |
| ------------------------- | ------------------------------------------------------------------------- | --------------- |
| `global.imageRegistry` | global image registry override | `""` |
| `global.imagePullSecrets` | global image pull secrets override; can be extended by `imagePullSecrets` | `[]` |
| `global.storageClass` | global storage class override | `""` |
2023-03-07 11:18:25 +00:00
| `global.hostAliases` | global hostAliases which will be added to the pod's hosts files | `[]` |
2022-06-09 11:21:25 +00:00
| `replicaCount` | number of replicas for the statefulset | `1` |
| `clusterDomain` | cluster domain | `cluster.local` |
2019-12-12 18:38:31 +00:00
2022-06-09 11:21:25 +00:00
### Image
2019-12-12 18:38:31 +00:00
2023-01-03 16:47:23 +00:00
| Name | Description | Value |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
2023-01-03 16:52:18 +00:00
| `image.registry` | image registry, e.g. gcr.io,docker.io | `codeberg.org` |
2023-01-03 16:47:23 +00:00
| `image.repository` | Image to start for this pod | `forgejo/forgejo` |
| `image.tag` | Visit: [Image tag ](https://codeberg.org/forgejo/-/packages/container/forgejo/versions ). Defaults to `appVersion` within Chart.yaml. | `""` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.rootless` | Wether or not to pull the rootless version of Forgejo, only works on Forgejo 1.14.x or higher | `false` |
| `imagePullSecrets` | Secret to use for pulling the image | `[]` |
2019-12-12 18:38:31 +00:00
2022-06-09 11:21:25 +00:00
### Security
2019-12-12 18:38:31 +00:00
2022-06-09 11:21:25 +00:00
| Name | Description | Value |
| ---------------------------- | --------------------------------------------------------------- | ------ |
| `podSecurityContext.fsGroup` | Set the shared file system group for all containers in the pod. | `1000` |
| `containerSecurityContext` | Security context | `{}` |
2023-01-03 16:47:23 +00:00
| `securityContext` | Run init and Forgejo containers as a specific securityContext | `{}` |
2020-08-23 17:56:55 +00:00
### Service
2022-06-09 11:21:25 +00:00
| Name | Description | Value |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `service.http.type` | Kubernetes service type for web traffic | `ClusterIP` |
| `service.http.port` | Port number for web traffic | `3000` |
| `service.http.clusterIP` | ClusterIP setting for http autosetup for statefulset is None | `None` |
| `service.http.loadBalancerIP` | LoadBalancer IP setting | `nil` |
| `service.http.nodePort` | NodePort for http service | `nil` |
| `service.http.externalTrafficPolicy` | If `service.http.type` is `NodePort` or `LoadBalancer` , set this to `Local` to enable source IP preservation | `nil` |
| `service.http.externalIPs` | External IPs for service | `nil` |
| `service.http.ipFamilyPolicy` | HTTP service dual-stack policy | `nil` |
| `service.http.ipFamilies` | HTTP service dual-stack familiy selection,for dual-stack parameters see official kubernetes [dual-stack concept documentation ](https://kubernetes.io/docs/concepts/services-networking/dual-stack/ ). | `nil` |
| `service.http.loadBalancerSourceRanges` | Source range filter for http loadbalancer | `[]` |
| `service.http.annotations` | HTTP service annotations | `{}` |
| `service.ssh.type` | Kubernetes service type for ssh traffic | `ClusterIP` |
| `service.ssh.port` | Port number for ssh traffic | `22` |
| `service.ssh.clusterIP` | ClusterIP setting for ssh autosetup for statefulset is None | `None` |
| `service.ssh.loadBalancerIP` | LoadBalancer IP setting | `nil` |
| `service.ssh.nodePort` | NodePort for ssh service | `nil` |
| `service.ssh.externalTrafficPolicy` | If `service.ssh.type` is `NodePort` or `LoadBalancer` , set this to `Local` to enable source IP preservation | `nil` |
| `service.ssh.externalIPs` | External IPs for service | `nil` |
| `service.ssh.ipFamilyPolicy` | SSH service dual-stack policy | `nil` |
| `service.ssh.ipFamilies` | SSH service dual-stack familiy selection,for dual-stack parameters see official kubernetes [dual-stack concept documentation ](https://kubernetes.io/docs/concepts/services-networking/dual-stack/ ). | `nil` |
| `service.ssh.hostPort` | HostPort for ssh service | `nil` |
| `service.ssh.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` |
| `service.ssh.annotations` | SSH service annotations | `{}` |
2020-08-23 17:56:55 +00:00
2022-06-09 11:21:25 +00:00
### Ingress
2020-08-23 17:56:55 +00:00
2022-06-09 11:21:25 +00:00
| Name | Description | Value |
| ------------------------------------ | --------------------------------------------------------------------------- | ----------------- |
| `ingress.enabled` | Enable ingress | `false` |
| `ingress.className` | Ingress class name | `nil` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` |
| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` |
| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` |
| `ingress.tls` | Ingress tls settings | `[]` |
| `ingress.apiVersion` | Specify APIVersion of ingress object. Mostly would only be used for argocd. | |
### StatefulSet
| Name | Description | Value |
| ------------------------------------------- | ------------------------------------------------------ | ----- |
| `resources` | Kubernetes resources | `{}` |
| `schedulerName` | Use an alternate scheduler, e.g. "stork" | `""` |
| `nodeSelector` | NodeSelector for the statefulset | `{}` |
| `tolerations` | Tolerations for the statefulset | `[]` |
| `affinity` | Affinity for the statefulset | `{}` |
2022-06-27 06:35:55 +00:00
| `dnsConfig` | dnsConfig for the statefulset | `{}` |
2023-04-07 10:58:34 +00:00
| `priorityClassName` | priorityClassName for the statefulset | `""` |
2022-06-09 11:21:25 +00:00
| `statefulset.env` | Additional environment variables to pass to containers | `[]` |
| `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
| `statefulset.labels` | Labels for the statefulset | `{}` |
2023-01-03 16:47:23 +00:00
| `statefulset.annotations` | Annotations for the Forgejo StatefulSet to be created | `{}` |
2020-08-23 17:56:55 +00:00
2022-06-09 11:21:25 +00:00
### Persistence
2019-12-12 18:38:31 +00:00
2023-01-03 16:47:23 +00:00
| Name | Description | Value |
| ---------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------- |
| `persistence.enabled` | Enable persistent storage | `true` |
| `persistence.existingClaim` | Use an existing claim to store repository information | `nil` |
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
| `persistence.accessModes` | AccessMode for persistence | `["ReadWriteOnce"]` |
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
| `persistence.annotations` | Annotations for the persistence volume claim to be created | `{}` |
| `persistence.storageClass` | Name of the storage class to use | `nil` |
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
| `extraVolumes` | Additional volumes to mount to the Forgejo statefulset | `[]` |
| `extraContainerVolumeMounts` | Mounts that are only mapped into the Forgejo runtime/main container, to e.g. override custom templates. | `[]` |
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Forgejo main container | `[]` |
2022-06-09 11:21:25 +00:00
### Init
2023-04-01 11:35:11 +00:00
| Name | Description | Value |
| ------------------------------------------ | ------------------------------------------------------------------------------------ | ------- |
| `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` |
| `initContainers.resources.limits` | initContainers.limits Kubernetes resource limits for init containers | `{}` |
| `initContainers.resources.requests.cpu` | initContainers.requests.cpu Kubernetes cpu resource limits for init containers | `100m` |
| `initContainers.resources.requests.memory` | initContainers.requests.memory Kubernetes memory resource limits for init containers | `128Mi` |
2022-06-09 11:21:25 +00:00
### Signing
2023-01-19 13:45:32 +00:00
| Name | Description | Value |
| ------------------------ | ----------------------------------------------------------------- | ------------------ |
| `signing.enabled` | Enable commit/action signing | `false` |
| `signing.gpgHome` | GPG home directory | `/data/git/.gnupg` |
| `signing.privateKey` | Inline private gpg key for signed Forgejo actions | `""` |
| `signing.existingSecret` | Use an existing secret to store the value of `signing.privateKey` | `""` |
2022-06-09 11:21:25 +00:00
### Gitea
2023-01-03 16:47:23 +00:00
| Name | Description | Value |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------- |
| `gitea.admin.username` | Username for the Forgejo admin user | `gitea_admin` |
| `gitea.admin.existingSecret` | Use an existing secret to store admin user credentials | `nil` |
| `gitea.admin.password` | Password for the Forgejo admin user | `r8sA8CPHD9!bt6d` |
| `gitea.admin.email` | Email for the Forgejo admin user | `gitea@local.domain` |
| `gitea.metrics.enabled` | Enable Forgejo metrics | `false` |
| `gitea.metrics.serviceMonitor.enabled` | Enable Forgejo metrics service monitor | `false` |
| `gitea.ldap` | LDAP configuration | `[]` |
| `gitea.oauth` | OAuth configuration | `[]` |
| `gitea.config` | Configuration for the Forgejo server,ref: [config-cheat-sheet ](https://docs.gitea.io/en-us/config-cheat-sheet/ ) | `{}` |
| `gitea.additionalConfigSources` | Additional configuration from secret or configmap | `[]` |
| `gitea.additionalConfigFromEnvs` | Additional configuration sources from environment variables | `[]` |
| `gitea.podAnnotations` | Annotations for the Forgejo pod | `{}` |
2023-05-10 08:19:12 +00:00
| `gitea.ssh.logLevel` | Configure OpenSSH's log level. Only available for root-based Forgejo image. | `INFO` |
2022-06-09 11:21:25 +00:00
### LivenessProbe
| Name | Description | Value |
| ----------------------------------------- | ------------------------------------------------ | ------ |
| `gitea.livenessProbe.enabled` | Enable liveness probe | `true` |
| `gitea.livenessProbe.tcpSocket.port` | Port to probe for liveness | `http` |
| `gitea.livenessProbe.initialDelaySeconds` | Initial delay before liveness probe is initiated | `200` |
| `gitea.livenessProbe.timeoutSeconds` | Timeout for liveness probe | `1` |
| `gitea.livenessProbe.periodSeconds` | Period for liveness probe | `10` |
| `gitea.livenessProbe.successThreshold` | Success threshold for liveness probe | `1` |
| `gitea.livenessProbe.failureThreshold` | Failure threshold for liveness probe | `10` |
### ReadinessProbe
| Name | Description | Value |
| ------------------------------------------ | ------------------------------------------------- | ------ |
| `gitea.readinessProbe.enabled` | Enable readiness probe | `true` |
| `gitea.readinessProbe.tcpSocket.port` | Port to probe for readiness | `http` |
| `gitea.readinessProbe.initialDelaySeconds` | Initial delay before readiness probe is initiated | `5` |
| `gitea.readinessProbe.timeoutSeconds` | Timeout for readiness probe | `1` |
| `gitea.readinessProbe.periodSeconds` | Period for readiness probe | `10` |
| `gitea.readinessProbe.successThreshold` | Success threshold for readiness probe | `1` |
| `gitea.readinessProbe.failureThreshold` | Failure threshold for readiness probe | `3` |
### StartupProbe
| Name | Description | Value |
| ---------------------------------------- | ----------------------------------------------- | ------- |
| `gitea.startupProbe.enabled` | Enable startup probe | `false` |
| `gitea.startupProbe.tcpSocket.port` | Port to probe for startup | `http` |
| `gitea.startupProbe.initialDelaySeconds` | Initial delay before startup probe is initiated | `60` |
| `gitea.startupProbe.timeoutSeconds` | Timeout for startup probe | `1` |
| `gitea.startupProbe.periodSeconds` | Period for startup probe | `10` |
| `gitea.startupProbe.successThreshold` | Success threshold for startup probe | `1` |
| `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe | `10` |
### Memcached
2023-01-03 21:52:27 +00: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.
2023-03-28 21:11:33 +00:00
| Name | Description | Value |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `memcached.enabled` | 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. | `true` |
| `memcached.service.ports.memcached` | Port for Memcached | `11211` |
2022-06-09 11:21:25 +00:00
### PostgreSQL
2023-01-03 21:52:27 +00:00
PostgreSQL is loaded as a dependency from [Bitnami ](https://github.com/bitnami/charts/tree/master/bitnami/postgresql ) if enabled in the values. Complete Configuration can be taken from their website.
2023-03-27 17:12:29 +00:00
| Name | Description | Value |
| ------------------------------------------------------- | ---------------------------------------------------------------- | ------- |
| `postgresql.enabled` | Enable PostgreSQL | `true` |
2023-04-04 13:47:07 +00:00
| `postgresql.global.postgresql.auth.password` | Password for the `gitea` user (overrides `auth.password` ) | `gitea` |
2023-03-27 17:12:29 +00:00
| `postgresql.global.postgresql.auth.database` | Name for a custom database to create (overrides `auth.database` ) | `gitea` |
| `postgresql.global.postgresql.auth.username` | Name for a custom user to create (overrides `auth.username` ) | `gitea` |
| `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql` ) | `5432` |
| `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` |
2022-06-09 11:21:25 +00:00
### Advanced
2023-03-09 15:25:45 +00:00
| Name | Description | Value |
| ------------------ | ------------------------------------------------------------------ | --------- |
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
| `test.enabled` | Set it to false to disable test-connection Pod. | `true` |
| `test.image.name` | Image name for the wget container used in the test-connection Pod. | `busybox` |
| `test.image.tag` | Image tag for the wget container used in the test-connection Pod. | `latest` |
2023-05-02 13:32:54 +00:00
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` |
2021-09-27 19:52:37 +00:00
2022-06-12 19:35:24 +00:00
## Contributing
Expected workflow is: Fork -> Patch -> Push -> Pull Request
See [CONTRIBUTORS GUIDE ](CONTRIBUTING.md ) for details.
2022-07-15 17:27:48 +00:00
## Upgrading
2023-04-04 13:47:07 +00:00
This section lists major and breaking changes of each Helm Chart version
2022-07-15 17:27:48 +00:00
Please read them carefully to upgrade successfully.