You've already forked helm-gitea
Compare commits
69 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
fb5c615f61 | |||
ae9a71ea11 | |||
5cb0802b7b | |||
fdac9e9048 | |||
1be9fae08b | |||
4869aed6ad | |||
9a6cb4d357 | |||
452aeadddf | |||
c46bf7c60f | |||
18100cca11 | |||
b6d275c4f5 | |||
578a6cb867 | |||
01bb9b4a77 | |||
513ad81228 | |||
e47edbddf9 | |||
da4120809f | |||
83c184826b | |||
ccec32c144 | |||
19e9b07e6e | |||
8b6a00603a | |||
6574b1b232 | |||
4f7bc17d34 | |||
279bacb941 | |||
9ed671d685 | |||
d5ce1a47ea | |||
57a1cd27d9 | |||
6c59fe361d | |||
d1f5dca573 | |||
b8f0310c43 | |||
0d1f748898 | |||
6e5ae5c912 |
87
.drone.yml
87
.drone.yml
@ -1,87 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: lint
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: helm lint
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.16
|
|
||||||
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.16
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
|
||||||
- helm dependency update
|
|
||||||
- helm template --debug gitea-helm .
|
|
||||||
|
|
||||||
- name: verify readme
|
|
||||||
pull: always
|
|
||||||
image: alpine:3.16
|
|
||||||
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.16
|
|
||||||
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:
|
|
||||||
bucket: gitea-artifacts
|
|
||||||
endpoint: https://ams3.digitaloceanspaces.com
|
|
||||||
access_key:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
secret_key:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
source: gitea/*
|
|
||||||
target: /charts
|
|
||||||
strip_prefix: gitea/
|
|
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = false
|
@ -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
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
charts/
|
charts/
|
||||||
node_modules/
|
node_modules/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
unittests/*/__snapshot__/
|
||||||
|
@ -25,3 +25,9 @@ node_modules/
|
|||||||
package.json
|
package.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.gitea/
|
.gitea/
|
||||||
|
Makefile
|
||||||
|
.markdownlintignore
|
||||||
|
.markdownlint.yaml
|
||||||
|
.drone.yml
|
||||||
|
CONTRIBUTING.md
|
||||||
|
unittests/
|
||||||
|
@ -45,9 +45,9 @@ MD012:
|
|||||||
# MD013/line-length - Line length
|
# MD013/line-length - Line length
|
||||||
MD013:
|
MD013:
|
||||||
# Number of characters
|
# Number of characters
|
||||||
line_length: 80
|
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,14 +129,12 @@ MD041:
|
|||||||
MD044:
|
MD044:
|
||||||
# List of proper names
|
# List of proper names
|
||||||
names:
|
names:
|
||||||
- Gitea
|
- Gitea
|
||||||
- PostgreSQL
|
- PostgreSQL
|
||||||
- MariaDB
|
- Memcached
|
||||||
- MySQL
|
- Prometheus
|
||||||
- Memcached
|
- Git
|
||||||
- Prometheus
|
- GitOps
|
||||||
- Git
|
|
||||||
- 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
|
@ -14,15 +14,16 @@ When using Visual Studio Code as IDE, following plugins might be useful:
|
|||||||
- [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)
|
- [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)
|
||||||
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
||||||
- [Helm Intellisense](https://marketplace.visualstudio.com/items?itemName=Tim-Koehler.helm-intellisense)
|
- [Helm Intellisense](https://marketplace.visualstudio.com/items?itemName=Tim-Koehler.helm-intellisense)
|
||||||
|
- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
@ -40,13 +41,30 @@ 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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# install the unittest plugin
|
||||||
|
$ helm plugin install https://github.com/helm-unittest/helm-unittest
|
||||||
|
|
||||||
|
# run the 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
|
23
Chart.lock
23
Chart.lock
@ -1,15 +1,12 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: memcached
|
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
|
||||||
version: 5.9.0
|
|
||||||
- name: mysql
|
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
|
||||||
version: 6.14.10
|
|
||||||
- name: postgresql
|
- name: postgresql
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
version: 10.3.17
|
version: 12.6.6
|
||||||
- name: mariadb
|
- name: postgresql-ha
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
version: 9.3.6
|
version: 11.7.9
|
||||||
digest: sha256:08f967276fa0c083e9756a974a9791a487a71be0a226dc14351b3e5a2641e8fd
|
- name: redis-cluster
|
||||||
generated: "2022-06-11T12:18:36.672047+02:00"
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
|
version: 8.6.9
|
||||||
|
digest: sha256:52296a48610712a8eb69a32b1b5818b014bfb8dac79d883e11ebdaf97d41e85d
|
||||||
|
generated: "2023-07-17T21:24:06.888357+02:00"
|
||||||
|
35
Chart.yaml
35
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.17.2
|
appVersion: 1.20.0
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
@ -28,22 +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:
|
||||||
- name: memcached
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/postgresql/Chart.yaml)
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
- name: postgresql
|
||||||
version: 5.9.0
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
condition: memcached.enabled
|
version: 12.6.6
|
||||||
- name: mysql
|
condition: postgresql.enabled
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml)
|
||||||
version: 6.14.10
|
- name: postgresql-ha
|
||||||
condition: mysql.enabled
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
- name: postgresql
|
version: 11.7.9
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
condition: postgresql-ha.enabled
|
||||||
version: 10.3.17
|
# Chart release date: 2023-07 (https://github.com/bitnami/charts/blob/main/bitnami/redis-cluster/Chart.yaml)
|
||||||
condition: postgresql.enabled
|
- name: redis-cluster
|
||||||
- name: mariadb
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
version: 8.6.9
|
||||||
version: 9.3.6
|
condition: redis-cluster.enabled
|
||||||
condition: mariadb.enabled
|
|
||||||
|
9
Makefile
9
Makefile
@ -6,3 +6,12 @@ prepare-environment:
|
|||||||
readme: prepare-environment
|
readme: prepare-environment
|
||||||
npm run readme:parameters
|
npm run readme:parameters
|
||||||
npm run readme:lint
|
npm run readme:lint
|
||||||
|
|
||||||
|
.PHONY: unittests
|
||||||
|
unittests:
|
||||||
|
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.
|
936
package-lock.json
generated
936
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": {
|
||||||
"markdownlint-cli": "^0.31.1",
|
"@bitnami/readme-generator-for-helm": "^2.5.0",
|
||||||
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main"
|
"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,19 +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.servicePort -}}
|
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.service.ports.postgresql -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mysql.dns" -}}
|
{{- define "redis.dns" -}}
|
||||||
{{- printf "%s-mysql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mysql.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 -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mariadb.dns" -}}
|
{{- define "redis.port" -}}
|
||||||
{{- printf "%s-mariadb.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}}
|
{{- if (index .Values "redis-cluster").enabled -}}
|
||||||
|
{{ (index .Values "redis-cluster").service.ports.redis }}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "memcached.dns" -}}
|
{{- define "redis.servicename" -}}
|
||||||
{{- 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 "%s-redis-cluster-headless.%s.svc.%s" .Release.Name .Release.Namespace .Values.clusterDomain -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.default_domain" -}}
|
{{- define "gitea.default_domain" -}}
|
||||||
@ -190,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 }}
|
||||||
|
|
||||||
@ -219,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" -}}
|
||||||
@ -234,13 +274,30 @@ 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 -}}
|
||||||
|
{{- /* multiple replicas */ -}}
|
||||||
|
{{- if gt .Values.replicaCount 1.0 -}}
|
||||||
|
{{- 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 -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.inline_configuration.defaults.server" -}}
|
{{- define "gitea.inline_configuration.defaults.server" -}}
|
||||||
@ -292,25 +349,9 @@ https
|
|||||||
{{- 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.postgresqlDatabase -}}
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.auth.database -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}}
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.auth.username -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}}
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.auth.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 -}}
|
||||||
|
|
||||||
@ -331,3 +372,11 @@ https
|
|||||||
{{- toYaml .Values.extraVolumeMounts -}}
|
{{- toYaml .Values.extraVolumeMounts -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.gpg-key-secret-name" -}}
|
||||||
|
{{ default (printf "%s-gpg-key" (include "gitea.fullname" .)) .Values.signing.existingSecret }}
|
||||||
|
{{- 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,20 +1,27 @@
|
|||||||
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" . }}
|
serviceName: {{ include "gitea.fullname" . }}
|
||||||
template:
|
template:
|
||||||
@ -32,13 +39,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 +69,12 @@ 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 }}
|
||||||
|
{{- if .Values.signing.enabled }}
|
||||||
|
- name: GNUPGHOME
|
||||||
|
value: {{ .Values.signing.gpgHome }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
@ -72,6 +89,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 }}
|
||||||
@ -85,8 +104,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 }}
|
||||||
@ -110,6 +129,40 @@ 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 }}
|
||||||
|
- name: configure-gpg
|
||||||
|
image: "{{ include "gitea.image" . }}"
|
||||||
|
command: ["/usr/sbin/configure_gpg_environment.sh"]
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
securityContext:
|
||||||
|
{{- /* By default this container runs as user 1000 unless otherwise stated */ -}}
|
||||||
|
{{- $csc := deepCopy .Values.containerSecurityContext -}}
|
||||||
|
{{- if not (hasKey $csc "runAsUser") -}}
|
||||||
|
{{- $_ := set $csc "runAsUser" 1000 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- toYaml $csc | nindent 12 }}
|
||||||
|
env:
|
||||||
|
- name: GNUPGHOME
|
||||||
|
value: {{ .Values.signing.gpgHome }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: init
|
||||||
|
mountPath: /usr/sbin
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
{{- if .Values.persistence.subPath }}
|
||||||
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
- name: gpg-private-key
|
||||||
|
mountPath: /raw
|
||||||
|
readOnly: true
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
- name: configure-gitea
|
- name: configure-gitea
|
||||||
image: "{{ include "gitea.image" . }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
command: ["/usr/sbin/configure_gitea.sh"]
|
command: ["/usr/sbin/configure_gitea.sh"]
|
||||||
@ -130,6 +183,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 }}
|
||||||
@ -184,8 +241,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
|
||||||
@ -198,7 +255,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" . }}"
|
||||||
@ -209,6 +268,10 @@ spec:
|
|||||||
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
||||||
- name: SSH_PORT
|
- name: SSH_PORT
|
||||||
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
|
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
|
||||||
|
{{- if not .Values.image.rootless }}
|
||||||
|
- name: SSH_LOG_LEVEL
|
||||||
|
value: {{ .Values.gitea.ssh.logLevel | quote }}
|
||||||
|
{{- end }}
|
||||||
- name: GITEA_APP_INI
|
- name: GITEA_APP_INI
|
||||||
value: /data/gitea/conf/app.ini
|
value: /data/gitea/conf/app.ini
|
||||||
- name: GITEA_CUSTOM
|
- name: GITEA_CUSTOM
|
||||||
@ -219,12 +282,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
|
||||||
@ -268,6 +335,10 @@ spec:
|
|||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
||||||
|
{{- with .Values.global.hostAliases }}
|
||||||
|
hostAliases:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -276,6 +347,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 }}
|
||||||
@ -305,38 +380,22 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
- name: temp
|
- name: temp
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
{{- if .Values.signing.enabled }}
|
||||||
|
- name: gpg-private-key
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "gitea.gpg-key-secret-name" . }}
|
||||||
|
items:
|
||||||
|
- key: privateKey
|
||||||
|
path: private.asc
|
||||||
|
defaultMode: 0100
|
||||||
|
{{- end }}
|
||||||
|
{{- 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 }}
|
16
templates/gitea/gpg-secret.yaml
Normal file
16
templates/gitea/gpg-secret.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{{- if .Values.signing.enabled -}}
|
||||||
|
{{- if and (empty .Values.signing.privateKey) (empty .Values.signing.existingSecret) -}}
|
||||||
|
{{- fail "Either specify `signing.privateKey` or `signing.existingSecret`" -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (not (empty .Values.signing.privateKey)) (empty .Values.signing.existingSecret) -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.gpg-key-secret-name" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
privateKey: {{ .Values.signing.privateKey | b64enc }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -6,6 +6,11 @@ metadata:
|
|||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
|
configure_gpg_environment.sh: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
gpg --batch --import /raw/private.asc
|
||||||
init_directory_structure.sh: |-
|
init_directory_structure.sh: |-
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
@ -26,7 +31,7 @@ stringData:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
mkdir -p /data/git/.ssh
|
mkdir -p /data/git/.ssh
|
||||||
chmod -R 700 /data/git/.ssh
|
chmod -R 700 /data/git/.ssh
|
||||||
[ ! -d /data/gitea ] && mkdir -p /data/gitea/conf
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -p "${GITEA_TEMP}"
|
||||||
@ -35,6 +40,14 @@ stringData:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
|
{{ if .Values.signing.enabled -}}
|
||||||
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
|
mkdir -p "${GNUPGHOME}"
|
||||||
|
chmod 700 "${GNUPGHOME}"
|
||||||
|
chown 1000:1000 "${GNUPGHOME}"
|
||||||
|
fi
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
configure_gitea.sh: |-
|
configure_gitea.sh: |-
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
@ -48,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,3 +1,4 @@
|
|||||||
|
{{- if .Values.test.enabled }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
@ -9,7 +10,8 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: wget
|
- name: wget
|
||||||
image: busybox
|
image: "{{ .Values.test.image.name }}:{{ .Values.test.image.tag }}"
|
||||||
command: ['wget']
|
command: ['wget']
|
||||||
args: ['{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}']
|
args: ['{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}']
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
{{- end }}
|
||||||
|
17
unittests/deployment/basic.yaml
Normal file
17
unittests/deployment/basic.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
suite: deployment template (basic)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: renders a deployment
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- containsDocument:
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
name: gitea-unittests
|
40
unittests/deployment/signing-disabled.yaml
Normal file
40
unittests/deployment/signing-disabled.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
suite: deployment template (signing disabled)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: skips gpg init container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- notContains:
|
||||||
|
path: spec.template.spec.initContainers
|
||||||
|
any: true
|
||||||
|
content:
|
||||||
|
name: configure-gpg
|
||||||
|
- it: skips gpg env in `init-directories` init container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing.enabled: false
|
||||||
|
asserts:
|
||||||
|
- notContains:
|
||||||
|
path: spec.template.spec.initContainers[0].env
|
||||||
|
content:
|
||||||
|
name: GNUPGHOME
|
||||||
|
value: /data/git/.gnupg
|
||||||
|
- it: skips gpg env in runtime container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- notContains:
|
||||||
|
path: spec.template.spec.containers[0].env
|
||||||
|
content:
|
||||||
|
name: GNUPGHOME
|
||||||
|
- it: skips gpg volume spec
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- notContains:
|
||||||
|
path: spec.template.spec.volumes
|
||||||
|
content:
|
||||||
|
name: gpg-private-key
|
96
unittests/deployment/signing-enabled.yaml
Normal file
96
unittests/deployment/signing-enabled.yaml
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
suite: deployment template (signing enabled)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: adds gpg init container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: "custom-gpg-secret"
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.initContainers[2].name
|
||||||
|
value: configure-gpg
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.initContainers[2].command
|
||||||
|
value: ["/usr/sbin/configure_gpg_environment.sh"]
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.initContainers[2].securityContext
|
||||||
|
value:
|
||||||
|
runAsUser: 1000
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.initContainers[2].env
|
||||||
|
value:
|
||||||
|
- name: GNUPGHOME
|
||||||
|
value: /data/git/.gnupg
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.initContainers[2].volumeMounts
|
||||||
|
value:
|
||||||
|
- name: init
|
||||||
|
mountPath: /usr/sbin
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
- name: gpg-private-key
|
||||||
|
mountPath: /raw
|
||||||
|
readOnly: true
|
||||||
|
- it: adds gpg env in `init-directories` init container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing.enabled: true
|
||||||
|
signing.existingSecret: "custom-gpg-secret"
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.initContainers[0].env
|
||||||
|
content:
|
||||||
|
name: GNUPGHOME
|
||||||
|
value: /data/git/.gnupg
|
||||||
|
- it: adds gpg env in runtime container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing.enabled: true
|
||||||
|
signing.existingSecret: "custom-gpg-secret"
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.containers[0].env
|
||||||
|
content:
|
||||||
|
name: GNUPGHOME
|
||||||
|
value: /data/git/.gnupg
|
||||||
|
- it: adds gpg volume spec
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: "gitea-unittests-gpg-key"
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.volumes
|
||||||
|
content:
|
||||||
|
name: gpg-private-key
|
||||||
|
secret:
|
||||||
|
secretName: gitea-unittests-gpg-key
|
||||||
|
items:
|
||||||
|
- key: privateKey
|
||||||
|
path: private.asc
|
||||||
|
defaultMode: 0100
|
||||||
|
- it: supports gpg volume spec with external reference
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: custom-gpg-secret
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.volumes
|
||||||
|
content:
|
||||||
|
name: gpg-private-key
|
||||||
|
secret:
|
||||||
|
secretName: custom-gpg-secret
|
||||||
|
items:
|
||||||
|
- key: privateKey
|
||||||
|
path: private.asc
|
||||||
|
defaultMode: 0100
|
40
unittests/deployment/ssh-configuration.yaml
Normal file
40
unittests/deployment/ssh-configuration.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
suite: deployment template (SSH configuration)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: supports defining SSH log level for root based image
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.containers[0].env
|
||||||
|
content:
|
||||||
|
name: SSH_LOG_LEVEL
|
||||||
|
value: "INFO"
|
||||||
|
- it: supports overriding SSH log level
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
|
gitea.ssh.logLevel: "DEBUG"
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.containers[0].env
|
||||||
|
content:
|
||||||
|
name: SSH_LOG_LEVEL
|
||||||
|
value: "DEBUG"
|
||||||
|
- it: skips SSH_LOG_LEVEL for rootless image
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
image.rootless: true
|
||||||
|
gitea.ssh.logLevel: "DEBUG" # explicitly defining a non-standard level here
|
||||||
|
asserts:
|
||||||
|
- notContains:
|
||||||
|
path: spec.template.spec.containers[0].env
|
||||||
|
any: true
|
||||||
|
content:
|
||||||
|
name: SSH_LOG_LEVEL
|
13
unittests/gpg-secret/signing-disabled.yaml
Normal file
13
unittests/gpg-secret/signing-disabled.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
suite: GPG secret template (signing disabled)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/gpg-secret.yaml
|
||||||
|
tests:
|
||||||
|
- it: renders nothing
|
||||||
|
set:
|
||||||
|
signing.enabled: false
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
40
unittests/gpg-secret/signing-enabled.yaml
Normal file
40
unittests/gpg-secret/signing-enabled.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
suite: GPG secret template (signing enabled)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/gpg-secret.yaml
|
||||||
|
tests:
|
||||||
|
- it: fails rendering when nothing is configured
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
asserts:
|
||||||
|
- failedTemplate:
|
||||||
|
errorMessage: Either specify `signing.privateKey` or `signing.existingSecret`
|
||||||
|
- it: skips rendering using external secret reference
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
existingSecret: "external-secret-reference"
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
- it: renders secret specification using inline gpg key
|
||||||
|
set:
|
||||||
|
signing:
|
||||||
|
enabled: true
|
||||||
|
privateKey: "gpg-key-placeholder"
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- documentIndex: 0
|
||||||
|
containsDocument:
|
||||||
|
kind: Secret
|
||||||
|
apiVersion: v1
|
||||||
|
name: gitea-unittests-gpg-key
|
||||||
|
- isNotEmpty:
|
||||||
|
path: metadata.labels
|
||||||
|
- equal:
|
||||||
|
path: data.privateKey
|
||||||
|
value: "Z3BnLWtleS1wbGFjZWhvbGRlcg=="
|
15
unittests/init/basic.yaml
Normal file
15
unittests/init/basic.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
suite: Init template (basic)
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/init.yaml
|
||||||
|
tests:
|
||||||
|
- it: renders a secret
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- containsDocument:
|
||||||
|
kind: Secret
|
||||||
|
apiVersion: v1
|
||||||
|
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
|
76
unittests/init/init_directory_structure.sh.yaml
Normal file
76
unittests/init/init_directory_structure.sh.yaml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
suite: Init template
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/init.yaml
|
||||||
|
tests:
|
||||||
|
- it: runs gpg in batch mode
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
|
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
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: stringData["init_directory_structure.sh"]
|
||||||
|
value: |-
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
set -x
|
||||||
|
chown 1000:1000 /data
|
||||||
|
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}"
|
||||||
|
chown 1000:1000 "${GITEA_TEMP}"
|
||||||
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
- it: adds gpg script block for enabled signing
|
||||||
|
set:
|
||||||
|
image.rootless: false
|
||||||
|
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
|
||||||
|
chown 1000:1000 /data
|
||||||
|
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}"
|
||||||
|
chown 1000:1000 "${GITEA_TEMP}"
|
||||||
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
|
mkdir -p "${GNUPGHOME}"
|
||||||
|
chmod 700 "${GNUPGHOME}"
|
||||||
|
chown 1000:1000 "${GNUPGHOME}"
|
||||||
|
fi
|
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
|
255
values.yaml
255
values.yaml
@ -6,6 +6,7 @@
|
|||||||
## @param global.imageRegistry global image registry override
|
## @param global.imageRegistry global image registry override
|
||||||
## @param global.imagePullSecrets global image pull secrets override; can be extended by `imagePullSecrets`
|
## @param global.imagePullSecrets global image pull secrets override; can be extended by `imagePullSecrets`
|
||||||
## @param global.storageClass global storage class override
|
## @param global.storageClass global storage class override
|
||||||
|
## @param global.hostAliases global hostAliases which will be added to the pod's hosts files
|
||||||
global:
|
global:
|
||||||
imageRegistry: ""
|
imageRegistry: ""
|
||||||
## E.g.
|
## E.g.
|
||||||
@ -14,10 +15,24 @@ global:
|
|||||||
##
|
##
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
|
hostAliases: []
|
||||||
|
# - ip: 192.168.137.2
|
||||||
|
# hostnames:
|
||||||
|
# - 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
|
||||||
|
|
||||||
@ -33,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: []
|
||||||
@ -63,17 +78,22 @@ containerSecurityContext: {}
|
|||||||
# runAsNonRoot: true
|
# runAsNonRoot: true
|
||||||
# runAsUser: 1000
|
# runAsUser: 1000
|
||||||
|
|
||||||
## @depracated The securityContext variable has been split two:
|
## @deprecated The securityContext variable has been split two:
|
||||||
## - containerSecurityContext
|
## - containerSecurityContext
|
||||||
## - podSecurityContext.
|
## - podSecurityContext.
|
||||||
## @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
|
||||||
@ -96,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
|
||||||
@ -120,7 +140,6 @@ service:
|
|||||||
loadBalancerSourceRanges: []
|
loadBalancerSourceRanges: []
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
|
||||||
## @section Ingress
|
## @section Ingress
|
||||||
## @param ingress.enabled Enable ingress
|
## @param ingress.enabled Enable ingress
|
||||||
## @param ingress.className Ingress class name
|
## @param ingress.className Ingress class name
|
||||||
@ -134,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:
|
||||||
@ -150,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
|
||||||
@ -171,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
|
||||||
@ -207,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
|
||||||
@ -216,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:
|
||||||
@ -228,7 +277,7 @@ extraContainerVolumeMounts: []
|
|||||||
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
|
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
|
||||||
extraInitVolumeMounts: []
|
extraInitVolumeMounts: []
|
||||||
|
|
||||||
## @depracated The extraVolumeMounts variable has been split two:
|
## @deprecated The extraVolumeMounts variable has been split two:
|
||||||
## - extraContainerVolumeMounts
|
## - extraContainerVolumeMounts
|
||||||
## - extraInitVolumeMounts
|
## - extraInitVolumeMounts
|
||||||
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
|
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
|
||||||
@ -248,14 +297,32 @@ 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
|
||||||
#
|
#
|
||||||
## @param signing.enabled Enable commit/action signing
|
## @param signing.enabled Enable commit/action signing
|
||||||
## @param signing.gpgHome GPG home directory
|
## @param signing.gpgHome GPG home directory
|
||||||
|
## @param signing.privateKey Inline private gpg key for signed Gitea actions
|
||||||
|
## @param signing.existingSecret Use an existing secret to store the value of `signing.privateKey`
|
||||||
signing:
|
signing:
|
||||||
enabled: false
|
enabled: false
|
||||||
gpgHome: /data/git/.gnupg
|
gpgHome: /data/git/.gnupg
|
||||||
|
privateKey: ""
|
||||||
|
# privateKey: |-
|
||||||
|
# -----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
# ...
|
||||||
|
# -----END PGP PRIVATE KEY BLOCK-----
|
||||||
|
existingSecret: ""
|
||||||
|
|
||||||
## @section Gitea
|
## @section Gitea
|
||||||
#
|
#
|
||||||
@ -265,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
|
||||||
@ -281,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:
|
||||||
@ -298,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:
|
||||||
@ -311,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
|
||||||
@ -335,6 +405,10 @@ gitea:
|
|||||||
## @param gitea.podAnnotations Annotations for the Gitea pod
|
## @param gitea.podAnnotations Annotations for the Gitea pod
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
||||||
|
## @param gitea.ssh.logLevel Configure OpenSSH's log level. Only available for root-based Gitea image.
|
||||||
|
ssh:
|
||||||
|
logLevel: "INFO"
|
||||||
|
|
||||||
## @section LivenessProbe
|
## @section LivenessProbe
|
||||||
#
|
#
|
||||||
## @param gitea.livenessProbe.enabled Enable liveness probe
|
## @param gitea.livenessProbe.enabled Enable liveness probe
|
||||||
@ -395,75 +469,58 @@ 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
|
||||||
service:
|
global:
|
||||||
port: 11211
|
redis:
|
||||||
|
password: gitea
|
||||||
|
|
||||||
|
## @section postgresql-ha
|
||||||
|
#
|
||||||
|
## @param postgresql-ha.enabled Enable postgresql-ha
|
||||||
|
## @param postgresql-ha.global.postgresql-ha.auth.password Password for the `gitea` user (overrides `auth.password`)
|
||||||
|
## @param postgresql-ha.global.postgresql-ha.auth.database Name for a custom database to create (overrides `auth.database`)
|
||||||
|
## @param postgresql-ha.global.postgresql-ha.auth.username Name for a custom user to create (overrides `auth.username`)
|
||||||
|
## @param postgresql-ha.global.postgresql-ha.service.ports.postgresql-ha postgresql-ha service port (overrides `service.ports.postgresql-ha`)
|
||||||
|
## @param postgresql-ha.primary.persistence.size PVC Storage Request for postgresql-ha volume
|
||||||
|
postgresql-ha:
|
||||||
|
enabled: true
|
||||||
|
global:
|
||||||
|
postgresql-ha:
|
||||||
|
auth:
|
||||||
|
password: gitea
|
||||||
|
database: gitea
|
||||||
|
username: gitea
|
||||||
|
service:
|
||||||
|
ports:
|
||||||
|
postgresql-ha: 5432
|
||||||
|
primary:
|
||||||
|
persistence:
|
||||||
|
size: 10Gi
|
||||||
|
|
||||||
## @section PostgreSQL
|
## @section PostgreSQL
|
||||||
#
|
#
|
||||||
## @param postgresql.enabled Enable PostgreSQL
|
## @param postgresql.enabled Enable PostgreSQL
|
||||||
## @param postgresql.global.postgresql.postgresqlDatabase PostgreSQL database (overrides postgresqlDatabase)
|
## @param postgresql.global.postgresql.auth.password Password for the `gitea` user (overrides `auth.password`)
|
||||||
## @param postgresql.global.postgresql.postgresqlUsername PostgreSQL username (overrides postgresqlUsername)
|
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`)
|
||||||
## @param postgresql.global.postgresql.postgresqlPassword PostgreSQL admin password (overrides postgresqlPassword)
|
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`)
|
||||||
## @param postgresql.global.postgresql.servicePort PostgreSQL port (overrides service.port)
|
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`)
|
||||||
## @param postgresql.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:
|
||||||
postgresqlDatabase: gitea
|
auth:
|
||||||
postgresqlUsername: gitea
|
password: gitea
|
||||||
postgresqlPassword: gitea
|
database: gitea
|
||||||
servicePort: 5432
|
username: gitea
|
||||||
persistence:
|
service:
|
||||||
size: 10Gi
|
ports:
|
||||||
|
postgresql: 5432
|
||||||
## @section MySQL
|
|
||||||
#
|
|
||||||
## @param mysql.enabled Enable MySQL
|
|
||||||
## @param mysql.root.password Password for the root user. Ignored if existing secret is provided
|
|
||||||
## @param mysql.db.user Username of new user to create.
|
|
||||||
## @param mysql.db.password Password for the new user.Ignored if existing secret is provided
|
|
||||||
## @param mysql.db.name Name for new database to create.
|
|
||||||
## @param mysql.service.port Port to connect to MySQL service
|
|
||||||
## @param mysql.persistence.size PVC Storage Request for MySQL volume
|
|
||||||
mysql:
|
|
||||||
enabled: false
|
|
||||||
root:
|
|
||||||
password: gitea
|
|
||||||
db:
|
|
||||||
user: gitea
|
|
||||||
password: gitea
|
|
||||||
name: gitea
|
|
||||||
service:
|
|
||||||
port: 3306
|
|
||||||
persistence:
|
|
||||||
size: 10Gi
|
|
||||||
|
|
||||||
## @section MariaDB
|
|
||||||
#
|
|
||||||
## @param mariadb.enabled Enable MariaDB
|
|
||||||
## @param mariadb.auth.database Name of the database to create.
|
|
||||||
## @param mariadb.auth.username Username of the new user to create.
|
|
||||||
## @param mariadb.auth.password Password for the new user. Ignored if existing secret is provided
|
|
||||||
## @param mariadb.auth.rootPassword Password for the root user.
|
|
||||||
## @param mariadb.primary.service.port Port to connect to MariaDB service
|
|
||||||
## @param mariadb.primary.persistence.size Persistence size for MariaDB
|
|
||||||
mariadb:
|
|
||||||
enabled: false
|
|
||||||
auth:
|
|
||||||
database: gitea
|
|
||||||
username: gitea
|
|
||||||
password: gitea
|
|
||||||
rootPassword: gitea
|
|
||||||
primary:
|
primary:
|
||||||
service:
|
|
||||||
port: 3306
|
|
||||||
persistence:
|
persistence:
|
||||||
size: 10Gi
|
size: 10Gi
|
||||||
|
|
||||||
@ -471,4 +528,16 @@ mariadb:
|
|||||||
# Set it to false to skip this basic validation check.
|
# Set it to false to skip this basic validation check.
|
||||||
## @section Advanced
|
## @section Advanced
|
||||||
## @param checkDeprecation Set it to false to skip this basic validation check.
|
## @param checkDeprecation Set it to false to skip this basic validation check.
|
||||||
|
## @param test.enabled Set it to false to disable test-connection Pod.
|
||||||
|
## @param test.image.name Image name for the wget container used in the test-connection Pod.
|
||||||
|
## @param test.image.tag Image tag for the wget container used in the test-connection Pod.
|
||||||
checkDeprecation: true
|
checkDeprecation: true
|
||||||
|
test:
|
||||||
|
enabled: true
|
||||||
|
image:
|
||||||
|
name: busybox
|
||||||
|
tag: latest
|
||||||
|
|
||||||
|
## @param extraDeploy Array of extra objects to deploy with the release
|
||||||
|
##
|
||||||
|
extraDeploy: []
|
||||||
|
Reference in New Issue
Block a user