You've already forked helm-gitea
Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
29c9bbb4bf | |||
75893ad9c6 | |||
a247071b07 | |||
5f8de23c15 | |||
c6fbb6d72e | |||
f108be0cd6 | |||
dc6bab1958 | |||
de1d5af8c8 | |||
46fb4d8026 | |||
3a9e60ce40 | |||
de5a6edbc8 | |||
2ded843924 | |||
ede76d4b68 | |||
00433b97c4 | |||
a20c014e49 | |||
950e46ce44 | |||
8e27bb9bae | |||
f66a192d45 | |||
6814f7f6d9 | |||
cab7f3d0b5 | |||
ca76cc571c | |||
868c029e4d | |||
81252dcb18 | |||
5ed140088e | |||
aa33330abe | |||
b11c9c7568 | |||
5e5496f15d | |||
0ca013647d | |||
9c7e85a2bb | |||
eefa169b8d | |||
e28c1520c0 | |||
55b22d2225 | |||
5876a9e7fc | |||
c274911aab | |||
0861260c5d | |||
d8bb352765 | |||
76e47ef6f0 | |||
95076eb11f | |||
e768a6acdc | |||
7434556b37 | |||
9f0b65f386 | |||
a9779c9724 | |||
c0b2fdf8fa | |||
bfaf822a36 | |||
00395e79b0 | |||
25500d7ca2 | |||
87c59b2fca | |||
6915a4b401 | |||
a0ba3c9bef | |||
0f4e1e488a |
104
.drone.yml
104
.drone.yml
@ -1,104 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: lint
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: helm lint
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.17
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
|
||||||
- helm lint
|
|
||||||
|
|
||||||
- name: helm template
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.17
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
|
||||||
- helm dependency update
|
|
||||||
- helm template --debug gitea-helm .
|
|
||||||
|
|
||||||
- name: helm unittests
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.17
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash
|
|
||||||
- helm plugin install https://github.com/helm-unittest/helm-unittest
|
|
||||||
- helm dependency update
|
|
||||||
- make unittests
|
|
||||||
|
|
||||||
- name: verify readme
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.17
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git
|
|
||||||
- make readme
|
|
||||||
- git diff --exit-code --name-only README.md
|
|
||||||
|
|
||||||
- name: discord
|
|
||||||
pull: always
|
|
||||||
image: appleboy/drone-discord:1.2.4
|
|
||||||
environment:
|
|
||||||
DISCORD_WEBHOOK_ID:
|
|
||||||
from_secret: discord_webhook_id
|
|
||||||
DISCORD_WEBHOOK_TOKEN:
|
|
||||||
from_secret: discord_webhook_token
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: release-version
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: generate-chart
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.17
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
|
||||||
- apk add --no-cache curl
|
|
||||||
- helm dependency update
|
|
||||||
- helm package --version "${DRONE_TAG##v}" ./
|
|
||||||
- mkdir gitea
|
|
||||||
- mv gitea*.tgz gitea/
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: upload-chart
|
|
||||||
pull: always
|
|
||||||
image: plugins/s3:latest
|
|
||||||
settings:
|
|
||||||
acl:
|
|
||||||
from_secret: aws_s3_acl
|
|
||||||
region:
|
|
||||||
from_secret: aws_s3_region
|
|
||||||
bucket:
|
|
||||||
from_secret: aws_s3_bucket
|
|
||||||
endpoint:
|
|
||||||
from_secret: aws_s3_endpoint
|
|
||||||
path_style:
|
|
||||||
from_secret: aws_s3_path_style
|
|
||||||
access_key:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
secret_key:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
source: gitea/*
|
|
||||||
target: /charts
|
|
||||||
strip_prefix: gitea/
|
|
@ -39,3 +39,4 @@
|
|||||||
|
|
||||||
- [ ] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm)
|
- [ ] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm)
|
||||||
- [ ] Breaking changes are documented in the `README.md`
|
- [ ] Breaking changes are documented in the `README.md`
|
||||||
|
- [ ] Templating unittests are added
|
||||||
|
53
.gitea/workflows/release-version.yml
Normal file
53
.gitea/workflows/release-version.yml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
name: generate-chart
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-chart-publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: install tools
|
||||||
|
run: |
|
||||||
|
apt update -y
|
||||||
|
apt install -y curl
|
||||||
|
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list
|
||||||
|
apt update -y
|
||||||
|
apt install -y python helm python3-pip apt-transport-https
|
||||||
|
pip install awscli
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
id: import_gpg
|
||||||
|
uses: https://github.com/crazy-max/ghaction-import-gpg@v5
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
||||||
|
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||||
|
fingerprint: CC64B1DB67ABBEECAB24B6455FC346329753F4B0
|
||||||
|
|
||||||
|
# Using helm gpg plugin as 'helm package --sign' has issues with gpg2: https://github.com/helm/helm/issues/2843
|
||||||
|
- name: package chart
|
||||||
|
run: |
|
||||||
|
# FIXME: use upstream after https://github.com/technosophos/helm-gpg/issues/1 is solved
|
||||||
|
helm plugin install https://github.com/pat-s/helm-gpg
|
||||||
|
helm dependency update
|
||||||
|
helm package --version "${GITHUB_REF#refs/tags/v}" ./
|
||||||
|
helm gpg sign "gitea-${GITHUB_REF#refs/tags/v}.tgz"
|
||||||
|
mkdir gitea
|
||||||
|
mv gitea*.tgz gitea/
|
||||||
|
curl -L -o gitea/index.yaml https://dl.gitea.com/charts/index.yaml
|
||||||
|
helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml
|
||||||
|
|
||||||
|
- name: aws credential configure
|
||||||
|
uses: https://github.com/aws-actions/configure-aws-credentials@v2
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
|
||||||
|
- name: Copy files to S3 and clear cache
|
||||||
|
run: |
|
||||||
|
aws s3 sync gitea/ s3://${{ secrets.AWS_S3_BUCKET}}/charts/
|
36
.gitea/workflows/test-pr.yml
Normal file
36
.gitea/workflows/test-pr.yml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: check-and-test
|
||||||
|
|
||||||
|
on:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-and-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: install tools
|
||||||
|
run: |
|
||||||
|
apt update -y
|
||||||
|
apt install -y curl make
|
||||||
|
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list
|
||||||
|
apt update -y
|
||||||
|
apt install -y helm python3-pip
|
||||||
|
pip install yamllint
|
||||||
|
- name: dependency update
|
||||||
|
run: helm dependency update
|
||||||
|
- name: lint
|
||||||
|
run: helm lint
|
||||||
|
- name: template
|
||||||
|
run: |
|
||||||
|
helm template --debug gitea-helm .
|
||||||
|
- name: unit tests
|
||||||
|
run: |
|
||||||
|
helm plugin install --version 0.3.3 https://github.com/helm-unittest/helm-unittest
|
||||||
|
make unittests
|
||||||
|
- name: verify readme
|
||||||
|
run: |
|
||||||
|
make readme
|
||||||
|
git diff --exit-code --name-only README.md
|
||||||
|
- name: yaml lint
|
||||||
|
uses: https://github.com/ibiqlik/action-yamllint@v3
|
@ -47,7 +47,7 @@ MD013:
|
|||||||
# Number of characters
|
# Number of characters
|
||||||
line_length: 200
|
line_length: 200
|
||||||
# Number of characters for headings
|
# Number of characters for headings
|
||||||
heading_line_length: 80
|
heading_line_length: 100
|
||||||
# Number of characters for code blocks
|
# Number of characters for code blocks
|
||||||
code_block_line_length: 80
|
code_block_line_length: 80
|
||||||
# Include code blocks
|
# Include code blocks
|
||||||
@ -106,7 +106,7 @@ MD030:
|
|||||||
# MD033/no-inline-html - Inline HTML
|
# MD033/no-inline-html - Inline HTML
|
||||||
MD033:
|
MD033:
|
||||||
# Allowed elements
|
# Allowed elements
|
||||||
allowed_elements: []
|
allowed_elements: [details, summary]
|
||||||
|
|
||||||
# MD035/hr-style - Horizontal rule style
|
# MD035/hr-style - Horizontal rule style
|
||||||
MD035:
|
MD035:
|
||||||
@ -129,12 +129,12 @@ MD041:
|
|||||||
MD044:
|
MD044:
|
||||||
# List of proper names
|
# List of proper names
|
||||||
names:
|
names:
|
||||||
- Gitea
|
- Gitea
|
||||||
- PostgreSQL
|
- PostgreSQL
|
||||||
- Memcached
|
- Memcached
|
||||||
- Prometheus
|
- Prometheus
|
||||||
- Git
|
- Git
|
||||||
- GitOps
|
- GitOps
|
||||||
# Include code blocks
|
# Include code blocks
|
||||||
code_blocks: false
|
code_blocks: false
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
.gitea/
|
.gitea/
|
||||||
node_modules/
|
node_modules/
|
||||||
charts/
|
charts/
|
||||||
|
Chart.lock
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
Chart.lock
|
20
.yamllint
Normal file
20
.yamllint
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
ignore: |
|
||||||
|
.yamllint
|
||||||
|
node_modules
|
||||||
|
templates
|
||||||
|
|
||||||
|
|
||||||
|
rules:
|
||||||
|
truthy:
|
||||||
|
allowed-values: ['true', 'false']
|
||||||
|
check-keys: False
|
||||||
|
level: error
|
||||||
|
line-length: disable
|
||||||
|
document-start: disable
|
||||||
|
comments:
|
||||||
|
min-spaces-from-content: 1
|
||||||
|
braces:
|
||||||
|
max-spaces-inside: 2
|
@ -18,12 +18,12 @@ When using Visual Studio Code as IDE, following plugins might be useful:
|
|||||||
|
|
||||||
## Documentation Requirements
|
## Documentation Requirements
|
||||||
|
|
||||||
The `README.md` must include all configuration options. The parameters section
|
The `README.md` must include all configuration options.
|
||||||
is generated by extracting the parameter annotations from the `values.yaml` file,
|
The parameters section is generated by extracting the parameter annotations from the `values.yaml` file, by using [this tool](https://github.com/bitnami-labs/readme-generator-for-helm).
|
||||||
by using [this tool](https://github.com/bitnami-labs/readme-generator-for-helm).
|
|
||||||
|
|
||||||
If changes were made on configuration options, run `make readme` to update the
|
If changes were made on configuration options, run `make readme` to update the README file.
|
||||||
README file.
|
|
||||||
|
The ToC is created via the VSCode [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) extension which can/must also be used used to update it.
|
||||||
|
|
||||||
## Pull Request Requirements
|
## Pull Request Requirements
|
||||||
|
|
||||||
@ -41,16 +41,15 @@ For local development and testing of pull requests, the following workflow can
|
|||||||
be used:
|
be used:
|
||||||
|
|
||||||
1. Install `minikube` and `helm`.
|
1. Install `minikube` and `helm`.
|
||||||
2. Start a `minikube` cluster via `minikube start`.
|
1. Start a `minikube` cluster via `minikube start`.
|
||||||
3. From the `gitea/helm-chart` directory execute the following command. This
|
1. From the `gitea/helm-chart` directory execute the following command.
|
||||||
will install the dependencies listed in `Chart.yml` and deploy the current
|
This will install the dependencies listed in `Chart.yml` and deploy the current state of the helm chart found locally.
|
||||||
state of the helm chart found locally. If you want to test a branch, make
|
If you want to test a branch, make sure to switch to the respective branch first.
|
||||||
sure to switch to the respective branch first.
|
`helm install --dependency-update gitea . -f values.yaml`.
|
||||||
`helm install --dependency-update gitea . -f values.yaml`.
|
1. Gitea is now deployed in `minikube`.
|
||||||
4. Gitea is now deployed in `minikube`. To access it, it's port needs to be
|
To access it, it's port needs to be forwarded first from `minikube` to localhost first via `kubectl --namespace
|
||||||
forwarded first from `minikube` to localhost first via `kubectl --namespace
|
default port-forward svc/gitea-http 3000:3000`.
|
||||||
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
|
Now Gitea is accessible at [http://localhost:3000](http://localhost:3000).
|
||||||
[http://localhost:3000](http://localhost:3000).
|
|
||||||
|
|
||||||
### Unit tests
|
### Unit tests
|
||||||
|
|
||||||
@ -61,3 +60,11 @@ $ helm plugin install https://github.com/helm-unittest/helm-unittest
|
|||||||
# run the unittests
|
# run the unittests
|
||||||
make unittests
|
make unittests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See [plugin documentation](https://github.com/helm-unittest/helm-unittest/blob/v0.3.3/DOCUMENT.md) for usage instructions.
|
||||||
|
|
||||||
|
## Release process
|
||||||
|
|
||||||
|
1. Create a tag following the tagging schema
|
||||||
|
1. Push the tag
|
||||||
|
1. Let CI do it's work
|
||||||
|
15
Chart.lock
15
Chart.lock
@ -1,9 +1,12 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: memcached
|
|
||||||
repository: oci://registry-1.docker.io/bitnamicharts
|
|
||||||
version: 6.3.7
|
|
||||||
- name: postgresql
|
- name: postgresql
|
||||||
repository: oci://registry-1.docker.io/bitnamicharts
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
version: 12.2.6
|
version: 12.6.6
|
||||||
digest: sha256:c2026881f71eca24c72e9da3e798a1ad2a5af8e86a39a5341015584eaacf8b64
|
- name: postgresql-ha
|
||||||
generated: "2023-03-27T19:20:21.125036+02:00"
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 11.7.9
|
||||||
|
- name: redis-cluster
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 8.6.9
|
||||||
|
digest: sha256:52296a48610712a8eb69a32b1b5818b014bfb8dac79d883e11ebdaf97d41e85d
|
||||||
|
generated: "2023-07-17T21:24:06.888357+02:00"
|
||||||
|
29
Chart.yaml
29
Chart.yaml
@ -3,7 +3,7 @@ name: gitea
|
|||||||
description: Gitea Helm chart for Kubernetes
|
description: Gitea Helm chart for Kubernetes
|
||||||
type: application
|
type: application
|
||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
appVersion: 1.19.0
|
appVersion: 1.20.0
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
@ -28,16 +28,23 @@ maintainers:
|
|||||||
email: lucas.hahn@novum-rgi.de
|
email: lucas.hahn@novum-rgi.de
|
||||||
- name: Steven Kriegler
|
- name: Steven Kriegler
|
||||||
email: sk.bunsenbrenner@gmail.com
|
email: sk.bunsenbrenner@gmail.com
|
||||||
|
- name: Patrick Schratz
|
||||||
|
email: patrick.schratz@gmail.com
|
||||||
|
|
||||||
# Bitnami charts are served from GitHub CDN - See https://github.com/bitnami/charts/issues/10539 for details
|
# Bitnami charts are served from GitHub CDN - See https://github.com/bitnami/charts/issues/10539 for details
|
||||||
dependencies:
|
dependencies:
|
||||||
# OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html (2023-01)
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/postgresql/Chart.yaml)
|
||||||
# Chart release date: 2023-02
|
- name: postgresql
|
||||||
- name: memcached
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
repository: oci://registry-1.docker.io/bitnamicharts
|
version: 12.6.6
|
||||||
version: 6.3.7
|
condition: postgresql.enabled
|
||||||
condition: memcached.enabled
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml)
|
||||||
- name: postgresql
|
- name: postgresql-ha
|
||||||
repository: oci://registry-1.docker.io/bitnamicharts
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
version: 12.2.6
|
version: 11.7.9
|
||||||
condition: postgresql.enabled
|
condition: postgresql-ha.enabled
|
||||||
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/redis-cluster/Chart.yaml)
|
||||||
|
- name: redis-cluster
|
||||||
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 8.6.9
|
||||||
|
condition: redis-cluster.enabled
|
||||||
|
5
Makefile
5
Makefile
@ -10,3 +10,8 @@ readme: prepare-environment
|
|||||||
.PHONY: unittests
|
.PHONY: unittests
|
||||||
unittests:
|
unittests:
|
||||||
helm unittest --strict -f 'unittests/**/*.yaml' ./
|
helm unittest --strict -f 'unittests/**/*.yaml' ./
|
||||||
|
|
||||||
|
.PHONY: helm
|
||||||
|
update-helm-dependencies:
|
||||||
|
helm dependency update
|
||||||
|
|
175
docs/ha-setup.md
Normal file
175
docs/ha-setup.md
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
# High Availability
|
||||||
|
|
||||||
|
⚠️ **EXPERIMENTAL** ⚠️
|
||||||
|
|
||||||
|
All components (in-memory DB, volume/asset storage, code indexer) used by Gitea must be deployed in a HA-ready fashion to achieve a full HA-ready Gitea deployment.
|
||||||
|
The following document explains how to achieve this for all individual components.
|
||||||
|
|
||||||
|
The resulting Gitea deployment will consist of ~ 10 pods (depending on the chosen components and their replicas).
|
||||||
|
One should evaluate upfront whether a HA-deployment is required as switching between HA/non-HA comes with some effort.
|
||||||
|
For production instances, HA is always recommended to increase uptime and have a frictionless update process.
|
||||||
|
|
||||||
|
A general comment about chart dependencies and external services:
|
||||||
|
Instead of relying on chart dependencies, it is often better to rely on an external, (managed) instances (in-memory database, asset storage provider, database, etc.).
|
||||||
|
Many cloud providers offer such services, at least for databases or in-memory databases.
|
||||||
|
They might cost a bit more than using a self-hosted k8s variant but are usually easier to maintain and scale, if needed.
|
||||||
|
Also they can be centrally managed and are not linked to the Gitea helm chart or namespace.
|
||||||
|
Please consider using external services before you start with your Gitea HA setup, it will make your life (and the life of the Gitea maintainers) easier.
|
||||||
|
|
||||||
|
This helm chart tries to help as much as possible to simplify and assert the provisioning of a HA-ready Gitea instance by implementing smart conditionals if `replicaCount` is set to a value > 1.
|
||||||
|
Nevertheless, we cannot guarantee for every possible combination of Gitea settings to work together perfectly in a HA setup.
|
||||||
|
As a general advice, we recommend to have a test environment aside on which to test possible changes/upgrades before applying these to a production installation.
|
||||||
|
|
||||||
|
## Requirements for HA
|
||||||
|
|
||||||
|
Storage-wise, the HA-Gitea setup requires a RWX file-system which can be shared among the deployment-based replica pods.
|
||||||
|
In addition, the following components are required for full HA-readiness:
|
||||||
|
|
||||||
|
- A HA-ready issue (and optionally code) indexer: `elasticsearch` or `meilisearch`
|
||||||
|
- A HA-ready external object/asset storage (`minio`) (optional, assets can also be stored on the RWX file-system)
|
||||||
|
- A HA-ready cache (`redis-cluster`)
|
||||||
|
- A HA-ready DB
|
||||||
|
|
||||||
|
`postgres.enabled`, which default to `true`, must be set to `false` for a HA setup.
|
||||||
|
The default `postgres` chart dependency is not HA-ready (there's a dedicated `postgres-ha` chart).
|
||||||
|
|
||||||
|
The following sections discuss each of the components in more detail.
|
||||||
|
Note that for each component discussed, the shown configurations only provides a (working) starting point, not necessarily the most optimal setup.
|
||||||
|
We try to optimize this document over time as we have gained more experience with HA setups from users.
|
||||||
|
|
||||||
|
## Indexers (Issues and code/repo)
|
||||||
|
|
||||||
|
The default code indexer `bleve` is not able to allow multiple connections and hence cannot be used in a HA setup.
|
||||||
|
Alternatives are `elasticsearch` and `meilisearch` (as of >= 1.19.2).
|
||||||
|
Unless you have an existing `elasticsearch` cluster, we recommend using `meilisearch` as it is faster and requires way less resources.
|
||||||
|
|
||||||
|
Unfortunately, `meilisearch` does only support the `ISSUE_INDEXER` and not the `REPO_INDEXER` yet ([tracking issue](https://github.com/go-gitea/gitea/pull/24149)).
|
||||||
|
This means that the `REPO_INDEXER` must still be disabled for a HA setup right now.
|
||||||
|
An alternative to the two options above for the `ISSUE_INDEXER` is `"db"`, however we recommend to just go with `meilisearch` in this case and to not bother the DB with indexing.
|
||||||
|
|
||||||
|
To configure `meilisearch` within Gitea, do the following:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
gitea:
|
||||||
|
config:
|
||||||
|
indexer:
|
||||||
|
ISSUE_INDEXER_CONN_STR: <http://meilisearch.<namespace>.svc.cluster.local:7700>
|
||||||
|
ISSUE_INDEXER_ENABLED: true
|
||||||
|
ISSUE_INDEXER_TYPE: meilisearch
|
||||||
|
REPO_INDEXER_ENABLED: false
|
||||||
|
# REPO_INDEXER_TYPE: meilisearch # not yet working
|
||||||
|
```
|
||||||
|
|
||||||
|
Unfortunately `meilisearch` cannot be deployed in HA as of now.
|
||||||
|
Nevertheless it allows for multiple Gitea requests at the same time and is therefore required in a HA setup.
|
||||||
|
|
||||||
|
Exemplary configuration for the [meilisearch-kubernetes](https://github.com/meilisearch/meilisearch-kubernetes/tree/main/charts/meilisearch) chart:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 5Gi
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cache, session and queue
|
||||||
|
|
||||||
|
A `redis` instance is required for the in-memory cache.
|
||||||
|
Two options exist:
|
||||||
|
|
||||||
|
- `redis`
|
||||||
|
- `redis-cluster`
|
||||||
|
|
||||||
|
The chart provides `redis-cluster` as a dependency as this one can be used for both HA and non-HA setups.
|
||||||
|
You're also welcome to go with `redis` if you prefer or already have a running instance.
|
||||||
|
|
||||||
|
It should be noted that `redis-cluster` support is only available starting with Gitea 1.19.2.
|
||||||
|
You can also configure an external (managed) `redis` instance to be used.
|
||||||
|
To do so, you need to set the following configuration values yourself:
|
||||||
|
|
||||||
|
- `gitea.config.queue.TYPE`: redis`
|
||||||
|
- `gitea.config.queue.CONN_STR`: `<your redis connection string>`
|
||||||
|
|
||||||
|
- `gitea.config.session.PROVIDER`: `redis`
|
||||||
|
- `gitea.config.session.PROVIDER_CONFIG`: `<your redis connection string>`
|
||||||
|
|
||||||
|
- `gitea.config.cache.ENABLED`: `true`
|
||||||
|
- `gitea.config.cache.ADAPTER`: `redis`
|
||||||
|
- `gitea.config.cache.HOST`: `<your redis connection string>`
|
||||||
|
|
||||||
|
## Object and asset storage
|
||||||
|
|
||||||
|
Object/asset storage refers to the storage of attachments, avatars, LFS files, etc.
|
||||||
|
While most of these can be stored on the RWX file-system, it is recommended to use an external S3-compatible object storage for such, mainly for performance reasons.
|
||||||
|
|
||||||
|
By default the chart provisions a single RWO volume to store everything (repos, avatars, packages, etc.).
|
||||||
|
This volume cannot be mounted by multiple pods.
|
||||||
|
Hence, a RWX volume is required and (optionally) an external HA-ready object storage.
|
||||||
|
|
||||||
|
> **Note:** Double-check that the file permissions are set correctly on the RWX volume! That is everything should be owned by the `git` user which usually has `uid=1000` and `gid=1000`.
|
||||||
|
|
||||||
|
To use `minio` you need to deploy and configure an external `minio` instance yourself and explicitly define the `STORAGE_TYPE` values as shown below.
|
||||||
|
|
||||||
|
Note that `MINIO_BUCKET` here is just a name and does not refer to a S3 bucket.
|
||||||
|
It's the root access point for all objects belonging to the respective application, i.e., to Gitea in this case.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
config:
|
||||||
|
attachment:
|
||||||
|
STORAGE_TYPE: minio
|
||||||
|
lfs:
|
||||||
|
STORAGE_TYPE: minio
|
||||||
|
picture:
|
||||||
|
AVATAR_STORAGE_TYPE: minio
|
||||||
|
"storage.packages":
|
||||||
|
STORAGE_TYPE: minio
|
||||||
|
|
||||||
|
storage:
|
||||||
|
MINIO_ENDPOINT: <minio-headless.<namespace>.svc.cluster.local:9000>
|
||||||
|
MINIO_LOCATION: <location>
|
||||||
|
MINIO_ACCESS_KEY_ID: <access key>
|
||||||
|
MINIO_SECRET_ACCESS_KEY: <secret key>
|
||||||
|
MINIO_BUCKET: <bucket name>
|
||||||
|
MINIO_USE_SSL: false
|
||||||
|
```
|
||||||
|
|
||||||
|
Exemplary configuration for the [bitnami minio](https://github.com/bitnami/charts/blob/main/bitnami/minio) chart:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
auth:
|
||||||
|
rootUser: minio
|
||||||
|
mode: distributed
|
||||||
|
replicaCount: 4
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
size: 20Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
```
|
||||||
|
|
||||||
|
## Database
|
||||||
|
|
||||||
|
If you do not have an HA-ready DB, using a managed database service in the cloud might be the easiest and most robust solution.
|
||||||
|
Remember: disable the built-in `postgres` dependency and configure the database connection manually via `gitea.config.database`:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
gitea:
|
||||||
|
database:
|
||||||
|
builtIn:
|
||||||
|
postgresql:
|
||||||
|
enabled: false
|
||||||
|
config:
|
||||||
|
database:
|
||||||
|
DB_TYPE: postgres
|
||||||
|
HOST: <host>
|
||||||
|
NAME: <name>
|
||||||
|
USER: <user>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Known issues
|
||||||
|
|
||||||
|
- Currently Cron jobs are run on all replicas as no leader election is implemented.
|
||||||
|
See [https://github.com/go-gitea/gitea/issues/13791](https://github.com/go-gitea/gitea/issues/13791) for a discussion and possible solution.
|
||||||
|
|
||||||
|
- Running with multiple replicas slows down Gitea a bit, i.e. page loading time increases.
|
920
package-lock.json
generated
920
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@
|
|||||||
"readme:parameters": "readme-generator -v values.yaml -r README.md"
|
"readme:parameters": "readme-generator -v values.yaml -r README.md"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@bitnami/readme-generator-for-helm": "^2.4.2",
|
"@bitnami/readme-generator-for-helm": "^2.5.0",
|
||||||
"markdownlint-cli": "^0.31.1"
|
"markdownlint-cli": "^0.34.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,27 @@
|
|||||||
{{/*
|
{{/*
|
||||||
Expand the name of the chart.
|
Expand the name of the chart.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- /* multiple replicas assertions */ -}}
|
||||||
|
{{- if gt .Values.replicaCount 1.0 -}}
|
||||||
|
{{- fail "When using multiple replicas, a RWX file system is required" -}}
|
||||||
|
{{- if eq (get (.Values.persistence.accessModes 0) "ReadWriteOnce") -}}
|
||||||
|
{{- fail "When using multiple replicas, a RWX file system is required" -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq (get .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE") "bleve" -}}
|
||||||
|
{{- fail "When using multiple replicas, the repo indexer must be set to 'meilisearch' or 'elasticsearch'" -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and (eq .Values.gitea.config.indexer.REPO_INDEXER_TYPE "bleve") (eq .Values.gitea.config.indexer.REPO_INDEXER_ENABLED "true") -}}
|
||||||
|
{{- fail "When using multiple replicas, the repo indexer must be set to 'meilisearch' or 'elasticsearch'" -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq .Values.gitea.config.indexer.ISSUE_INDEXER_TYPE "bleve" -}}
|
||||||
|
{{- (printf "DEBUG: When using multiple replicas, the repo indexer must be set to 'meilisearch' or 'elasticsearch'") | fail -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- define "gitea.name" -}}
|
{{- define "gitea.name" -}}
|
||||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -92,11 +113,25 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "postgresql.dns" -}}
|
{{- define "postgresql.dns" -}}
|
||||||
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.service.ports.postgresql -}}
|
{{- printf "%s-postgresql-ha-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "service" "ports" "postgresql") -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "memcached.dns" -}}
|
{{- define "redis.dns" -}}
|
||||||
{{- printf "%s-memcached.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}}
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
|
{{- printf "redis+cluster://:%s@%s-redis-cluster-headless.%s.svc.%s:%g/0?pool_size=100&idle_timeout=180s&" (index .Values "redis-cluster").global.redis.password .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "redis-cluster").service.ports.redis -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "redis.port" -}}
|
||||||
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
|
{{ (index .Values "redis-cluster").service.ports.redis }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "redis.servicename" -}}
|
||||||
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
|
{{- printf "%s-redis-cluster-headless.%s.svc.%s" .Release.Name .Release.Namespace .Values.clusterDomain -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.default_domain" -}}
|
{{- define "gitea.default_domain" -}}
|
||||||
@ -182,6 +217,7 @@ https
|
|||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- (printf "Key %s cannot be on top level of configuration" $key) | fail -}}
|
{{- (printf "Key %s cannot be on top level of configuration" $key) | fail -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@ -211,6 +247,18 @@ https
|
|||||||
{{- if not (hasKey .Values.gitea.config "oauth2") -}}
|
{{- if not (hasKey .Values.gitea.config "oauth2") -}}
|
||||||
{{- $_ := set .Values.gitea.config "oauth2" dict -}}
|
{{- $_ := set .Values.gitea.config "oauth2" dict -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config "session") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "session" dict -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config "queue") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "queue" dict -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config "queue.issue_indexer") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "queue.issue_indexer" dict -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config "indexer") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "indexer" dict -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.inline_configuration.defaults" -}}
|
{{- define "gitea.inline_configuration.defaults" -}}
|
||||||
@ -226,13 +274,27 @@ https
|
|||||||
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}}
|
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}}
|
||||||
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}}
|
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if .Values.memcached.enabled -}}
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
{{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}}
|
{{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}}
|
||||||
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "memcache" -}}
|
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}}
|
||||||
{{- if not (.Values.gitea.config.cache.HOST) -}}
|
{{- if not (.Values.gitea.config.cache.HOST) -}}
|
||||||
{{- $_ := set .Values.gitea.config.cache "HOST" (include "memcached.dns" .) -}}
|
{{- $_ := set .Values.gitea.config.cache "HOST" (include "redis.dns" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- /* redis queue */ -}}
|
||||||
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.queue "TYPE" "redis" -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.queue "CONN_STR" (include "redis.dns" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (get .Values.gitea.config.session "PROVIDER") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.session "PROVIDER" "redis" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (get .Values.gitea.config.session "PROVIDER_CONFIG") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.session "PROVIDER_CONFIG" (include "redis.dns" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not .Values.gitea.config.indexer.ISSUE_INDEXER_TYPE -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE" "db" -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.inline_configuration.defaults.server" -}}
|
{{- define "gitea.inline_configuration.defaults.server" -}}
|
||||||
@ -279,30 +341,14 @@ https
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.inline_configuration.defaults.database" -}}
|
{{- define "gitea.inline_configuration.defaults.database" -}}
|
||||||
{{- if .Values.postgresql.enabled -}}
|
{{- if (index .Values "postgresql-ha" "enabled") -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
||||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.auth.database -}}
|
{{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql" "database") -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.auth.username -}}
|
{{- $_ := set .Values.gitea.config.database "USER" (index .Values "postgresql-ha" "global" "postgresql" "username") -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.auth.password -}}
|
{{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql" "password") -}}
|
||||||
{{- else if .Values.mysql.enabled -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
|
||||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "mysql.dns" .) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mysql.db.name -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.mysql.db.user -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mysql.db.password -}}
|
|
||||||
{{- else if .Values.mariadb.enabled -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
|
||||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "mariadb.dns" .) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mariadb.auth.database -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.auth.username -}}
|
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
@ -327,3 +373,7 @@ https
|
|||||||
{{- define "gitea.gpg-key-secret-name" -}}
|
{{- define "gitea.gpg-key-secret-name" -}}
|
||||||
{{ default (printf "%s-gpg-key" (include "gitea.fullname" .)) .Values.signing.existingSecret }}
|
{{ default (printf "%s-gpg-key" (include "gitea.fullname" .)) .Values.signing.existingSecret }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.serviceAccountName" -}}
|
||||||
|
{{ .Values.serviceAccount.name | default (include "gitea.fullname" .) }}
|
||||||
|
{{- end -}}
|
||||||
|
@ -16,6 +16,32 @@ metadata:
|
|||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
|
assertions: |
|
||||||
|
{{- /* multiple replicas assertions */ -}}
|
||||||
|
{{- if gt .Values.replicaCount 1.0 -}}
|
||||||
|
{{- if .Values.gitea.config.cron.GIT_GC_REPOS -}}
|
||||||
|
{{- if .Values.gitea.config.cron.GIT_GC_REPOS.enabled -}}
|
||||||
|
{{- fail "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'GIT_GC_REPOS.enabled = false'." -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq (first .Values.persistence.accessModes) "ReadWriteOnce" -}}
|
||||||
|
{{- fail "When using multiple replicas, a RWX file system is required and gitea.persistence.accessModes[0] must be set to ReadWriteMany." -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq (get .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE") "bleve" -}}
|
||||||
|
{{- fail "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)." -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.gitea.config.indexer.REPO_INDEXER_TYPE -}}
|
||||||
|
{{- if eq (get .Values.gitea.config.indexer "REPO_INDEXER_TYPE") "bleve" -}}
|
||||||
|
{{- if .Values.gitea.config.indexer.REPO_INDEXER_ENABLED -}}
|
||||||
|
{{- if eq (get .Values.gitea.config.indexer "REPO_INDEXER_ENABLED") "true" -}}
|
||||||
|
{{- fail "When using multiple replicas, the repo indexer (gitea.config.indexer.REPO_INDEXER_TYPE) must be set to 'meilisearch' or 'elasticsearch' or disabled." -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
config_environment.sh: |-
|
config_environment.sh: |-
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@ -53,14 +79,14 @@ stringData:
|
|||||||
env2ini::log " + '${setting}'"
|
env2ini::log " + '${setting}'"
|
||||||
|
|
||||||
if [[ -z "${section}" ]]; then
|
if [[ -z "${section}" ]]; then
|
||||||
export "ENV_TO_INI____${setting^^}=${value}" # '^^' makes the variable content uppercase
|
export "GITEA____${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local masked_section="${section//./_0X2E_}" # '//' instructs to replace all matches
|
local masked_section="${section//./_0X2E_}" # '//' instructs to replace all matches
|
||||||
masked_section="${masked_section//-/_0X2D_}"
|
masked_section="${masked_section//-/_0X2D_}"
|
||||||
|
|
||||||
export "ENV_TO_INI__${masked_section^^}__${setting^^}=${value}" # '^^' makes the variable content uppercase
|
export "GITEA__${masked_section^^}__${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||||
}
|
}
|
||||||
|
|
||||||
function env2ini::reload_preset_envs() {
|
function env2ini::reload_preset_envs() {
|
||||||
@ -134,15 +160,16 @@ stringData:
|
|||||||
# - initially used to set up Gitea
|
# - initially used to set up Gitea
|
||||||
# Anyway, they won't harm existing app.ini files
|
# Anyway, they won't harm existing app.ini files
|
||||||
|
|
||||||
export ENV_TO_INI__SECURITY__INTERNAL_TOKEN=$(gitea generate secret INTERNAL_TOKEN)
|
export GITEA__SECURITY__INTERNAL_TOKEN=$(gitea generate secret INTERNAL_TOKEN)
|
||||||
export ENV_TO_INI__SECURITY__SECRET_KEY=$(gitea generate secret SECRET_KEY)
|
export GITEA__SECURITY__SECRET_KEY=$(gitea generate secret SECRET_KEY)
|
||||||
export ENV_TO_INI__OAUTH2__JWT_SECRET=$(gitea generate secret JWT_SECRET)
|
export GITEA__OAUTH2__JWT_SECRET=$(gitea generate secret JWT_SECRET)
|
||||||
export ENV_TO_INI__SERVER__LFS_JWT_SECRET=$(gitea generate secret LFS_JWT_SECRET)
|
export GITEA__SERVER__LFS_JWT_SECRET=$(gitea generate secret LFS_JWT_SECRET)
|
||||||
|
|
||||||
env2ini::log "...Initial secrets generated\n"
|
env2ini::log "...Initial secrets generated\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
env | (grep ENV_TO_INI || [[ $? == 1 ]]) > /tmp/existing-envs
|
# save existing envs prior to script execution. Necessary to keep order of preexisting and custom envs
|
||||||
|
env | (grep GITEA || [[ $? == 1 ]]) > /tmp/existing-envs
|
||||||
|
|
||||||
# MUST BE CALLED BEFORE OTHER CONFIGURATION
|
# MUST BE CALLED BEFORE OTHER CONFIGURATION
|
||||||
env2ini::generate_initial_secrets
|
env2ini::generate_initial_secrets
|
||||||
@ -163,10 +190,10 @@ stringData:
|
|||||||
env2ini::log ' - oauth2.JWT_SECRET'
|
env2ini::log ' - oauth2.JWT_SECRET'
|
||||||
env2ini::log ' - server.LFS_JWT_SECRET'
|
env2ini::log ' - server.LFS_JWT_SECRET'
|
||||||
|
|
||||||
unset ENV_TO_INI__SECURITY__INTERNAL_TOKEN
|
unset GITEA__SECURITY__INTERNAL_TOKEN
|
||||||
unset ENV_TO_INI__SECURITY__SECRET_KEY
|
unset GITEA__SECURITY__SECRET_KEY
|
||||||
unset ENV_TO_INI__OAUTH2__JWT_SECRET
|
unset GITEA__OAUTH2__JWT_SECRET
|
||||||
unset ENV_TO_INI__SERVER__LFS_JWT_SECRET
|
unset GITEA__SERVER__LFS_JWT_SECRET
|
||||||
fi
|
fi
|
||||||
|
|
||||||
environment-to-ini -o $GITEA_APP_INI -p ENV_TO_INI
|
environment-to-ini -o $GITEA_APP_INI
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "gitea.fullname" . }}
|
name: {{ include "gitea.fullname" . }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.statefulset.annotations }}
|
{{- if .Values.deployment.annotations }}
|
||||||
{{- toYaml .Values.statefulset.annotations | nindent 4 }}
|
{{- toYaml .Values.deployment.annotations | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.replicaCount }}
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
strategy:
|
||||||
|
type: {{ .Values.strategy.type }}
|
||||||
|
{{- if eq .Values.strategy.type "RollingUpdate" }}
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: {{ .Values.strategy.rollingUpdate.maxUnavailable }}
|
||||||
|
maxSurge: {{ .Values.strategy.rollingUpdate.maxSurge }}
|
||||||
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
{{- if .Values.statefulset.labels }}
|
{{- if .Values.deployment.labels }}
|
||||||
{{- toYaml .Values.statefulset.labels | nindent 6 }}
|
{{- toYaml .Values.deployment.labels | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceName: {{ include "gitea.fullname" . }}
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@ -32,13 +38,19 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "gitea.labels" . | nindent 8 }}
|
{{- include "gitea.labels" . | nindent 8 }}
|
||||||
{{- if .Values.statefulset.labels }}
|
{{- if .Values.deployment.labels }}
|
||||||
{{- toYaml .Values.statefulset.labels | nindent 8 }}
|
{{- toYaml .Values.deployment.labels | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
{{- if .Values.schedulerName }}
|
{{- if .Values.schedulerName }}
|
||||||
schedulerName: "{{ .Values.schedulerName }}"
|
schedulerName: "{{ .Values.schedulerName }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if (or .Values.serviceAccount.create .Values.serviceAccount.name) }}
|
||||||
|
serviceAccountName: {{ include "gitea.serviceAccountName" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.priorityClassName }}
|
||||||
|
priorityClassName: "{{ .Values.priorityClassName }}"
|
||||||
|
{{- end }}
|
||||||
{{- include "gitea.images.pullSecrets" . | nindent 6 }}
|
{{- include "gitea.images.pullSecrets" . | nindent 6 }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
@ -56,8 +68,8 @@ spec:
|
|||||||
value: /data
|
value: /data
|
||||||
- name: GITEA_TEMP
|
- name: GITEA_TEMP
|
||||||
value: /tmp/gitea
|
value: /tmp/gitea
|
||||||
{{- if .Values.statefulset.env }}
|
{{- if .Values.deployment.env }}
|
||||||
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.signing.enabled }}
|
{{- if .Values.signing.enabled }}
|
||||||
- name: GNUPGHOME
|
- name: GNUPGHOME
|
||||||
@ -76,6 +88,8 @@ spec:
|
|||||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||||
- name: init-app-ini
|
- name: init-app-ini
|
||||||
image: "{{ include "gitea.image" . }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
@ -89,8 +103,8 @@ spec:
|
|||||||
value: /data
|
value: /data
|
||||||
- name: GITEA_TEMP
|
- name: GITEA_TEMP
|
||||||
value: /tmp/gitea
|
value: /tmp/gitea
|
||||||
{{- if .Values.statefulset.env }}
|
{{- if .Values.deployment.env }}
|
||||||
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.gitea.additionalConfigFromEnvs }}
|
{{- if .Values.gitea.additionalConfigFromEnvs }}
|
||||||
{{- toYaml .Values.gitea.additionalConfigFromEnvs | nindent 12 }}
|
{{- toYaml .Values.gitea.additionalConfigFromEnvs | nindent 12 }}
|
||||||
@ -114,6 +128,8 @@ spec:
|
|||||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||||
{{- if .Values.signing.enabled }}
|
{{- if .Values.signing.enabled }}
|
||||||
- name: configure-gpg
|
- name: configure-gpg
|
||||||
image: "{{ include "gitea.image" . }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
@ -143,6 +159,8 @@ spec:
|
|||||||
{{- if .Values.extraVolumeMounts }}
|
{{- if .Values.extraVolumeMounts }}
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: configure-gitea
|
- name: configure-gitea
|
||||||
image: "{{ include "gitea.image" . }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
@ -164,6 +182,10 @@ spec:
|
|||||||
value: /data
|
value: /data
|
||||||
- name: GITEA_TEMP
|
- name: GITEA_TEMP
|
||||||
value: /tmp/gitea
|
value: /tmp/gitea
|
||||||
|
{{- if .Values.image.rootless }}
|
||||||
|
- name: HOME
|
||||||
|
value: /data/gitea/git
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.gitea.ldap }}
|
{{- if .Values.gitea.ldap }}
|
||||||
{{- range $idx, $value := .Values.gitea.ldap }}
|
{{- range $idx, $value := .Values.gitea.ldap }}
|
||||||
{{- if $value.existingSecret }}
|
{{- if $value.existingSecret }}
|
||||||
@ -218,8 +240,8 @@ spec:
|
|||||||
- name: GITEA_ADMIN_PASSWORD
|
- name: GITEA_ADMIN_PASSWORD
|
||||||
value: {{ .Values.gitea.admin.password | quote }}
|
value: {{ .Values.gitea.admin.password | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.statefulset.env }}
|
{{- if .Values.deployment.env }}
|
||||||
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
@ -232,7 +254,9 @@ spec:
|
|||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
resources:
|
||||||
|
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ include "gitea.image" . }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
@ -257,12 +281,16 @@ spec:
|
|||||||
value: /tmp/gitea
|
value: /tmp/gitea
|
||||||
- name: TMPDIR
|
- name: TMPDIR
|
||||||
value: /tmp/gitea
|
value: /tmp/gitea
|
||||||
|
{{- if .Values.image.rootless }}
|
||||||
|
- name: HOME
|
||||||
|
value: /data/gitea/git
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.signing.enabled }}
|
{{- if .Values.signing.enabled }}
|
||||||
- name: GNUPGHOME
|
- name: GNUPGHOME
|
||||||
value: {{ .Values.signing.gpgHome }}
|
value: {{ .Values.signing.gpgHome }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.statefulset.env }}
|
{{- if .Values.deployment.env }}
|
||||||
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: ssh
|
- name: ssh
|
||||||
@ -318,6 +346,10 @@ spec:
|
|||||||
affinity:
|
affinity:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.tolerations }}
|
{{- with .Values.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -356,38 +388,13 @@ spec:
|
|||||||
path: private.asc
|
path: private.asc
|
||||||
defaultMode: 0100
|
defaultMode: 0100
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
{{- if .Values.persistence.enabled }}
|
||||||
|
{{- if .Values.persistence.mount }}
|
||||||
- name: data
|
- name: data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
{{- with .Values.persistence.existingClaim }}
|
claimName: {{ .Values.persistence.claimName }}
|
||||||
claimName: {{ tpl . $ }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
{{- else if not .Values.persistence.enabled }}
|
{{- else if not .Values.persistence.enabled }}
|
||||||
- name: data
|
- name: data
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: data
|
|
||||||
{{- with .Values.persistence.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{- range $key, $value := . }}
|
|
||||||
{{ $key }}: {{ $value }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.persistence.labels }}
|
|
||||||
labels:
|
|
||||||
{{- range $key, $value := . }}
|
|
||||||
{{ $key }}: {{ $value }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
{{- range .Values.persistence.accessModes }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- include "gitea.persistence.storageClass" . | indent 8 }}
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.persistence.size | quote }}
|
|
||||||
{{- end }}
|
{{- end }}
|
8
templates/gitea/extra-list.yaml
Normal file
8
templates/gitea/extra-list.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{{- range .Values.extraDeploy }}
|
||||||
|
---
|
||||||
|
{{- if typeIs "string" . }}
|
||||||
|
{{- tpl . $ }}
|
||||||
|
{{- else }}
|
||||||
|
{{- tpl (. | toYaml) $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -61,6 +61,27 @@ stringData:
|
|||||||
echo "Gitea migrate might fail due to database connection...This init-container will try again in a few seconds"
|
echo "Gitea migrate might fail due to database connection...This init-container will try again in a few seconds"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{- if include "redis.servicename" . }}
|
||||||
|
function test_redis_connection() {
|
||||||
|
local RETRY=0
|
||||||
|
local MAX=30
|
||||||
|
|
||||||
|
echo 'Wait for redis to become avialable...'
|
||||||
|
until [ "${RETRY}" -ge "${MAX}" ]; do
|
||||||
|
nc -vz -w2 {{ include "redis.servicename" . }} {{ include "redis.port" . }} && break
|
||||||
|
RETRY=$[${RETRY}+1]
|
||||||
|
echo "...not ready yet (${RETRY}/${MAX})"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${RETRY}" -ge "${MAX}" ]; then
|
||||||
|
echo "Redis not reachable after '${MAX}' attempts!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
test_redis_connection
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
{{- if or .Values.gitea.admin.existingSecret (and .Values.gitea.admin.username .Values.gitea.admin.password) }}
|
{{- if or .Values.gitea.admin.existingSecret (and .Values.gitea.admin.username .Values.gitea.admin.password) }}
|
||||||
|
17
templates/gitea/poddisruptionbudget.yaml
Normal file
17
templates/gitea/poddisruptionbudget.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{- if .Values.podDisruptionBudget -}}
|
||||||
|
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
|
||||||
|
apiVersion: policy/v1
|
||||||
|
{{- else }}
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
{{- end }}
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
|
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
|
||||||
|
{{- end -}}
|
24
templates/gitea/pvc.yaml
Normal file
24
templates/gitea/pvc.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{{- if and .Values.persistence.enabled .Values.persistence.create }}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.persistence.claimName }}
|
||||||
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
annotations:
|
||||||
|
{{ .Values.persistence.annotations | toYaml | indent 4}}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- if gt .Values.replicaCount 1.0 }}
|
||||||
|
- ReadWriteMany
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.persistence.accessModes | toYaml | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMode: Filesystem
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass }}
|
||||||
|
{{- end }}
|
||||||
|
volumeName: ""
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
{{- end }}
|
21
templates/gitea/serviceaccount.yaml
Normal file
21
templates/gitea/serviceaccount.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace | quote }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.serviceAccount.labels }}
|
||||||
|
{{- . | toYaml | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- . | toYaml | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||||
|
{{- with .Values.serviceAccount.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -39,7 +39,9 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- name: ssh
|
- name: ssh
|
||||||
port: {{ .Values.service.ssh.port }}
|
port: {{ .Values.service.ssh.port }}
|
||||||
|
{{- if .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
||||||
targetPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
targetPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
||||||
|
{{- end }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
{{- if .Values.service.ssh.nodePort }}
|
{{- if .Values.service.ssh.nodePort }}
|
||||||
nodePort: {{ .Values.service.ssh.nodePort }}
|
nodePort: {{ .Values.service.ssh.nodePort }}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
suite: Statefulset template (basic)
|
suite: deployment template (basic)
|
||||||
release:
|
release:
|
||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/statefulset.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders a statefulset
|
- it: renders a deployment
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 1
|
count: 1
|
||||||
- containsDocument:
|
- containsDocument:
|
||||||
kind: StatefulSet
|
kind: Deployment
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
name: gitea-unittests
|
name: gitea-unittests
|
@ -1,13 +1,13 @@
|
|||||||
suite: Statefulset template (signing disabled)
|
suite: deployment template (signing disabled)
|
||||||
release:
|
release:
|
||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/statefulset.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: skips gpg init container
|
- it: skips gpg init container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- notContains:
|
- notContains:
|
||||||
path: spec.template.spec.initContainers
|
path: spec.template.spec.initContainers
|
||||||
@ -15,24 +15,24 @@ tests:
|
|||||||
content:
|
content:
|
||||||
name: configure-gpg
|
name: configure-gpg
|
||||||
- it: skips gpg env in `init-directories` init container
|
- it: skips gpg env in `init-directories` init container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing.enabled: true
|
signing.enabled: false
|
||||||
asserts:
|
asserts:
|
||||||
- contains:
|
- notContains:
|
||||||
path: spec.template.spec.initContainers[0].env
|
path: spec.template.spec.initContainers[0].env
|
||||||
content:
|
content:
|
||||||
name: GNUPGHOME
|
name: GNUPGHOME
|
||||||
value: /data/git/.gnupg
|
value: /data/git/.gnupg
|
||||||
- it: skips gpg env in runtime container
|
- it: skips gpg env in runtime container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- notContains:
|
- notContains:
|
||||||
path: spec.template.spec.containers[0].env
|
path: spec.template.spec.containers[0].env
|
||||||
content:
|
content:
|
||||||
name: GNUPGHOME
|
name: GNUPGHOME
|
||||||
- it: skips gpg volume spec
|
- it: skips gpg volume spec
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- notContains:
|
- notContains:
|
||||||
path: spec.template.spec.volumes
|
path: spec.template.spec.volumes
|
@ -1,13 +1,13 @@
|
|||||||
suite: Statefulset template (signing enabled)
|
suite: deployment template (signing enabled)
|
||||||
release:
|
release:
|
||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/statefulset.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: adds gpg init container
|
- it: adds gpg init container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing:
|
signing:
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -39,9 +39,10 @@ tests:
|
|||||||
mountPath: /raw
|
mountPath: /raw
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- it: adds gpg env in `init-directories` init container
|
- it: adds gpg env in `init-directories` init container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing.enabled: true
|
signing.enabled: true
|
||||||
|
signing.existingSecret: "custom-gpg-secret"
|
||||||
asserts:
|
asserts:
|
||||||
- contains:
|
- contains:
|
||||||
path: spec.template.spec.initContainers[0].env
|
path: spec.template.spec.initContainers[0].env
|
||||||
@ -49,9 +50,10 @@ tests:
|
|||||||
name: GNUPGHOME
|
name: GNUPGHOME
|
||||||
value: /data/git/.gnupg
|
value: /data/git/.gnupg
|
||||||
- it: adds gpg env in runtime container
|
- it: adds gpg env in runtime container
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing.enabled: true
|
signing.enabled: true
|
||||||
|
signing.existingSecret: "custom-gpg-secret"
|
||||||
asserts:
|
asserts:
|
||||||
- contains:
|
- contains:
|
||||||
path: spec.template.spec.containers[0].env
|
path: spec.template.spec.containers[0].env
|
||||||
@ -59,10 +61,11 @@ tests:
|
|||||||
name: GNUPGHOME
|
name: GNUPGHOME
|
||||||
value: /data/git/.gnupg
|
value: /data/git/.gnupg
|
||||||
- it: adds gpg volume spec
|
- it: adds gpg volume spec
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing:
|
signing:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
existingSecret: "gitea-unittests-gpg-key"
|
||||||
asserts:
|
asserts:
|
||||||
- contains:
|
- contains:
|
||||||
path: spec.template.spec.volumes
|
path: spec.template.spec.volumes
|
||||||
@ -75,7 +78,7 @@ tests:
|
|||||||
path: private.asc
|
path: private.asc
|
||||||
defaultMode: 0100
|
defaultMode: 0100
|
||||||
- it: supports gpg volume spec with external reference
|
- it: supports gpg volume spec with external reference
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
signing:
|
signing:
|
||||||
enabled: true
|
enabled: true
|
@ -1,13 +1,13 @@
|
|||||||
suite: Statefulset template (SSH configuration)
|
suite: deployment template (SSH configuration)
|
||||||
release:
|
release:
|
||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/statefulset.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: supports defining SSH log level for root based image
|
- it: supports defining SSH log level for root based image
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
image.rootless: false
|
image.rootless: false
|
||||||
asserts:
|
asserts:
|
||||||
@ -17,7 +17,7 @@ tests:
|
|||||||
name: SSH_LOG_LEVEL
|
name: SSH_LOG_LEVEL
|
||||||
value: "INFO"
|
value: "INFO"
|
||||||
- it: supports overriding SSH log level
|
- it: supports overriding SSH log level
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
image.rootless: false
|
image.rootless: false
|
||||||
gitea.ssh.logLevel: "DEBUG"
|
gitea.ssh.logLevel: "DEBUG"
|
||||||
@ -28,7 +28,7 @@ tests:
|
|||||||
name: SSH_LOG_LEVEL
|
name: SSH_LOG_LEVEL
|
||||||
value: "DEBUG"
|
value: "DEBUG"
|
||||||
- it: skips SSH_LOG_LEVEL for rootless image
|
- it: skips SSH_LOG_LEVEL for rootless image
|
||||||
template: templates/gitea/statefulset.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
set:
|
set:
|
||||||
image.rootless: true
|
image.rootless: true
|
||||||
gitea.ssh.logLevel: "DEBUG" # explicitly defining a non-standard level here
|
gitea.ssh.logLevel: "DEBUG" # explicitly defining a non-standard level here
|
@ -10,6 +10,6 @@ tests:
|
|||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 1
|
count: 1
|
||||||
- containsDocument:
|
- containsDocument:
|
||||||
kind: Secret
|
kind: Secret
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: gitea-unittests-init
|
name: gitea-unittests-init
|
||||||
|
68
unittests/init/init_directory_structure.sh-rootless.yaml
Normal file
68
unittests/init/init_directory_structure.sh-rootless.yaml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
suite: Init template
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/init.yaml
|
||||||
|
tests:
|
||||||
|
- it: runs gpg in batch mode
|
||||||
|
set:
|
||||||
|
signing.enabled: true
|
||||||
|
signing.privateKey: |-
|
||||||
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
{placeholder}
|
||||||
|
-----END PGP PRIVATE KEY BLOCK-----
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: stringData["configure_gpg_environment.sh"]
|
||||||
|
value: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
gpg --batch --import /raw/private.asc
|
||||||
|
- it: skips gpg script block for disabled signing
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: stringData["init_directory_structure.sh"]
|
||||||
|
value: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
set -x
|
||||||
|
mkdir -p /data/git/.ssh
|
||||||
|
chmod -R 700 /data/git/.ssh
|
||||||
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
||||||
|
|
||||||
|
# prepare temp directory structure
|
||||||
|
mkdir -p "${GITEA_TEMP}"
|
||||||
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
- it: adds gpg script block for enabled signing
|
||||||
|
set:
|
||||||
|
signing.enabled: true
|
||||||
|
signing.privateKey: |-
|
||||||
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
{placeholder}
|
||||||
|
-----END PGP PRIVATE KEY BLOCK-----
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: stringData["init_directory_structure.sh"]
|
||||||
|
value: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
set -x
|
||||||
|
mkdir -p /data/git/.ssh
|
||||||
|
chmod -R 700 /data/git/.ssh
|
||||||
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
||||||
|
|
||||||
|
# prepare temp directory structure
|
||||||
|
mkdir -p "${GITEA_TEMP}"
|
||||||
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
|
mkdir -p "${GNUPGHOME}"
|
||||||
|
chmod 700 "${GNUPGHOME}"
|
||||||
|
chown 1000:1000 "${GNUPGHOME}"
|
||||||
|
fi
|
@ -7,7 +7,12 @@ templates:
|
|||||||
tests:
|
tests:
|
||||||
- it: runs gpg in batch mode
|
- it: runs gpg in batch mode
|
||||||
set:
|
set:
|
||||||
|
image.rootless: false
|
||||||
signing.enabled: true
|
signing.enabled: true
|
||||||
|
signing.privateKey: |-
|
||||||
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
{placeholder}
|
||||||
|
-----END PGP PRIVATE KEY BLOCK-----
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: stringData["configure_gpg_environment.sh"]
|
path: stringData["configure_gpg_environment.sh"]
|
||||||
@ -17,6 +22,8 @@ tests:
|
|||||||
|
|
||||||
gpg --batch --import /raw/private.asc
|
gpg --batch --import /raw/private.asc
|
||||||
- it: skips gpg script block for disabled signing
|
- it: skips gpg script block for disabled signing
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: stringData["init_directory_structure.sh"]
|
path: stringData["init_directory_structure.sh"]
|
||||||
@ -37,7 +44,12 @@ tests:
|
|||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
- it: adds gpg script block for enabled signing
|
- it: adds gpg script block for enabled signing
|
||||||
set:
|
set:
|
||||||
|
image.rootless: false
|
||||||
signing.enabled: true
|
signing.enabled: true
|
||||||
|
signing.privateKey: |-
|
||||||
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
{placeholder}
|
||||||
|
-----END PGP PRIVATE KEY BLOCK-----
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: stringData["init_directory_structure.sh"]
|
path: stringData["init_directory_structure.sh"]
|
||||||
|
82
unittests/serviceaccount/basic.yaml
Normal file
82
unittests/serviceaccount/basic.yaml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
suite: ServiceAccount template (basic)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/serviceaccount.yaml
|
||||||
|
tests:
|
||||||
|
- it: skips rendering by default
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
- it: renders default ServiceAccount object with serviceAccount.create=true
|
||||||
|
set:
|
||||||
|
serviceAccount.create: true
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- containsDocument:
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
|
name: gitea-unittests
|
||||||
|
- equal:
|
||||||
|
path: automountServiceAccountToken
|
||||||
|
value: false
|
||||||
|
- notExists:
|
||||||
|
path: imagePullSecrets
|
||||||
|
- notExists:
|
||||||
|
path: metadata.annotations
|
||||||
|
- it: allows for adding custom labels
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
labels:
|
||||||
|
custom: label
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: metadata.labels.custom
|
||||||
|
value: label
|
||||||
|
- it: allows for adding custom annotations
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
annotations:
|
||||||
|
myCustom: annotation
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: metadata.annotations.myCustom
|
||||||
|
value: annotation
|
||||||
|
- it: allows to override the generated name
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
name: provided-serviceaccount-name
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: metadata.name
|
||||||
|
value: provided-serviceaccount-name
|
||||||
|
- it: allows to mount the token
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
automountServiceAccountToken: true
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: automountServiceAccountToken
|
||||||
|
value: true
|
||||||
|
- it: allows to reference image pull secrets
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: testing-image-pull-secret
|
||||||
|
- name: another-pull-secret
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: imagePullSecrets
|
||||||
|
content:
|
||||||
|
name: testing-image-pull-secret
|
||||||
|
- contains:
|
||||||
|
path: imagePullSecrets
|
||||||
|
content:
|
||||||
|
name: another-pull-secret
|
32
unittests/serviceaccount/reference.yaml
Normal file
32
unittests/serviceaccount/reference.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
suite: ServiceAccount template (reference)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/serviceaccount.yaml
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: does not modify the deployment by default
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- notExists:
|
||||||
|
path: spec.serviceAccountName
|
||||||
|
- it: adds the reference to the deployment with serviceAccount.create=true
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
serviceAccount.create: true
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.serviceAccountName
|
||||||
|
value: gitea-unittests
|
||||||
|
- it: allows referencing an externally created ServiceAccount to the deployment
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
serviceAccount:
|
||||||
|
create: false # explicitly set to define rendering behavior
|
||||||
|
name: "externally-existing-serviceaccount"
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.serviceAccountName
|
||||||
|
value: externally-existing-serviceaccount
|
166
values.yaml
166
values.yaml
@ -20,9 +20,19 @@ global:
|
|||||||
# hostnames:
|
# hostnames:
|
||||||
# - example.com
|
# - example.com
|
||||||
|
|
||||||
## @param replicaCount number of replicas for the statefulset
|
## @param replicaCount number of replicas for the deployment
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
|
## @section strategy
|
||||||
|
## @param strategy.type strategy type
|
||||||
|
## @param strategy.rollingUpdate.maxSurge maxSurge
|
||||||
|
## @param strategy.rollingUpdate.maxUnavailable maxUnavailable
|
||||||
|
strategy:
|
||||||
|
type: "RollingUpdate"
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: "100%"
|
||||||
|
maxUnavailable: 0
|
||||||
|
|
||||||
## @param clusterDomain cluster domain
|
## @param clusterDomain cluster domain
|
||||||
clusterDomain: cluster.local
|
clusterDomain: cluster.local
|
||||||
|
|
||||||
@ -38,7 +48,7 @@ image:
|
|||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: ""
|
tag: ""
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
rootless: false # only possible when running 1.14 or later
|
rootless: true
|
||||||
|
|
||||||
## @param imagePullSecrets Secret to use for pulling the image
|
## @param imagePullSecrets Secret to use for pulling the image
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
@ -74,11 +84,16 @@ containerSecurityContext: {}
|
|||||||
## @param securityContext Run init and Gitea containers as a specific securityContext
|
## @param securityContext Run init and Gitea containers as a specific securityContext
|
||||||
securityContext: {}
|
securityContext: {}
|
||||||
|
|
||||||
|
## @param podDisruptionBudget Pod disruption budget
|
||||||
|
podDisruptionBudget: {}
|
||||||
|
# maxUnavailable: 1
|
||||||
|
# minAvailable: 1
|
||||||
|
|
||||||
## @section Service
|
## @section Service
|
||||||
service:
|
service:
|
||||||
## @param service.http.type Kubernetes service type for web traffic
|
## @param service.http.type Kubernetes service type for web traffic
|
||||||
## @param service.http.port Port number for web traffic
|
## @param service.http.port Port number for web traffic
|
||||||
## @param service.http.clusterIP ClusterIP setting for http autosetup for statefulset is None
|
## @param service.http.clusterIP ClusterIP setting for http autosetup for deployment is None
|
||||||
## @param service.http.loadBalancerIP LoadBalancer IP setting
|
## @param service.http.loadBalancerIP LoadBalancer IP setting
|
||||||
## @param service.http.nodePort NodePort for http service
|
## @param service.http.nodePort NodePort for http service
|
||||||
## @param service.http.externalTrafficPolicy If `service.http.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation
|
## @param service.http.externalTrafficPolicy If `service.http.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation
|
||||||
@ -101,7 +116,7 @@ service:
|
|||||||
annotations: {}
|
annotations: {}
|
||||||
## @param service.ssh.type Kubernetes service type for ssh traffic
|
## @param service.ssh.type Kubernetes service type for ssh traffic
|
||||||
## @param service.ssh.port Port number for ssh traffic
|
## @param service.ssh.port Port number for ssh traffic
|
||||||
## @param service.ssh.clusterIP ClusterIP setting for ssh autosetup for statefulset is None
|
## @param service.ssh.clusterIP ClusterIP setting for ssh autosetup for deployment is None
|
||||||
## @param service.ssh.loadBalancerIP LoadBalancer IP setting
|
## @param service.ssh.loadBalancerIP LoadBalancer IP setting
|
||||||
## @param service.ssh.nodePort NodePort for ssh service
|
## @param service.ssh.nodePort NodePort for ssh service
|
||||||
## @param service.ssh.externalTrafficPolicy If `service.ssh.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation
|
## @param service.ssh.externalTrafficPolicy If `service.ssh.type` is `NodePort` or `LoadBalancer`, set this to `Local` to enable source IP preservation
|
||||||
@ -138,7 +153,8 @@ ingress:
|
|||||||
enabled: false
|
enabled: false
|
||||||
# className: nginx
|
# className: nginx
|
||||||
className:
|
className:
|
||||||
annotations: {}
|
annotations:
|
||||||
|
{}
|
||||||
# kubernetes.io/ingress.class: nginx
|
# kubernetes.io/ingress.class: nginx
|
||||||
# kubernetes.io/tls-acme: "true"
|
# kubernetes.io/tls-acme: "true"
|
||||||
hosts:
|
hosts:
|
||||||
@ -154,10 +170,11 @@ ingress:
|
|||||||
# If helm doesn't correctly detect your ingress API version you can set it here.
|
# If helm doesn't correctly detect your ingress API version you can set it here.
|
||||||
# apiVersion: networking.k8s.io/v1
|
# apiVersion: networking.k8s.io/v1
|
||||||
|
|
||||||
## @section StatefulSet
|
## @section deployment
|
||||||
#
|
#
|
||||||
## @param resources Kubernetes resources
|
## @param resources Kubernetes resources
|
||||||
resources: {}
|
resources:
|
||||||
|
{}
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
@ -175,34 +192,60 @@ resources: {}
|
|||||||
## @param schedulerName Use an alternate scheduler, e.g. "stork"
|
## @param schedulerName Use an alternate scheduler, e.g. "stork"
|
||||||
schedulerName: ""
|
schedulerName: ""
|
||||||
|
|
||||||
## @param nodeSelector NodeSelector for the statefulset
|
## @param nodeSelector NodeSelector for the deployment
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
## @param tolerations Tolerations for the statefulset
|
## @param tolerations Tolerations for the deployment
|
||||||
tolerations: []
|
tolerations: []
|
||||||
|
|
||||||
## @param affinity Affinity for the statefulset
|
## @param affinity Affinity for the deployment
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
## @param dnsConfig dnsConfig for the statefulset
|
## @param topologySpreadConstraints TopologySpreadConstraints for the deployment
|
||||||
|
topologySpreadConstraints: []
|
||||||
|
|
||||||
|
## @param dnsConfig dnsConfig for the deployment
|
||||||
dnsConfig: {}
|
dnsConfig: {}
|
||||||
|
|
||||||
## @param statefulset.env Additional environment variables to pass to containers
|
## @param priorityClassName priorityClassName for the deployment
|
||||||
## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod
|
priorityClassName: ""
|
||||||
## @param statefulset.labels Labels for the statefulset
|
|
||||||
## @param statefulset.annotations Annotations for the Gitea StatefulSet to be created
|
## @param deployment.env Additional environment variables to pass to containers
|
||||||
statefulset:
|
## @param deployment.terminationGracePeriodSeconds How long to wait until forcefully kill the pod
|
||||||
env: []
|
## @param deployment.labels Labels for the deployment
|
||||||
|
## @param deployment.annotations Annotations for the Gitea deployment to be created
|
||||||
|
deployment:
|
||||||
|
env:
|
||||||
|
[]
|
||||||
# - name: VARIABLE
|
# - name: VARIABLE
|
||||||
# value: my-value
|
# value: my-value
|
||||||
terminationGracePeriodSeconds: 60
|
terminationGracePeriodSeconds: 60
|
||||||
labels: {}
|
labels: {}
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
## @section ServiceAccount
|
||||||
|
|
||||||
|
## @param serviceAccount.create Enable the creation of a ServiceAccount
|
||||||
|
## @param serviceAccount.name Name of the created ServiceAccount, defaults to release name. Can also link to an externally provided ServiceAccount that should be used.
|
||||||
|
## @param serviceAccount.automountServiceAccountToken Enable/disable auto mounting of the service account token
|
||||||
|
## @param serviceAccount.imagePullSecrets Image pull secrets, available to the ServiceAccount
|
||||||
|
## @param serviceAccount.annotations Custom annotations for the ServiceAccount
|
||||||
|
## @param serviceAccount.labels Custom labels for the ServiceAccount
|
||||||
|
serviceAccount:
|
||||||
|
create: false
|
||||||
|
name: ""
|
||||||
|
automountServiceAccountToken: false
|
||||||
|
imagePullSecrets: []
|
||||||
|
# - name: private-registry-access
|
||||||
|
annotations: {}
|
||||||
|
labels: {}
|
||||||
|
|
||||||
## @section Persistence
|
## @section Persistence
|
||||||
#
|
#
|
||||||
## @param persistence.enabled Enable persistent storage
|
## @param persistence.enabled Enable persistent storage
|
||||||
## @param persistence.existingClaim Use an existing claim to store repository information
|
## @param persistence.create Whether to create the persistentVolumeClaim for shared storage
|
||||||
|
## @param persistence.mount Whether the persistentVolumeClaim should be mounted (even if not created)
|
||||||
|
## @param persistence.claimName Use an existing claim to store repository information
|
||||||
## @param persistence.size Size for persistence to store repo information
|
## @param persistence.size Size for persistence to store repo information
|
||||||
## @param persistence.accessModes AccessMode for persistence
|
## @param persistence.accessModes AccessMode for persistence
|
||||||
## @param persistence.labels Labels for the persistence volume claim to be created
|
## @param persistence.labels Labels for the persistence volume claim to be created
|
||||||
@ -211,7 +254,9 @@ statefulset:
|
|||||||
## @param persistence.subPath Subdirectory of the volume to mount at
|
## @param persistence.subPath Subdirectory of the volume to mount at
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
existingClaim:
|
create: true
|
||||||
|
mount: true
|
||||||
|
claimName: gitea-shared-storage
|
||||||
size: 10Gi
|
size: 10Gi
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
@ -220,7 +265,7 @@ persistence:
|
|||||||
storageClass:
|
storageClass:
|
||||||
subPath:
|
subPath:
|
||||||
|
|
||||||
## @param extraVolumes Additional volumes to mount to the Gitea statefulset
|
## @param extraVolumes Additional volumes to mount to the Gitea deployment
|
||||||
extraVolumes: []
|
extraVolumes: []
|
||||||
# - name: postgres-ssl-vol
|
# - name: postgres-ssl-vol
|
||||||
# secret:
|
# secret:
|
||||||
@ -252,6 +297,16 @@ initPreScript: ""
|
|||||||
# chown -R git:git /data/git/.postgresql/
|
# chown -R git:git /data/git/.postgresql/
|
||||||
# chmod 400 /data/git/.postgresql/postgresql.key
|
# chmod 400 /data/git/.postgresql/postgresql.key
|
||||||
|
|
||||||
|
## @param initContainers.resources.limits initContainers.limits Kubernetes resource limits for init containers
|
||||||
|
## @param initContainers.resources.requests.cpu initContainers.requests.cpu Kubernetes cpu resource limits for init containers
|
||||||
|
## @param initContainers.resources.requests.memory initContainers.requests.memory Kubernetes memory resource limits for init containers
|
||||||
|
initContainers:
|
||||||
|
resources:
|
||||||
|
limits: {}
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
|
||||||
# Configure commit/action signing prerequisites
|
# Configure commit/action signing prerequisites
|
||||||
## @section Signing
|
## @section Signing
|
||||||
#
|
#
|
||||||
@ -277,7 +332,7 @@ gitea:
|
|||||||
## @param gitea.admin.password Password for the Gitea admin user
|
## @param gitea.admin.password Password for the Gitea admin user
|
||||||
## @param gitea.admin.email Email for the Gitea admin user
|
## @param gitea.admin.email Email for the Gitea admin user
|
||||||
admin:
|
admin:
|
||||||
#existingSecret: gitea-admin-secret
|
# existingSecret: gitea-admin-secret
|
||||||
existingSecret:
|
existingSecret:
|
||||||
username: gitea_admin
|
username: gitea_admin
|
||||||
password: r8sA8CPHD9!bt6d
|
password: r8sA8CPHD9!bt6d
|
||||||
@ -293,7 +348,8 @@ gitea:
|
|||||||
# prometheus-release: prom1
|
# prometheus-release: prom1
|
||||||
|
|
||||||
## @param gitea.ldap LDAP configuration
|
## @param gitea.ldap LDAP configuration
|
||||||
ldap: []
|
ldap:
|
||||||
|
[]
|
||||||
# - name: "LDAP 1"
|
# - name: "LDAP 1"
|
||||||
# existingSecret:
|
# existingSecret:
|
||||||
# securityProtocol:
|
# securityProtocol:
|
||||||
@ -310,7 +366,8 @@ gitea:
|
|||||||
|
|
||||||
# Either specify inline `key` and `secret` or refer to them via `existingSecret`
|
# Either specify inline `key` and `secret` or refer to them via `existingSecret`
|
||||||
## @param gitea.oauth OAuth configuration
|
## @param gitea.oauth OAuth configuration
|
||||||
oauth: []
|
oauth:
|
||||||
|
[]
|
||||||
# - name: 'OAuth 1'
|
# - name: 'OAuth 1'
|
||||||
# provider:
|
# provider:
|
||||||
# key:
|
# key:
|
||||||
@ -323,13 +380,14 @@ gitea:
|
|||||||
# customProfileUrl:
|
# customProfileUrl:
|
||||||
# customEmailUrl:
|
# customEmailUrl:
|
||||||
|
|
||||||
## @param gitea.config Configuration for the Gitea server,ref: [config-cheat-sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
|
## @param gitea.config.server.SSH_PORT SSH port for rootlful Gitea image
|
||||||
config: {}
|
## @param gitea.config.server.SSH_LISTEN_PORT SSH port for rootless Gitea image
|
||||||
# APP_NAME: "Gitea: Git with a cup of tea"
|
config:
|
||||||
# RUN_MODE: dev
|
# APP_NAME: "Gitea: Git with a cup of tea"
|
||||||
#
|
# RUN_MODE: dev
|
||||||
# server:
|
server:
|
||||||
# SSH_PORT: 22
|
SSH_PORT: 22 # rootful image
|
||||||
|
SSH_LISTEN_PORT: 2222 # rootless image
|
||||||
#
|
#
|
||||||
# security:
|
# security:
|
||||||
# PASSWORD_COMPLEXITY: spec
|
# PASSWORD_COMPLEXITY: spec
|
||||||
@ -411,25 +469,53 @@ gitea:
|
|||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
failureThreshold: 10
|
failureThreshold: 10
|
||||||
|
|
||||||
## @section Memcached
|
## @section redis-cluster
|
||||||
#
|
## @param redis-cluster.enabled Enable redis
|
||||||
## @param 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.
|
## @param redis-cluster.global.redis.password Password for the "gitea" user (overrides `password`)
|
||||||
## @param memcached.service.port Port for Memcached
|
redis-cluster:
|
||||||
memcached:
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
global:
|
||||||
|
redis:
|
||||||
|
password: gitea
|
||||||
|
|
||||||
|
## @section postgresql-ha
|
||||||
|
#
|
||||||
|
## @param postgresql-ha.enabled Enable postgresql-ha
|
||||||
|
## @param postgresql-ha.global.postgresql.password Password for the `gitea` user (overrides `auth.password`)
|
||||||
|
## @param postgresql-ha.global.postgresql.database Name for a custom database to create (overrides `auth.database`)
|
||||||
|
## @param postgresql-ha.global.postgresql.username Name for a custom user to create (overrides `auth.username`)
|
||||||
|
## @param postgresql-ha.global.postgresql.postgresPassword Postgres Password
|
||||||
|
## @param postgresql-ha.global.postgresql.repmgrPassword Repmgr Password
|
||||||
|
## @param postgresql-ha.service.ports.postgresql postgresql service port (overrides `service.ports.postgresql`)
|
||||||
|
## @param postgresql-ha.primary.persistence.size PVC Storage Request for postgresql-ha volume
|
||||||
|
postgresql-ha:
|
||||||
|
enabled: true
|
||||||
|
global:
|
||||||
|
postgresql:
|
||||||
|
password: gitea
|
||||||
|
database: gitea
|
||||||
|
username: gitea
|
||||||
|
# FIXME: https://github.com/bitnami/charts/issues/17052
|
||||||
|
postgresPassword: changeme
|
||||||
|
# FIXME: https://github.com/bitnami/charts/issues/17052
|
||||||
|
repmgrPassword: changeme
|
||||||
service:
|
service:
|
||||||
port: 11211
|
ports:
|
||||||
|
postgresql: 5432
|
||||||
|
primary:
|
||||||
|
persistence:
|
||||||
|
size: 10Gi
|
||||||
|
|
||||||
## @section PostgreSQL
|
## @section PostgreSQL
|
||||||
#
|
#
|
||||||
## @param postgresql.enabled Enable PostgreSQL
|
## @param postgresql.enabled Enable PostgreSQL
|
||||||
## @param postgresql.global.postgresql.auth.password Password for the "gitea" user (overrides `auth.password`)
|
## @param postgresql.global.postgresql.auth.password Password for the `gitea` user (overrides `auth.password`)
|
||||||
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`)
|
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`)
|
||||||
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`)
|
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`)
|
||||||
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`)
|
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`)
|
||||||
## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume
|
## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume
|
||||||
postgresql:
|
postgresql:
|
||||||
enabled: true
|
enabled: false
|
||||||
global:
|
global:
|
||||||
postgresql:
|
postgresql:
|
||||||
auth:
|
auth:
|
||||||
@ -456,3 +542,7 @@ test:
|
|||||||
image:
|
image:
|
||||||
name: busybox
|
name: busybox
|
||||||
tag: latest
|
tag: latest
|
||||||
|
|
||||||
|
## @param extraDeploy Array of extra objects to deploy with the release
|
||||||
|
##
|
||||||
|
extraDeploy: []
|
||||||
|
Reference in New Issue
Block a user