feat/markdownlint (#200)

Hi,
this patch contains a markdownlinter. I think this has the advantage that all users stick to the same format and the `README.md` follows a consistent structure.

The markdownlinter can be configured via the `.markdownlint.yaml` file. All possible options are [here](https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml) documented.

I have created the initialie configuration. However, can be adapted to suggestions for change. Has of course the consequence that if necessary the `README.md` would have to be adapted. I have formatted this in advance according to the defined rules.

For users which use visual-code as IDE is additionally a plugin [available](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint).

Co-authored-by: Markus Pesch <markus.pesch@cryptic.systems>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/200
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: Markus Pesch <volker.raschek@noreply.gitea.io>
Co-committed-by: Markus Pesch <volker.raschek@noreply.gitea.io>
This commit is contained in:
Markus Pesch 2021-11-05 12:06:48 +08:00 committed by Lunny Xiao
parent 3fd34a9455
commit 82763f109b
3 changed files with 487 additions and 266 deletions

View File

@ -1,5 +1,6 @@
--- ---
kind: pipeline kind: pipeline
type: docker
name: lint name: lint
platform: platform:
@ -7,12 +8,18 @@ platform:
arch: arm64 arch: arm64
steps: steps:
- name: lint - name: helm lint
pull: always pull: always
image: alpine:3.13 image: alpine:3.13
commands: commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- helm lint - helm lint
- name: markdown lint
pull: always
image: docker.io/volkerraschek/markdownlint:latest
commands:
- markdownlint *.md
- name: discord - name: discord
pull: always pull: always
@ -29,6 +36,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: docker
name: release-version name: release-version
platform: platform:
@ -37,33 +45,33 @@ platform:
trigger: trigger:
event: event:
- tag - tag
steps: steps:
- name: generate-chart - name: generate-chart
pull: always pull: always
image: alpine:3.13 image: alpine:3.13
commands: commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- apk add --no-cache curl - apk add --no-cache curl
- helm dependency update - helm dependency update
- helm package --version "${DRONE_TAG##v}" ./ - helm package --version "${DRONE_TAG##v}" ./
- mkdir gitea - mkdir gitea
- mv gitea*.tgz gitea/ - mv gitea*.tgz gitea/
- curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml - curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml
- helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml - helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml
- name: upload-chart - name: upload-chart
pull: always pull: always
image: plugins/s3:latest image: plugins/s3:latest
settings: settings:
bucket: gitea-artifacts bucket: gitea-artifacts
endpoint: https://storage.gitea.io endpoint: https://storage.gitea.io
path_style: true path_style: true
access_key: access_key:
from_secret: aws_access_key_id from_secret: aws_access_key_id
secret_key: secret_key:
from_secret: aws_secret_access_key from_secret: aws_secret_access_key
source: gitea/* source: gitea/*
target: /charts target: /charts
strip_prefix: gitea/ strip_prefix: gitea/

149
.markdownlint.yaml Normal file
View File

@ -0,0 +1,149 @@
# markdownlint YAML configuration
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# Default state for all rules
default: true
# Path to configuration file to extend
extends: null
# MD003/heading-style/header-style - Heading style
MD003:
# Heading style
style: "atx"
# MD004/ul-style - Unordered list style
MD004:
style: "dash"
# MD007/ul-indent - Unordered list indentation
MD007:
# Spaces for indent
indent: 2
# Whether to indent the first level of the list
start_indented: false
# MD009/no-trailing-spaces - Trailing spaces
MD009:
# Spaces for line break
br_spaces: 2
# Allow spaces for empty lines in list items
list_item_empty_lines: false
# Include unnecessary breaks
strict: false
# MD010/no-hard-tabs - Hard tabs
MD010:
# Include code blocks
code_blocks: true
# MD012/no-multiple-blanks - Multiple consecutive blank lines
MD012:
# Consecutive blank lines
maximum: 1
# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 80
# Number of characters for headings
heading_line_length: 80
# Number of characters for code blocks
code_block_line_length: 80
# Include code blocks
code_blocks: false
# Include tables
tables: false
# Include headings
headings: true
# Include headings
headers: true
# Strict length checking
strict: false
# Stern length checking
stern: false
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
MD022:
# Blank lines above heading
lines_above: 1
# Blank lines below heading
lines_below: 1
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024:
# Only check sibling headings
allow_different_nesting: true
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
MD025:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD026/no-trailing-punctuation - Trailing punctuation in heading
MD026:
# Punctuation characters
punctuation: ".,;:!。,;:!"
# MD029/ol-prefix - Ordered list item prefix
MD029:
# List style
style: "one_or_ordered"
# MD030/list-marker-space - Spaces after list markers
MD030:
# Spaces for single-line unordered list items
ul_single: 1
# Spaces for single-line ordered list items
ol_single: 1
# Spaces for multi-line unordered list items
ul_multi: 1
# Spaces for multi-line ordered list items
ol_multi: 1
# MD033/no-inline-html - Inline HTML
MD033:
# Allowed elements
allowed_elements: []
# MD035/hr-style - Horizontal rule style
MD035:
# Horizontal rule style
style: "---"
# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
MD036:
# Punctuation characters
punctuation: ".,;:!?。,;:!?"
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD044/proper-names - Proper names should have the correct capitalization
MD044:
# List of proper names
names:
- Gitea
- PostgreSQL
- MariaDB
- MySQL
- Memcached
- Prometheus
# Include code blocks
code_blocks: false
# MD046/code-block-style - Code block style
MD046:
# Block style
style: "fenced"
# MD048/code-fence-style - Code fence style
MD048:
# Code fence syle
style: "backtick"

536
README.md
View File

@ -1,46 +1,53 @@
# Gitea Helm Chart # Gitea Helm Chart
[Gitea](https://gitea.io/en-us/) is a community managed lightweight code hosting solution written in Go. It is published under the MIT license. [Gitea](https://gitea.io/en-us/) is a community managed lightweight code hosting
solution written in Go. It is published under the MIT license.
## Introduction ## Introduction
This helm chart has taken some inspiration from <https://github.com/jfelten/gitea-helm-chart> This helm chart has taken some inspiration from [jfelten's helm
But takes a completely different approach in providing a database and cache with dependencies. chart](https://github.com/jfelten/gitea-helm-chart). But takes a completely
Additionally, this chart provides LDAP and admin user configuration with values, as well as being deployed as a statefulset to retain stored repositories. 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 ## Dependencies
Gitea can be run with an 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
enabled, or disabled via [configuration](#configuration). dependencies, which can be enabled, or disabled via
[configuration](#configuration).
Dependencies: Dependencies:
* Postgresql - PostgreSQL
* Memcached - Memcached
* Mysql - MySQL
## Installing ## Installing
```sh ```sh
helm repo add gitea-charts https://dl.gitea.io/charts/ helm repo add gitea-charts https://dl.gitea.io/charts/
helm repo update helm repo update
helm install gitea gitea-charts/gitea helm install gitea gitea-charts/gitea
``` ```
## Prerequisites ## Prerequisites
* Kubernetes 1.12+ - Kubernetes 1.12+
* Helm 3.0+ - Helm 3.0+
* PV provisioner for persistent data support - PV provisioner for persistent data support
## Chart upgrade from 3.x.x to 4.0.0 ## Chart upgrade from 3.x.x to 4.0.0
:warning: The most recent 4.0.0 update brings some breaking changes. Please note the following changes in the Chart to upgrade successfully. :warning: :warning: The most recent `4.0.0` update brings some breaking changes. Please note
the following changes in the Chart to upgrade successfully. :warning:
### Ingress changes ### Ingress changes
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. 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.
```diff ```diff
ingress: ingress:
@ -61,7 +68,8 @@ ingress:
# - git.example.com # - git.example.com
``` ```
If you want everything as it was before, you can simply add the following code to all your host entries. If you want everything as it was before, you can simply add the following code
to all your host entries.
```yaml ```yaml
paths: paths:
@ -71,71 +79,92 @@ paths:
### Dropped kebab-case support ### Dropped kebab-case support
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. In 3.x.x it was possible to provide an ldap configuration via kebab-case, this
See [LDAP section](#ldap-settings) for more information. support has now been dropped and only camel case is supported. See [LDAP
section](#ldap-settings) for more information.
### Dependency update ### Dependency update
The chart comes with multiple databases and memcached as dependency, the latest release updated the dependencies. The chart comes with multiple databases and Memcached as dependency, the latest
release updated the dependencies.
- memcached: 4.2.20 -> 5.9.0 - Memcached: `4.2.20` -> `5.9.0`
- postgresql: 9.7.2 -> 10.3.17 - PostgreSQL: `9.7.2` -> `10.3.17`
- mariadb: 8.0.0 -> 9.3.6 - MariaDB: `8.0.0` -> `9.3.6`
If you're using the builtin databases you will most likely redeploy the chart in order to update the database correctly. If you're using the builtin databases you will most likely redeploy the chart in
order to update the database correctly.
### Execution of initPreScript ### Execution of initPreScript
Generally spoken, this might not be a breaking change, but it is worth to be mentioned. Generally spoken, this might not be a breaking change, but it is worth to be
mentioned.
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. 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.
## Gitea Version 1.14.X repository ROOT ## Gitea Version 1.14.X repository ROOT
Previously the ROOT folder for the gitea repositories was located at /data/git/gitea-repositories Previously the ROOT folder for the Gitea repositories was located at
1.14 changed this to /data/gitea-repositories. `/data/git/gitea-repositories`. In version `1.14` has the path been changed to
`/data/gitea-repositories`.
This chart will set the gitea.config.repository.ROOT value default to /data/git/gitea-repositories This chart will set the `gitea.config.repository.ROOT` value default to
`/data/git/gitea-repositories`.
## Configure Commit Signing ## Configure Commit Signing
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 [PR 186](https://gitea.com/gitea/helm-chart/pulls/186), imported keys had to be re-imported once the container got replaced by another. 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.
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. 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.
```yaml ```yaml
signing: signing:
enabled: false enabled: false
gpgHome: /data/git/.gnupg gpgHome: /data/git/.gnupg
``` ```
## Examples ## Examples
### Gitea Configuration ### Gitea Configuration
Gitea offers lots of configuration options. 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 ```yaml
gitea: gitea:
config: config:
APP_NAME: "Gitea: With a cup of tea." APP_NAME: "Gitea: With a cup of tea."
repository: repository:
ROOT: "~/gitea-repositories" ROOT: "~/gitea-repositories"
repository.pull-request: repository.pull-request:
WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:" WORK_IN_PROGRESS_PREFIXES: "WIP:,[WIP]:"
``` ```
### Default Configuration ### 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. 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. 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.* *All default settings are made directly in the generated app.ini, not in the Values.*
#### Database defaults #### Database defaults
If a builtIn database is enabled the database configuration is set automatically. For example, postgresql builtIn 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 ```ini
[database] [database]
@ -148,7 +177,8 @@ USER = gitea
#### Memcached defaults #### Memcached defaults
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: 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 ```ini
[cache] [cache]
@ -159,8 +189,9 @@ HOST = RELEASE-NAME-memcached.default.svc.cluster.local:11211
#### Server defaults #### Server defaults
The server defaults are a bit more complex. The server defaults are a bit more complex. If ingress is `enabled`, the
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. `ROOT_URL`, `DOMAIN` and `SSH_DOMAIN` will be set accordingly. `HTTP_PORT`
always defaults to `3000` as well as `SSH_PORT` to `22`.
```ini ```ini
[server] [server]
@ -186,42 +217,46 @@ ENABLED = false
### 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.
```yaml ```yaml
gitea: gitea:
database: database:
builtIn: builtIn:
postgresql: postgresql:
enabled: false enabled: false
config: config:
database: database:
DB_TYPE: mysql DB_TYPE: mysql
HOST: 127.0.0.1:3306 HOST: 127.0.0.1:3306
NAME: gitea NAME: gitea
USER: root USER: root
PASSWD: gitea PASSWD: gitea
SCHEMA: gitea SCHEMA: gitea
``` ```
### Ports and external url ### Ports and external url
By default port 3000 is used for web traffic and 22 for ssh. Those can be changed: By default port `3000` is used for web traffic and `22` for ssh. Those can be changed:
```yaml ```yaml
service: service:
http: http:
port: 3000 port: 3000
ssh: ssh:
port: 22 port: 22
``` ```
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. 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 ### ClusterIP
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: 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:
```yaml ```yaml
service: service:
@ -237,8 +272,9 @@ service:
### SSH and Ingress ### SSH and Ingress
If you're using ingress and wan't to use SSH, keep in mind, that ingress is not able to forward SSH Ports. If you're using ingress and won't to use SSH, keep in mind, that ingress is not
You will need a LoadBalancer like metallb and a setting in your ssh service annotations. able to forward SSH Ports. You will need a LoadBalancer like `metallb` and a
setting in your ssh service annotations.
```yaml ```yaml
service: service:
@ -267,33 +303,37 @@ More about this issue [here](https://gitea.com/gitea/helm-chart/issues/161).
### Cache ### Cache
This helm chart can use a built in cache. The default is memcached from bitnami. This helm chart can use a built in cache. The default is Memcached from bitnami.
```yaml ```yaml
gitea: gitea:
cache: cache:
builtIn: builtIn:
enabled: true enabled: true
``` ```
If the built in cache should not be used simply configure the cache in gitea.config If the built in cache should not be used simply configure the cache in
`gitea.config`.
```yaml ```yaml
gitea: gitea:
config: config:
cache: cache:
ENABLED: true ENABLED: true
ADAPTER: memory ADAPTER: memory
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
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. 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.
Please note, that an empty storageClass in the persistence will result in kubernetes using your default storage class. Please note, that an empty storageClass in the persistence will result in
kubernetes using your default storage class.
If you want to use your own storageClass define it as followed: If you want to use your own storageClass define it as followed:
@ -303,7 +343,8 @@ persistence:
storageClass: myOwnStorageClass storageClass: myOwnStorageClass
``` ```
When using Postgresql as dependency, this will also be deployed as a statefulset by default. 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. If you want to manage your own PVC you can simply pass the PVC name to the chart.
@ -315,7 +356,7 @@ If you want to manage your own PVC you can simply pass the PVC name to the chart
In case that peristence has been disabled it will simply use an empty dir volume. In case that peristence has been disabled it will simply use an empty dir volume.
Postgresql handles the persistence in the exact same way. PostgreSQL handles the persistence in the exact same way.
You can interact with the postgres settings as displayed in the following example: You can interact with the postgres settings as displayed in the following example:
```yaml ```yaml
@ -325,7 +366,7 @@ You can interact with the postgres settings as displayed in the following exampl
existingClaim: MyAwesomeGiteaPostgresClaim existingClaim: MyAwesomeGiteaPostgresClaim
``` ```
Mysql also handles persistence the same, even though it is not deployed as a statefulset. MySQL also handles persistence the same, even though it is not deployed as a statefulset.
You can interact with the postgres settings as displayed in the following example: You can interact with the postgres settings as displayed in the following example:
```yaml ```yaml
@ -337,9 +378,10 @@ You can interact with the postgres settings as displayed in the following exampl
### Admin User ### Admin User
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. This chart enables you to create a default admin user. It is also possible to
It is not possible to delete an admin user after it has been created. This has to be done in the ui. update the password for this user by upgrading or redeloying the chart. It is
You cannot use `admin` as username. 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.
```yaml ```yaml
gitea: gitea:
@ -412,7 +454,9 @@ gitea:
... ...
``` ```
: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: :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:
- notActive - notActive
- skipTlsVerify - skipTlsVerify
@ -422,30 +466,37 @@ gitea:
### OAuth2 Settings ### OAuth2 Settings
Like the admin user, OAuth2 settings can be updated and disabled but not deleted. Deleting OAuth2 settings has to be done in the ui. Like the admin user, OAuth2 settings can be updated and disabled but not
All OAuth2 values from <https://docs.gitea.io/en-us/command-line/#admin> are available. 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.
```yaml ```yaml
gitea: gitea:
oauth: oauth:
enabled: true enabled: true
name: 'MyAwesomeGiteaOAuth' name: 'MyAwesomeGiteaOAuth'
provider: 'openidConnect' provider: 'openidConnect'
key: 'hello' key: 'hello'
secret: 'world' secret: 'world'
autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration' autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration'
#useCustomUrls: #useCustomUrls:
#customAuthUrl: #customAuthUrl:
#customTokenUrl: #customTokenUrl:
#customProfileUrl: #customProfileUrl:
#customEmailUrl: #customEmailUrl:
``` ```
### Metrics and profiling ### Metrics and profiling
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. 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.
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. 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).
```yaml ```yaml
gitea: gitea:
@ -464,183 +515,196 @@ gitea:
Annotations can be added to the Gitea pod. Annotations can be added to the Gitea pod.
```yaml ```yaml
gitea: gitea:
podAnnotations: {} podAnnotations: {}
``` ```
## Configuration ## Configuration
### Others ### Others
| Parameter | Description | Default | | Parameter | Description | Default |
|-------------------------------------------|--------------------------------------------------------|-------------| | ------------------------------------------| -------------------------------------------------------- | ------- |
| statefulset.terminationGracePeriodSeconds | How long to wait until forcefully kill the pod | 60 | | statefulset.terminationGracePeriodSeconds | How long to wait until forcefully kill the pod | `60` |
| statefulset.env | Additional environment variables to pass to containers | [] | | statefulset.env | Additional environment variables to pass to containers | `[]` |
| extraVolumes | Additional volumes to mount to the Gitea statefulset | {} | | extraVolumes | Additional volumes to mount to the Gitea statefulset | `{}` |
| extraVolumeMounts | Additional volume mounts for the Gitea containers | {} | | extraVolumeMounts | Additional volume mounts for the Gitea containers | `{}` |
| initPreScript | Bash script copied verbatim to start of init container | | | initPreScript | Bash script copied verbatim to start of init container | |
| securityContext | Run as a specific securityContext | {} | | securityContext | Run as a specific securityContext | `{}` |
| schedulerName | Use an alternate scheduler, e.g. "stork" | | | schedulerName | Use an alternate scheduler, e.g. "stork" | |
### Image ### Image
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | -----------------| ----------------------------------------------------------------------------------------- | ------------- |
|image.repository| Image to start for this pod | gitea/gitea | | 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.15.4 | | image.tag | [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | `1.14.6` |
|image.pullPolicy| Image pull policy | Always | | 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 | | image.rootless | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `false` |
### Persistence ### Persistence
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ------------------------- | ---------------------------------------------------------- | ------- |
|persistence.enabled| Enable persistence for Gitea |true| | persistence.enabled | Enable persistence for Gitea | `true` |
|persistence.existingClaim| Use an existing claim to store repository information | | | persistence.existingClaim | Use an existing claim to store repository information | |
|persistence.size| Size for persistence to store repo information | 10Gi | | persistence.size | Size for persistence to store repo information | `10Gi` |
|persistence.accessModes|AccessMode for persistence|| | persistence.accessModes | AccessMode for persistence | |
|persistence.storageClass|Storage class for repository persistence|| | persistence.storageClass | Storage class for repository persistence | |
|persistence.labels|Labels for the persistence volume claim to be created|{}| | persistence.labels | Labels for the persistence volume claim to be created | `{}` |
|persistence.annotations|Annotations for the persistence volume claim to be created|{}| | persistence.annotations | Annotations for the persistence volume claim to be created | `{}` |
### Ingress ### Ingress
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ---------------------------------- | ---------------------------------------------- | ----------------- |
|ingress.enabled| enable ingress | false| | ingress.enabled | enable ingress | `false` |
|ingress.annotations| add ingress annotations | | | ingress.annotations | add ingress annotations | |
|ingress.hosts[0].host | add hosts for ingress | git.example.com | | 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].path | add path for each ingress host | `/` |
|ingress.hosts[0].paths[0].pathType | add ingress path type | Prefix | | ingress.hosts[0].paths[0].pathType | add ingress path type | `Prefix` |
|ingress.tls| add ingress tls settings|[]| | ingress.tls | add ingress tls settings | `[]` |
|ingress.className| add ingress class name. Only used in k8s 1.19+ | | | ingress.className | add ingress class name. Only used in k8s 1.19+ | |
### Service ### Service
#### Web #### Web
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
|service.http.type| Kubernetes service type for web traffic | ClusterIP | | `service.http.type` | Kubernetes service type for web traffic | `ClusterIP` |
|service.http.port| Port for web traffic | 3000 | | `service.http.port` | Port for web traffic | `3000` |
|service.http.clusterIP| ClusterIP setting for http autosetup for statefulset is None | None | | `service.http.clusterIP` | ClusterIP setting for http autosetup for statefulset is None | `None` |
|service.http.loadBalancerIP| LoadBalancer Ip setting | | | `service.http.loadBalancerIP` | LoadBalancer Ip setting | |
|service.http.nodePort| NodePort for http service | | | `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.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 | | | `service.http.externalIPs` | http service external IP addresses | |
|service.http.loadBalancerSourceRanges| Source range filter for http loadbalancer | [] | | `service.http.loadBalancerSourceRanges` | Source range filter for http loadbalancer | `[]` |
|service.http.annotations| http service annotations | | | `service.http.annotations` | http service annotations | |
#### SSH #### SSH
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | -------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------- |
|service.ssh.type| Kubernetes service type for ssh traffic | ClusterIP | | `service.ssh.type` | Kubernetes service type for ssh traffic | `ClusterIP` |
|service.ssh.port| Port for ssh traffic | 22 | | `service.ssh.port` | Port for ssh traffic | `22` |
|service.ssh.loadBalancerIP| LoadBalancer Ip setting | | | `service.ssh.loadBalancerIP` | LoadBalancer Ip setting | |
|service.ssh.nodePort| NodePort for ssh service | | | `service.ssh.nodePort` | NodePort for ssh service | |
|service.ssh.externalTrafficPolicy| If `service.ssh.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation | | | `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 | | | `service.ssh.externalIPs` | ssh service external IP addresses | |
|service.ssh.loadBalancerSourceRanges| Source range filter for ssh loadbalancer | [] | | `service.ssh.loadBalancerSourceRanges` | Source range filter for ssh loadbalancer | `[]` |
|service.ssh.annotations| ssh service annotations | | | `service.ssh.annotations` | ssh service annotations | |
### Gitea Configuration ### Gitea Configuration
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | -------------- | ---------------------------------------------------------------------------------------------------- | ------- |
|gitea.config | Everything in `app.ini` can be configured with this dict. See [Examples](#examples) for more details | {} | | `gitea.config` | Everything in `app.ini` can be configured with this dict. See [Examples](#examples) for more details | `{}` |
### Gitea Probes ### Gitea Probes
Configure Liveness, Readiness and Startup [Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) Configure Liveness, Readiness and Startup
[Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ------------------------------------------ | -------------------------------------------------------------------- | ------- |
|gitea.livenessProbe.enabled | Enable liveness probe | true | | `gitea.livenessProbe.enabled` | Enable liveness probe | `true` |
|gitea.livenessProbe.initialDelaySeconds | Delay before probe start| 200 | | `gitea.livenessProbe.initialDelaySeconds` | Delay before probe start | `200` |
|gitea.livenessProbe.timeoutSeconds | probe timeout | 1 | | `gitea.livenessProbe.timeoutSeconds` | probe timeout | `1` |
|gitea.livenessProbe.periodSeconds | period between probes | 10 | | `gitea.livenessProbe.periodSeconds` | period between probes | `10` |
|gitea.livenessProbe.successThreshold | Minimum consecutive success probes | 1 | | `gitea.livenessProbe.successThreshold` | Minimum consecutive success probes | `1` |
|gitea.livenessProbe.failureThreshold | Minimum consecutive error probes | 10 | | `gitea.livenessProbe.failureThreshold` | Minimum consecutive error probes | `10` |
|gitea.readinessProbe.enabled | Enable readiness probe | true | | `gitea.readinessProbe.enabled` | Enable readiness probe | `true` |
|gitea.readinessProbe.initialDelaySeconds | Delay before probe start| 5 | | `gitea.readinessProbe.initialDelaySeconds` | Delay before probe start | `5` |
|gitea.readinessProbe.timeoutSeconds | probe timeout | 1 | | `gitea.readinessProbe.timeoutSeconds` | probe timeout | `1` |
|gitea.readinessProbe.periodSeconds | period between probes | 10 | | `gitea.readinessProbe.periodSeconds` | period between probes | `10` |
|gitea.readinessProbe.successThreshold | Minimum consecutive success probes | 1 | | `gitea.readinessProbe.successThreshold` | Minimum consecutive success probes | `1` |
|gitea.readinessProbe.failureThreshold | Minimum consecutive error probes | 3 | | `gitea.readinessProbe.failureThreshold` | Minimum consecutive error probes | `3` |
|gitea.startupProbe.enabled | Enable startup probe | false | | `gitea.startupProbe.enabled` | Enable startup probe | `false` |
|gitea.startupProbe.initialDelaySeconds | Delay before probe start| 60 | | `gitea.startupProbe.initialDelaySeconds` | Delay before probe start | `60` |
|gitea.startupProbe.timeoutSeconds | probe timeout | 1 | | `gitea.startupProbe.timeoutSeconds` | probe timeout | `1` |
|gitea.startupProbe.periodSeconds | period between probes | 10 | | `gitea.startupProbe.periodSeconds` | period between probes | `10` |
|gitea.startupProbe.successThreshold | Minimum consecutive success probes | 1 | | `gitea.startupProbe.successThreshold` | Minimum consecutive success probes | `1` |
|gitea.startupProbe.failureThreshold | Minimum consecutive error probes | 10 | | `gitea.startupProbe.failureThreshold` | Minimum consecutive error probes | `10` |
|gitea.customLivenessProbe | Custom liveness probe (needs `gitea.livenessProbe.enabled: false`) | | | `gitea.customLivenessProbe` | Custom liveness probe (needs `gitea.livenessProbe.enabled: false`) | |
|gitea.customReadinessProbe | Custom readiness probe (needs `gitea.readinessProbe.enabled: false`) | | | `gitea.customReadinessProbe` | Custom readiness probe (needs `gitea.readinessProbe.enabled: false`) | |
|gitea.customStartupProbe | Custom startup probe (needs `gitea.startupProbe.enabled: false`) | | | `gitea.customStartupProbe` | Custom startup probe (needs `gitea.startupProbe.enabled: false`) | |
### Memcached BuiltIn ### Memcached BuiltIn
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. 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.
The following parameters are the defaults set by this chart The following parameters are the defaults set by this chart
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ------------------------ | -------------- | ------- |
|memcached.service.port|Memcached Port| 11211| | `memcached.service.port` | Memcached Port | 11211 |
### Mysql BuiltIn ### MySQL BuiltIn
Mysql is loaded as a dependency from stable. Configuration can be found on this [website](https://github.com/helm/charts/tree/master/stable/mysql). MySQL is loaded as a dependency from stable. Configuration can be found on this
[website](https://github.com/helm/charts/tree/master/stable/mysql).
The following parameters are the defaults set by this chart The following parameters are the defaults set by this chart
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ------------------------ | ------------------------------------------------------------------ | ------- |
|mysql.root.password|Password for the root user. Ignored if existing secret is provided|gitea| | `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.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.password` | Password for the new user. Ignored if existing secret is provided | `gitea` |
|mysql.db.name|Name for new database to create.|gitea| | `mysql.db.name` | 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.size|Persistence size for mysql |10Gi| | `mysql.persistence.size` | Persistence size for MySQL | `10Gi` |
### Postgresql BuiltIn ### PostgreSQL BuiltIn
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. 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.
The following parameters are the defaults set by this chart The following parameters are the defaults set by this chart
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ------------------------------------------------- | -------------------------------------------------------- | ------- |
|postgresql.global.postgresql.postgresqlDatabase| PostgreSQL database (overrides postgresqlDatabase)|gitea| | `postgresql.global.postgresql.postgresqlDatabase` | PostgreSQL database (overrides postgresqlDatabase) | `gitea` |
|postgresql.global.postgresql.postgresqlUsername| PostgreSQL username (overrides postgresqlUsername)|gitea| | `postgresql.global.postgresql.postgresqlUsername` | PostgreSQL username (overrides postgresqlUsername) | `gitea` |
|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 BuiltIn
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. 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.
The following parameters are the defaults set by this chart The following parameters are the defaults set by this chart
| Parameter | Description | Default | | Parameter | Description | Default |
|---------------------|-----------------------------------|------------------------------| | ---------------------------------- | ----------------------------------------------------------------- | ------- |
|mariadb.auth.username|Username of new user to create.|gitea| | `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.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.database` | Name for new database to create. | `gitea` |
|mariadb.auth.rootPassword|Password for the root user.|gitea| | `mariadb.auth.rootPassword` | Password for the root user. | `gitea` |
|mariadb.primary.service.port|Port to connect to mariadb service|3306| | `mariadb.primary.service.port` | Port to connect to MariaDB service | `3306` |
|mariadb.primary.persistence.size|Persistence size for mariadb |10Gi| | `mariadb.primary.persistence.size` | Persistence size for MariaDB | `10Gi` |
## Local development & testing ## Local development & testing
For local development and testing of pull requests, the following workflow can be used: For local development and testing of pull requests, the following workflow can
be used:
1. Install `minikube` and `helm`. 1. Install `minikube` and `helm`.
2. Start a `minikube` cluster via `minikube start`. 2. Start a `minikube` cluster via `minikube start`.
3. From the `gitea/helm-chart` directory execute `helm install --dependency-update gitea . -f values.yaml`. 3. From the `gitea/helm-chart` directory execute the following command. This
This will install the dependencies listed in `Chart.yml` and deploy the current state of the helm chart found locally. will install the dependencies listed in `Chart.yml` and deploy the current
If you want to test a branch, make sure to switch to the respective branch first. state of the helm chart found locally. If you want to test a branch, make
4. Gitea is now deployed in `minikube`. sure to switch to the respective branch first.
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`. `helm install --dependency-update gitea . -f values.yaml`.
Now Gitea is accessible at http://localhost:3000. 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).