Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
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 |
106
.drone.yml
106
.drone.yml
@ -8,80 +8,40 @@ platform:
|
||||
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 lint
|
||||
pull: always
|
||||
image: alpine:3.17
|
||||
commands:
|
||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||
- helm lint
|
||||
|
||||
- name: helm template
|
||||
pull: always
|
||||
image: alpine:3.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: helm template
|
||||
pull: always
|
||||
image: alpine:3.17
|
||||
commands:
|
||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||
- helm dependency update
|
||||
- helm template --debug gitea-helm .
|
||||
|
||||
- name: 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: helm unittests
|
||||
pull: always
|
||||
image: alpine:3.17
|
||||
commands:
|
||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash
|
||||
- helm plugin install --version 0.3.1 https://github.com/helm-unittest/helm-unittest
|
||||
- helm dependency update
|
||||
- make unittests
|
||||
|
||||
- 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
|
||||
- name: verify readme
|
||||
pull: always
|
||||
image: alpine:3.17
|
||||
commands:
|
||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git
|
||||
- make readme
|
||||
- git diff --exit-code --name-only README.md
|
||||
|
||||
|
||||
---
|
||||
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/
|
||||
- name: yaml lint
|
||||
pull: always
|
||||
image: cytopia/yamllint:alpine-1
|
||||
commands:
|
||||
- yamllint -f colored .
|
||||
|
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
|
42
.gitea/workflows/release-version.yml
Normal file
42
.gitea/workflows/release-version.yml
Normal file
@ -0,0 +1,42 @@
|
||||
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: package chart
|
||||
run: |
|
||||
helm dependency update
|
||||
helm package --version "${GITHUB_REF#refs/tags/v}" ./
|
||||
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: install aws cli
|
||||
run: |
|
||||
apt update -y &&
|
||||
pip install awscli
|
||||
- name: Copy files to S3 and clear cache
|
||||
run: |
|
||||
aws s3 sync gitea/ s3://${{ secrets.AWS_S3_BUCKET}}/charts/
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
charts/
|
||||
node_modules/
|
||||
.DS_Store
|
||||
unittests/*/__snapshot__/
|
||||
|
@ -25,3 +25,9 @@ node_modules/
|
||||
package.json
|
||||
package-lock.json
|
||||
.gitea/
|
||||
Makefile
|
||||
.markdownlintignore
|
||||
.markdownlint.yaml
|
||||
.drone.yml
|
||||
CONTRIBUTING.md
|
||||
unittests/
|
||||
|
@ -45,7 +45,7 @@ MD012:
|
||||
# MD013/line-length - Line length
|
||||
MD013:
|
||||
# Number of characters
|
||||
line_length: 80
|
||||
line_length: 200
|
||||
# Number of characters for headings
|
||||
heading_line_length: 80
|
||||
# Number of characters for code blocks
|
||||
@ -129,14 +129,12 @@ MD041:
|
||||
MD044:
|
||||
# List of proper names
|
||||
names:
|
||||
- Gitea
|
||||
- PostgreSQL
|
||||
- MariaDB
|
||||
- MySQL
|
||||
- Memcached
|
||||
- Prometheus
|
||||
- Git
|
||||
- GitOps
|
||||
- Gitea
|
||||
- PostgreSQL
|
||||
- Memcached
|
||||
- Prometheus
|
||||
- Git
|
||||
- GitOps
|
||||
# Include code blocks
|
||||
code_blocks: false
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
.gitea/
|
||||
node_modules/
|
||||
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,6 +14,7 @@ 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)
|
||||
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
||||
- [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
|
||||
|
||||
@ -50,3 +51,13 @@ be used:
|
||||
forwarded first from `minikube` to localhost first via `kubectl --namespace
|
||||
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
|
||||
[http://localhost:3000](http://localhost:3000).
|
||||
|
||||
### Unit tests
|
||||
|
||||
```bash
|
||||
# install the unittest plugin
|
||||
$ helm plugin install https://github.com/helm-unittest/helm-unittest
|
||||
|
||||
# run the unittests
|
||||
make unittests
|
||||
```
|
||||
|
18
Chart.lock
18
Chart.lock
@ -1,15 +1,9 @@
|
||||
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
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 6.3.13
|
||||
- name: postgresql
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 10.3.17
|
||||
- name: mariadb
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 9.3.6
|
||||
digest: sha256:08f967276fa0c083e9756a974a9791a487a71be0a226dc14351b3e5a2641e8fd
|
||||
generated: "2022-06-11T12:18:36.672047+02:00"
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 12.2.6
|
||||
digest: sha256:7a37054b0ae841314b1e309fec6f1edc0f22f77161ee915ebfb1ce011457884c
|
||||
generated: "2023-03-28T21:20:51.230043+02:00"
|
||||
|
30
Chart.yaml
30
Chart.yaml
@ -3,7 +3,7 @@ name: gitea
|
||||
description: Gitea Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.0.0
|
||||
appVersion: 1.17.2
|
||||
appVersion: 1.19.1
|
||||
icon: https://docs.gitea.io/images/gitea.png
|
||||
|
||||
keywords:
|
||||
@ -28,22 +28,18 @@ maintainers:
|
||||
email: lucas.hahn@novum-rgi.de
|
||||
- name: Steven Kriegler
|
||||
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
|
||||
dependencies:
|
||||
- name: memcached
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 5.9.0
|
||||
condition: memcached.enabled
|
||||
- name: mysql
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 6.14.10
|
||||
condition: mysql.enabled
|
||||
- name: postgresql
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 10.3.17
|
||||
condition: postgresql.enabled
|
||||
- name: mariadb
|
||||
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
|
||||
version: 9.3.6
|
||||
condition: mariadb.enabled
|
||||
# OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html (2023-01)
|
||||
# Chart release date: 2023-03
|
||||
- name: memcached
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 6.3.13
|
||||
condition: memcached.enabled
|
||||
- name: postgresql
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 12.2.6
|
||||
condition: postgresql.enabled
|
||||
|
4
Makefile
4
Makefile
@ -6,3 +6,7 @@ prepare-environment:
|
||||
readme: prepare-environment
|
||||
npm run readme:parameters
|
||||
npm run readme:lint
|
||||
|
||||
.PHONY: unittests
|
||||
unittests:
|
||||
helm unittest --strict -f 'unittests/**/*.yaml' ./
|
||||
|
74
package-lock.json
generated
74
package-lock.json
generated
@ -7,14 +7,30 @@
|
||||
"name": "gitea-helm-chart",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"markdownlint-cli": "^0.31.1",
|
||||
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main"
|
||||
"@bitnami/readme-generator-for-helm": "^2.4.2",
|
||||
"markdownlint-cli": "^0.31.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@bitnami/readme-generator-for-helm": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@bitnami/readme-generator-for-helm/-/readme-generator-for-helm-2.4.2.tgz",
|
||||
"integrity": "sha512-2kIXOjRiKJ3PBoBD6EaImp4SNyGM/w67ZPPwbuJi5NeXesupQjFyhIhcKliIledlpuiSrMeH9l80yl6hvmYHUA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"commander": "^7.1.0",
|
||||
"dot-object": "^2.1.4",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-table": "^2.0.0",
|
||||
"yaml": "^2.0.0-3"
|
||||
},
|
||||
"bin": {
|
||||
"readme-generator": "bin/index.js"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
@ -331,23 +347,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/readme-generator-for-helm": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main",
|
||||
"integrity": "sha512-W5ziOuId0M00YQRDlA5le3oEguWe8hoINhivOAgEF+AZkk2bDoNxuFUaJIxqAUEvZRA8qlTfUlu+w90EOFbTLw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"commander": "^7.1.0",
|
||||
"dot-object": "^2.1.4",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-table": "^2.0.0",
|
||||
"yaml": "^2.0.0-3"
|
||||
},
|
||||
"bin": {
|
||||
"readme-generator": "bin/index.js"
|
||||
}
|
||||
},
|
||||
"node_modules/repeat-string": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
|
||||
@ -397,9 +396,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz",
|
||||
"integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz",
|
||||
"integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
@ -407,6 +406,19 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@bitnami/readme-generator-for-helm": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@bitnami/readme-generator-for-helm/-/readme-generator-for-helm-2.4.2.tgz",
|
||||
"integrity": "sha512-2kIXOjRiKJ3PBoBD6EaImp4SNyGM/w67ZPPwbuJi5NeXesupQjFyhIhcKliIledlpuiSrMeH9l80yl6hvmYHUA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^7.1.0",
|
||||
"dot-object": "^2.1.4",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-table": "^2.0.0",
|
||||
"yaml": "^2.0.0-3"
|
||||
}
|
||||
},
|
||||
"argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
@ -663,18 +675,6 @@
|
||||
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
|
||||
"dev": true
|
||||
},
|
||||
"readme-generator-for-helm": {
|
||||
"version": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main",
|
||||
"integrity": "sha512-W5ziOuId0M00YQRDlA5le3oEguWe8hoINhivOAgEF+AZkk2bDoNxuFUaJIxqAUEvZRA8qlTfUlu+w90EOFbTLw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^7.1.0",
|
||||
"dot-object": "^2.1.4",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-table": "^2.0.0",
|
||||
"yaml": "^2.0.0-3"
|
||||
}
|
||||
},
|
||||
"repeat-string": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
|
||||
@ -712,9 +712,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"yaml": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz",
|
||||
"integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz",
|
||||
"integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
"readme:parameters": "readme-generator -v values.yaml -r README.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"markdownlint-cli": "^0.31.1",
|
||||
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main"
|
||||
"@bitnami/readme-generator-for-helm": "^2.4.2",
|
||||
"markdownlint-cli": "^0.31.1"
|
||||
}
|
||||
}
|
||||
|
@ -92,19 +92,11 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "postgresql.dns" -}}
|
||||
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.servicePort -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mysql.dns" -}}
|
||||
{{- printf "%s-mysql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mariadb.dns" -}}
|
||||
{{- printf "%s-mariadb.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}}
|
||||
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.service.ports.postgresql -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "memcached.dns" -}}
|
||||
{{- printf "%s-memcached.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}}
|
||||
{{- printf "%s-memcached.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.memcached.service.ports.memcached | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.default_domain" -}}
|
||||
@ -292,25 +284,9 @@ https
|
||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.postgresqlDatabase -}}
|
||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}}
|
||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}}
|
||||
{{- 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 -}}
|
||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.auth.database -}}
|
||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.auth.username -}}
|
||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.auth.password -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@ -331,3 +307,7 @@ https
|
||||
{{- toYaml .Values.extraVolumeMounts -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.gpg-key-secret-name" -}}
|
||||
{{ default (printf "%s-gpg-key" (include "gitea.fullname" .)) .Values.signing.existingSecret }}
|
||||
{{- 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 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
configure_gpg_environment.sh: |-
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
gpg --batch --import /raw/private.asc
|
||||
init_directory_structure.sh: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@ -26,7 +31,7 @@ stringData:
|
||||
{{- end }}
|
||||
mkdir -p /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
|
||||
mkdir -p "${GITEA_TEMP}"
|
||||
@ -35,6 +40,14 @@ stringData:
|
||||
{{- end }}
|
||||
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: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
@ -39,6 +39,9 @@ spec:
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: "{{ .Values.schedulerName }}"
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.priorityClassName }}"
|
||||
{{- end }}
|
||||
{{- include "gitea.images.pullSecrets" . | nindent 6 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
@ -59,6 +62,10 @@ spec:
|
||||
{{- if .Values.statefulset.env }}
|
||||
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.signing.enabled }}
|
||||
- name: GNUPGHOME
|
||||
value: {{ .Values.signing.gpgHome }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: init
|
||||
mountPath: /usr/sbin
|
||||
@ -72,6 +79,8 @@ spec:
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||
- name: init-app-ini
|
||||
image: "{{ include "gitea.image" . }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
@ -110,6 +119,40 @@ spec:
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||
securityContext:
|
||||
{{- 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
|
||||
image: "{{ include "gitea.image" . }}"
|
||||
command: ["/usr/sbin/configure_gitea.sh"]
|
||||
@ -198,6 +241,8 @@ spec:
|
||||
subPath: {{ .Values.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.initContainers.resources | nindent 12 }}
|
||||
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
@ -209,6 +254,10 @@ spec:
|
||||
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
||||
- name: SSH_PORT
|
||||
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
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
@ -268,6 +317,10 @@ spec:
|
||||
subPath: {{ .Values.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
||||
{{- with .Values.global.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
@ -305,6 +358,15 @@ spec:
|
||||
{{- end }}
|
||||
- name: temp
|
||||
emptyDir: {}
|
||||
{{- 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 and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
|
@ -1,3 +1,4 @@
|
||||
{{- if .Values.test.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
@ -9,7 +10,8 @@ metadata:
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
image: "{{ .Values.test.image.name }}:{{ .Values.test.image.tag }}"
|
||||
command: ['wget']
|
||||
args: ['{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}']
|
||||
restartPolicy: Never
|
||||
{{- end }}
|
||||
|
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
|
72
unittests/init/init_directory_structure.sh.yaml
Normal file
72
unittests/init/init_directory_structure.sh.yaml
Normal file
@ -0,0 +1,72 @@
|
||||
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
|
||||
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:
|
||||
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
|
17
unittests/statefulset/basic.yaml
Normal file
17
unittests/statefulset/basic.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
suite: Statefulset template (basic)
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/gitea/statefulset.yaml
|
||||
- templates/gitea/config.yaml
|
||||
tests:
|
||||
- it: renders a statefulset
|
||||
template: templates/gitea/statefulset.yaml
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
name: gitea-unittests
|
40
unittests/statefulset/signing-disabled.yaml
Normal file
40
unittests/statefulset/signing-disabled.yaml
Normal file
@ -0,0 +1,40 @@
|
||||
suite: Statefulset template (signing disabled)
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/gitea/statefulset.yaml
|
||||
- templates/gitea/config.yaml
|
||||
tests:
|
||||
- it: skips gpg init container
|
||||
template: templates/gitea/statefulset.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/statefulset.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/statefulset.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: GNUPGHOME
|
||||
- it: skips gpg volume spec
|
||||
template: templates/gitea/statefulset.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: gpg-private-key
|
96
unittests/statefulset/signing-enabled.yaml
Normal file
96
unittests/statefulset/signing-enabled.yaml
Normal file
@ -0,0 +1,96 @@
|
||||
suite: Statefulset template (signing enabled)
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/gitea/statefulset.yaml
|
||||
- templates/gitea/config.yaml
|
||||
tests:
|
||||
- it: adds gpg init container
|
||||
template: templates/gitea/statefulset.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/statefulset.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/statefulset.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/statefulset.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/statefulset.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/statefulset/ssh-configuration.yaml
Normal file
40
unittests/statefulset/ssh-configuration.yaml
Normal file
@ -0,0 +1,40 @@
|
||||
suite: Statefulset template (SSH configuration)
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/gitea/statefulset.yaml
|
||||
- templates/gitea/config.yaml
|
||||
tests:
|
||||
- it: supports defining SSH log level for root based image
|
||||
template: templates/gitea/statefulset.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/statefulset.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/statefulset.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
|
137
values.yaml
137
values.yaml
@ -6,6 +6,7 @@
|
||||
## @param global.imageRegistry global image registry override
|
||||
## @param global.imagePullSecrets global image pull secrets override; can be extended by `imagePullSecrets`
|
||||
## @param global.storageClass global storage class override
|
||||
## @param global.hostAliases global hostAliases which will be added to the pod's hosts files
|
||||
global:
|
||||
imageRegistry: ""
|
||||
## E.g.
|
||||
@ -14,6 +15,10 @@ global:
|
||||
##
|
||||
imagePullSecrets: []
|
||||
storageClass: ""
|
||||
hostAliases: []
|
||||
# - ip: 192.168.137.2
|
||||
# hostnames:
|
||||
# - example.com
|
||||
|
||||
## @param replicaCount number of replicas for the statefulset
|
||||
replicaCount: 1
|
||||
@ -63,7 +68,7 @@ containerSecurityContext: {}
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
## @depracated The securityContext variable has been split two:
|
||||
## @deprecated The securityContext variable has been split two:
|
||||
## - containerSecurityContext
|
||||
## - podSecurityContext.
|
||||
## @param securityContext Run init and Gitea containers as a specific securityContext
|
||||
@ -120,7 +125,6 @@ service:
|
||||
loadBalancerSourceRanges: []
|
||||
annotations: {}
|
||||
|
||||
|
||||
## @section Ingress
|
||||
## @param ingress.enabled Enable ingress
|
||||
## @param ingress.className Ingress class name
|
||||
@ -134,7 +138,8 @@ ingress:
|
||||
enabled: false
|
||||
# className: nginx
|
||||
className:
|
||||
annotations: {}
|
||||
annotations:
|
||||
{}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
@ -153,7 +158,8 @@ ingress:
|
||||
## @section StatefulSet
|
||||
#
|
||||
## @param resources Kubernetes resources
|
||||
resources: {}
|
||||
resources:
|
||||
{}
|
||||
# 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
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
@ -183,12 +189,16 @@ affinity: {}
|
||||
## @param dnsConfig dnsConfig for the statefulset
|
||||
dnsConfig: {}
|
||||
|
||||
## @param priorityClassName priorityClassName for the statefulset
|
||||
priorityClassName: ""
|
||||
|
||||
## @param statefulset.env Additional environment variables to pass to containers
|
||||
## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod
|
||||
## @param statefulset.labels Labels for the statefulset
|
||||
## @param statefulset.annotations Annotations for the Gitea StatefulSet to be created
|
||||
statefulset:
|
||||
env: []
|
||||
env:
|
||||
[]
|
||||
# - name: VARIABLE
|
||||
# value: my-value
|
||||
terminationGracePeriodSeconds: 60
|
||||
@ -228,7 +238,7 @@ extraContainerVolumeMounts: []
|
||||
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
|
||||
extraInitVolumeMounts: []
|
||||
|
||||
## @depracated The extraVolumeMounts variable has been split two:
|
||||
## @deprecated The extraVolumeMounts variable has been split two:
|
||||
## - extraContainerVolumeMounts
|
||||
## - extraInitVolumeMounts
|
||||
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
|
||||
@ -248,14 +258,32 @@ initPreScript: ""
|
||||
# chown -R git:git /data/git/.postgresql/
|
||||
# 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
|
||||
## @section Signing
|
||||
#
|
||||
## @param signing.enabled Enable commit/action signing
|
||||
## @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:
|
||||
enabled: false
|
||||
gpgHome: /data/git/.gnupg
|
||||
privateKey: ""
|
||||
# privateKey: |-
|
||||
# -----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
# ...
|
||||
# -----END PGP PRIVATE KEY BLOCK-----
|
||||
existingSecret: ""
|
||||
|
||||
## @section Gitea
|
||||
#
|
||||
@ -265,7 +293,7 @@ gitea:
|
||||
## @param gitea.admin.password Password for the Gitea admin user
|
||||
## @param gitea.admin.email Email for the Gitea admin user
|
||||
admin:
|
||||
#existingSecret: gitea-admin-secret
|
||||
# existingSecret: gitea-admin-secret
|
||||
existingSecret:
|
||||
username: gitea_admin
|
||||
password: r8sA8CPHD9!bt6d
|
||||
@ -281,7 +309,8 @@ gitea:
|
||||
# prometheus-release: prom1
|
||||
|
||||
## @param gitea.ldap LDAP configuration
|
||||
ldap: []
|
||||
ldap:
|
||||
[]
|
||||
# - name: "LDAP 1"
|
||||
# existingSecret:
|
||||
# securityProtocol:
|
||||
@ -298,7 +327,8 @@ gitea:
|
||||
|
||||
# Either specify inline `key` and `secret` or refer to them via `existingSecret`
|
||||
## @param gitea.oauth OAuth configuration
|
||||
oauth: []
|
||||
oauth:
|
||||
[]
|
||||
# - name: 'OAuth 1'
|
||||
# provider:
|
||||
# key:
|
||||
@ -335,6 +365,10 @@ gitea:
|
||||
## @param gitea.podAnnotations Annotations for the Gitea pod
|
||||
podAnnotations: {}
|
||||
|
||||
## @param gitea.ssh.logLevel Configure OpenSSH's log level. Only available for root-based Gitea image.
|
||||
ssh:
|
||||
logLevel: "INFO"
|
||||
|
||||
## @section LivenessProbe
|
||||
#
|
||||
## @param gitea.livenessProbe.enabled Enable liveness probe
|
||||
@ -398,72 +432,41 @@ gitea:
|
||||
## @section Memcached
|
||||
#
|
||||
## @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 memcached.service.port Port for Memcached
|
||||
## ref: https://hub.docker.com/r/bitnami/memcached/tags/
|
||||
## @param memcached.service.ports.memcached Port for Memcached
|
||||
memcached:
|
||||
enabled: true
|
||||
# image:
|
||||
# registry: docker.io
|
||||
# repository: bitnami/memcached
|
||||
# tag: ""
|
||||
# digest: ""
|
||||
# pullPolicy: IfNotPresent
|
||||
# pullSecrets: []
|
||||
service:
|
||||
port: 11211
|
||||
ports:
|
||||
memcached: 11211
|
||||
|
||||
## @section PostgreSQL
|
||||
#
|
||||
## @param postgresql.enabled Enable PostgreSQL
|
||||
## @param postgresql.global.postgresql.postgresqlDatabase PostgreSQL database (overrides postgresqlDatabase)
|
||||
## @param postgresql.global.postgresql.postgresqlUsername PostgreSQL username (overrides postgresqlUsername)
|
||||
## @param postgresql.global.postgresql.postgresqlPassword PostgreSQL admin password (overrides postgresqlPassword)
|
||||
## @param postgresql.global.postgresql.servicePort PostgreSQL port (overrides service.port)
|
||||
## @param postgresql.persistence.size PVC Storage Request for PostgreSQL volume
|
||||
## @param postgresql.global.postgresql.auth.password Password for the "gitea" user (overrides `auth.password`)
|
||||
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`)
|
||||
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`)
|
||||
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`)
|
||||
## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume
|
||||
postgresql:
|
||||
enabled: true
|
||||
global:
|
||||
postgresql:
|
||||
postgresqlDatabase: gitea
|
||||
postgresqlUsername: gitea
|
||||
postgresqlPassword: gitea
|
||||
servicePort: 5432
|
||||
persistence:
|
||||
size: 10Gi
|
||||
|
||||
## @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
|
||||
auth:
|
||||
password: gitea
|
||||
database: gitea
|
||||
username: gitea
|
||||
service:
|
||||
ports:
|
||||
postgresql: 5432
|
||||
primary:
|
||||
service:
|
||||
port: 3306
|
||||
persistence:
|
||||
size: 10Gi
|
||||
|
||||
@ -471,4 +474,12 @@ mariadb:
|
||||
# Set it to false to skip this basic validation check.
|
||||
## @section Advanced
|
||||
## @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
|
||||
test:
|
||||
enabled: true
|
||||
image:
|
||||
name: busybox
|
||||
tag: latest
|
||||
|
Reference in New Issue
Block a user