Compare commits

...

44 Commits

Author SHA1 Message Date
e28c1520c0 bump to 1.19.3 (#443)
Some checks failed
generate-chart / generate-chart-publish (push) Has been cancelled
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/443
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-05-04 09:45:36 +08:00
55b22d2225 add extraDeploy to add arbitrary objects to the release (#441)
Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>

<!--
 Before you open the request please review the following guidelines and tips to help it be more easily integrated:

 - Describe the scope of your change - i.e. what the change does.
 - Describe any known limitations with your change.
 - Please run any tests or examples that can exercise your modified code.

 Thank you for contributing! We will try to review, test and integrate the change as soon as we can.
 -->

### Description of the change

<!-- Describe the scope of your change - i.e. what the change does. -->
add a new value `extraDeploy`  to add arbitrary resources

inspired by bitnami charts ([example](https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml#L58)

### Benefits

<!-- What benefits will be realized by the code change? -->
with the change, I can deploy additional resources and keep them consistent with the chart (reuse macro, same labels, etc)., same workflow (helm upgrade), etc

### Possible drawbacks

<!-- Describe any known limitations with your change -->

### Additional information

<!-- If there's anything else that's important and relevant to your pull request, mention that information here. Please remove this section if it remains empty. -->

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->

- [x] 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)

Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/441
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: Cyril Jouve <jv.cyril@gmail.com>
Co-committed-by: Cyril Jouve <jv.cyril@gmail.com>
2023-05-02 21:32:54 +08:00
5876a9e7fc Update Gitea to 1.19.2 and bump chart deps (#442)
Some checks failed
generate-chart / generate-chart-publish (push) Has been cancelled
No substantial changes in chart deps.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/442
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-30 11:05:33 +08:00
c274911aab README: one sentence per line (#440)
Fix #376

Editors should do the job of soft-wrapping in case a line get's too long.
One sentence per line simplifies reviews and diffs a lot as it let's one comment on a piece of text that is contextually sound and not split over multiple lines.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/440
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-19 23:01:03 +08:00
0861260c5d update to use actions for testing PRs (#439)
Run PR tests using Gitea Actions

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/439
Reviewed-by: yardenshoham <yardenshoham@noreply.gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-committed-by: techknowlogick <techknowlogick@gitea.io>
2023-04-15 04:21:00 +08:00
d8bb352765 Fix aws secrets (#438)
Some checks failed
generate-chart / generate-chart-publish (push) Has been cancelled
@lunny

It still looks like that the IAM user does not have enough permissions for the S3 sync operation.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/438
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-14 21:06:43 +08:00
76e47ef6f0 Add -y to fix apt install on ci 2023-04-14 18:19:41 +08:00
95076eb11f Fix yaml lint 2023-04-14 16:08:04 +08:00
e768a6acdc Fix release tag ci 2023-04-14 15:49:18 +08:00
7434556b37 Use Gitea Actions for release publishing (#436)
Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/436
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-committed-by: techknowlogick <techknowlogick@gitea.io>
2023-04-14 14:54:34 +08:00
9f0b65f386 Fix unittests (#434)
Unclear why it only appeared now and not earlier.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/434
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-14 14:45:37 +08:00
a9779c9724 Bump to 1.19.1 (#433)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/433
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-14 02:25:37 +08:00
c0b2fdf8fa Remove discord webhook (#435)
Broken since a long time and probably not used by anyone

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/435
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-14 02:21:21 +08:00
bfaf822a36 feat: Add support for setting priorityClassName (#430)
### Description of the change

Adds support for setting priorityClassName on the Gitea pod.

### Benefits

Users can take advantage of https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ with Gitea.

### Applicable issues

  - fixes #429

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->

- [x] 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)

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/430
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: Casey Buto <cbuto@d2iq.com>
Co-committed-by: Casey Buto <cbuto@d2iq.com>
2023-04-07 18:58:34 +08:00
00395e79b0 Add resource specs to init container (#423)
Supersedes stalled #362

I opted for defining `requests` while leaving `limits` open. This might help for scheduling without restricting performance during init.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/423
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-01 19:35:11 +08:00
25500d7ca2 Ignore Chart.lock for formatters/linters (#424)
This might hopefully help with the formatting issues around `Chart.lock`.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/424
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-04-01 19:18:17 +08:00
87c59b2fca Format all files with prettier VSCode plugin and add yamllint in CI (#413)
@justusbunsi to end my formatting mess... ;)

I am not fully sure myself about the linebreaks in `values.yaml` but I don't think there's an easy way to change that behavior.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/413
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 05:18:23 +08:00
6915a4b401 Add chart author (#411)
and format YAML

(maybe we should also update the maintainers list if some are not active anymore?)

Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/411
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 05:12:10 +08:00
a0ba3c9bef Bump memcached to add arm64 support (#422)
And allow overriding the `image` section so users could possible also use other image tags.

fix #285

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/422
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 05:11:33 +08:00
0f4e1e488a remove mariadb and mysql from _helpers.tpl (#421)
### Description of the change

Removes checks for mariadb and mysql from _helpers.tpl

### Benefits

Fixes the helm-chart version 8.0.0 if using a external database

### Applicable issues

- fixes #420
- fixes #419

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/421
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: delvh <dev.lh@web.de>
Reviewed-by: yardenshoham <yardenshoham@noreply.gitea.io>
Co-authored-by: Maximilian Marschall <maximilian.marschall@3xm.at>
Co-committed-by: Maximilian Marschall <maximilian.marschall@3xm.at>
2023-03-29 03:02:29 +08:00
fb5c615f61 Bump Gitea to 1.19.0 (#418)
As title.

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/418
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: yardenshoham <yardenshoham@noreply.gitea.io>
2023-03-29 01:10:15 +08:00
ae9a71ea11 Remove mysql and mariadb chart deps (#417)
As discussed in Discord.

Supersedes #412 and #407.

**⚠️ BREAKING**

Users depending on the built-in MySQL or MariaDB chart have to switch to an self-managed database, or Postgres

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/417
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: yardenshoham <yardenshoham@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-29 01:02:04 +08:00
5cb0802b7b [Breaking] Bump postgres chart to latest release (#391)
See discussion in #387

Upgrade notes to Chart v11.x and Postgres 14.x: https://docs.bitnami.com/kubernetes/infrastructure/postgresql/administration/upgrade/

The current version in Gitea is using `11.11.0-debian-10-r62` from 2021-04.

Bumping the chart to the latest (v12.x) would use the image `15.2.0-debian-11-r14` which would be a jump from postgres 11 to postgres 15. There are no specific notes for the v12.x chart release, hence we might be able to just go to 12.x directly.

There have been some param renamings which I've reflected in the README.

**⚠️ BREAKING**

Users have to migrate their Postgres DB by e.g. restoring a previously created database dump into a clean installation.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/391
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-03-28 01:12:29 +08:00
fdac9e9048 Support for SSH log level (#358)
Re https://gitea.com/gitea/helm-chart/issues/224#issuecomment-717087

Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/358
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: strk <strk@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pi3ch <pi3ch@noreply.gitea.io>
Co-committed-by: pi3ch <pi3ch@noreply.gitea.io>
2023-03-22 16:13:31 +08:00
1be9fae08b test: use official unittest plugin (#410)
### Description of the change

Switch to official `helm-unittest` which is now alive again at https://github.com/helm-unittest/helm-unittest

### Applicable issues

- ref #199

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->

- [ ] 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`

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/410
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2023-03-21 23:53:13 +08:00
4869aed6ad Fix wrong reference to existingKey (#415)
### Description of the change

Fix a wrong reference to `signing.existingKey`, `signing.existingSecret` was what was meant and what is used in the chart.

### Benefits

Less confusion when trying to use the Helm chart.

### Possible drawbacks

Evangelists of `existingKey` storming the barricades even though `existingKey` is long dead.

### Applicable issues

None, nobody noticed enough to care, apparently.

Co-authored-by: Tobias Wolter <towo@towo.eu>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/415
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: towo <towo@noreply.gitea.io>
Co-committed-by: towo <towo@noreply.gitea.io>
2023-03-21 14:16:41 +08:00
9a6cb4d357 Make test pods optional and allow image override (#360)
### Description of the change

Make the test-connection Pod optional and override the wget container's image.

### Benefits

Allows users to enable/disabled the test-connection Pod and override the wget container's image.

### Checklist

- [X] 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)
- [X] Breaking changes are documented in the `README.md`

Co-authored-by: Umer Anwar <umer.anwar@nuance.com>
Co-authored-by: ooms97 <anwarumer97@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/360
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: ooms97 <ooms97@noreply.gitea.io>
Co-committed-by: ooms97 <ooms97@noreply.gitea.io>
2023-03-09 23:25:45 +08:00
452aeadddf Add section describing versioning and update policy (#347)
After recent discussions in Discord.

Feel free to modify as needed!

Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/347
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Co-committed-by: pat-s <pat-s@noreply.gitea.io>
2023-03-09 01:14:33 +08:00
c46bf7c60f Format README (#408)
Some small formatting changes which are auto-applied by the markdown code styler in vscode (which I am using a lot).

These are also present in #407.
Merging this before/in general would help be a bit when tinkering with the README.
Mainly indentation related, plus some single quotes -> double quotes changes.

Co-authored-by: pat-s <patrick.schratz@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/408
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Co-committed-by: pat-s <pat-s@noreply.gitea.io>
2023-03-08 03:50:40 +08:00
18100cca11 Fixup Chart.lock inconsistency (#406)
Introduced with b6d275c4f5

Signed-off-by: justusbunsi <sk.bunsenbrenner@gmail.com>

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/406
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
2023-02-26 22:42:43 +08:00
b6d275c4f5 Update memcached and use new OCI registry (#405)
OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html

fixes #404

I think we should switch all other binami charts to also use the new OCI registry as according to their blog post, this will be the future method they're heading to.

Co-authored-by: pat-s <patrick.schratz@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/405
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-26 20:52:32 +08:00
578a6cb867 Bump Gitea to 1.18.5 (#403)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/403
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2023-02-22 04:38:08 +08:00
01bb9b4a77 Add support for hostAliases (#401)
### Description of the change

It is required to add custom mapping between hostnames and IP addresses for the gitea pods to be able to access external services like oauth providers or webhook servers.
It is common to take global variables for the entires and set them using hostAliases in the pod template.

### Benefits

Give us more flexibility when using gitea in various network environments.

### Applicable issues

- fixes #400

### Checklist

- [X] 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)

Co-authored-by: Taekyun Kim <tkq.kim@samsung.com>
Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/401
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: podain77 <podain77@noreply.gitea.io>
Co-committed-by: podain77 <podain77@noreply.gitea.io>
2023-02-22 01:53:25 +08:00
513ad81228 Bump Gitea to 1.18.4 (#402)
Signed-off-by: siretart <siretart@tauware.de>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/402
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: siretart <siretart@noreply.gitea.io>
Co-committed-by: siretart <siretart@noreply.gitea.io>
2023-02-21 05:09:04 +08:00
e47edbddf9 use drone secrets for s3 info (#399)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/399
2023-02-08 05:57:32 +08:00
da4120809f Bump Gitea to 1.18.3 (#397)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/397
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2023-01-24 00:53:20 +08:00
83c184826b bump to 1.18.2 2023-01-20 14:26:45 +08:00
ccec32c144 Bump Gitea image to 1.18.1 (#395)
As title: Bump Gitea image to 1.18.1.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/395
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
2023-01-18 19:40:04 +08:00
19e9b07e6e Re-add GPG configuration feature (#374)
This reverts d5ce1a47ea and therefore adds the GPG feature back into main.
As it is a breaking change, this PR now also contains the required upgrade notes.

Closes #107 again.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/374
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
2023-01-18 00:58:10 +08:00
8b6a00603a Update 'values.yaml' (#394)
### Description of the change

Corrects the spelling of the word deprecated.

### Benefits

Documentation free of misspelled words is more likely to be viewed as "professional".

### Possible drawbacks

None that I can think of

### Applicable issues

- fixes #393

### Additional information

There may be other misspelled words or incorrectly phrased passages that aren't addressed in this PR.

For reference, see the online dictionary for the correct spelling of deprecated.

https://www.merriam-webster.com/dictionary/deprecated

### Checklist

- [X] 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)
- [X] Breaking changes are documented in the `README.md`

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/394
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: robv89r <robv8r@noreply.gitea.io>
Co-committed-by: robv89r <robv8r@noreply.gitea.io>
2023-01-10 14:54:55 +08:00
6574b1b232 Ignore unrelated helm files from bundling (#385)
<!--
 Before you open the request please review the following guidelines and tips to help it be more easily integrated:

 - Describe the scope of your change - i.e. what the change does.
 - Describe any known limitations with your change.
 - Please run any tests or examples that can exercise your modified code.

 Thank you for contributing! We will try to review, test and integrate the change as soon as we can.
 -->

### Description of the change
Exluding non helm chart related files from release artifact

### Benefits
Smaller release artifacts

### Possible drawbacks
Exluded files not visible any within the artifact

### Applicable issues
None

### Additional information
None

### âš  BREAKING
None

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->

- [x] 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)
- [x] Breaking changes are documented in the `README.md`

Co-authored-by: Julian Schlarb <js@project-deadline.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/385
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Co-authored-by: JSchlarb <jschlarb@noreply.gitea.io>
Co-committed-by: JSchlarb <jschlarb@noreply.gitea.io>
2022-12-28 18:30:15 +08:00
4f7bc17d34 Bump alpine version in CI (#384)
To fix package installation issues. Apparently installing `helm` in 3.16 fails constantly.

Co-authored-by: pat-s <patrick.schratz@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/384
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: pat-s <pat-s@noreply.gitea.io>
Co-committed-by: pat-s <pat-s@noreply.gitea.io>
2022-12-27 17:18:36 +08:00
279bacb941 v1.17.4 2022-12-22 08:18:31 +08:00
9ed671d685 Switch to official npm release of readme generator (#375)
This is a follow up for #369. They published the package on NPM.

https://github.com/bitnami-labs/readme-generator-for-helm/issues/36

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/375
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
2022-12-05 20:56:08 +08:00
32 changed files with 979 additions and 520 deletions

View File

@ -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
View 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

View 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/

View 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.1 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
View File

@ -1,3 +1,4 @@
charts/ charts/
node_modules/ node_modules/
.DS_Store .DS_Store
unittests/*/__snapshot__/

View File

@ -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/

View File

@ -131,8 +131,6 @@ MD044:
names: names:
- Gitea - Gitea
- PostgreSQL - PostgreSQL
- MariaDB
- MySQL
- Memcached - Memcached
- Prometheus - Prometheus
- Git - Git

View File

@ -1,3 +1,4 @@
.gitea/ .gitea/
node_modules/ node_modules/
charts/ charts/
Chart.lock

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
Chart.lock

20
.yamllint Normal file
View 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

View File

@ -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) - [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
@ -50,3 +51,13 @@ be used:
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`. Now Gitea is accessible at default port-forward svc/gitea-http 3000:3000`. 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
```

View File

@ -1,15 +1,9 @@
dependencies: dependencies:
- name: memcached - name: memcached
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami repository: oci://registry-1.docker.io/bitnamicharts
version: 5.9.0 version: 6.3.14
- 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.4.1
- name: mariadb digest: sha256:02d4846bf416038a42658dbca8f8001d0e3ce967b00e990048f8d420065c33fd
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami generated: "2023-04-28T09:32:05.295167+02:00"
version: 9.3.6
digest: sha256:08f967276fa0c083e9756a974a9791a487a71be0a226dc14351b3e5a2641e8fd
generated: "2022-06-11T12:18:36.672047+02:00"

View File

@ -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.3 appVersion: 1.19.3
icon: https://docs.gitea.io/images/gitea.png icon: https://docs.gitea.io/images/gitea.png
keywords: keywords:
@ -28,22 +28,19 @@ maintainers:
email: lucas.hahn@novum-rgi.de email: lucas.hahn@novum-rgi.de
- name: Steven Kriegler - name: Steven Kriegler
email: sk.bunsenbrenner@gmail.com email: sk.bunsenbrenner@gmail.com
- name: Patrick Schratz
email: patrick.schratz@gmail.com
# Bitnami charts are served from GitHub CDN - See https://github.com/bitnami/charts/issues/10539 for details # Bitnami charts are served from GitHub CDN - See https://github.com/bitnami/charts/issues/10539 for details
dependencies: dependencies:
# OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html (2023-01)
# Chart release date: 2023-04
- name: memcached - name: memcached
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami repository: oci://registry-1.docker.io/bitnamicharts
version: 5.9.0 version: 6.3.14
condition: memcached.enabled condition: memcached.enabled
- name: mysql # Chart release date: 2023-04
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
version: 6.14.10
condition: mysql.enabled
- 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.4.1
condition: postgresql.enabled condition: postgresql.enabled
- name: mariadb
repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
version: 9.3.6
condition: mariadb.enabled

View File

@ -6,3 +6,7 @@ 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' ./

456
README.md
View File

@ -1,28 +1,39 @@
# Gitea Helm Chart # Gitea Helm Chart
[Gitea](https://gitea.io/en-us/) is a community managed lightweight code hosting [Gitea](https://gitea.io/en-us/) is a community managed lightweight code hosting solution written in Go.
solution written in Go. It is published under the MIT license. It is published under the MIT license.
## Introduction ## Introduction
This helm chart has taken some inspiration from [jfelten's helm This helm chart has taken some inspiration from [jfelten's helm chart](https://github.com/jfelten/gitea-helm-chart).
chart](https://github.com/jfelten/gitea-helm-chart). But takes a completely But takes a completely different approach in providing a database and cache with dependencies.
different approach in providing a database and cache with dependencies. Additionally, this chart provides LDAP and admin user configuration with values, as well as being deployed as a statefulset to retain stored repositories.
Additionally, this chart provides LDAP and admin user configuration with values,
as well as being deployed as a statefulset to retain stored repositories. ## Update and versioning policy
The Gitea helm chart versioning does not follow Gitea's versioning.
The latest chart version can be looked up in [https://dl.gitea.com/charts](https://dl.gitea.com/charts) or in the [repository releases](https://gitea.com/gitea/helm-chart/releases).
The chart aims to follow Gitea's releases closely.
There might be times when the chart is behind the latest Gitea release.
This might be caused by different reasons, most often due to time constraints of the maintainers (remember, all work here is done voluntarily in the spare time of people).
If you're eager to use the latest Gitea version earlier than this chart catches up, then change the tag in `values.yaml` to the latest Gitea version.
Note that besides the exact Gitea version one can also use the `:1` tag to automatically follow the latest Gitea version.
This should be combined with `image.pullPolicy: "Always"`.
Important: Using the `:1` will also automatically jump to new minor release (e.g. from 1.13 to 1.14) which may eventually cause incompatibilities if major/breaking changes happened between these versions.
This is due to Gitea not strictly following [semantic versioning](https://semver.org/#summary) as breaking changes do not increase the major version.
I.e., "minor" version bumps are considered "major".
Yet most often no issues will be encountered and the chart maintainers aim to communicate early/upfront if this would be the case.
## Dependencies ## Dependencies
Gitea can be run with an external database and cache. This chart provides those Gitea can be run with an external database and cache.
dependencies, which can be enabled, or disabled via This chart provides those dependencies, which can be enabled, or disabled via configuration.
configuration.
Dependencies: Dependencies:
- PostgreSQL ([configuration](#postgresql)) - PostgreSQL ([configuration](#postgresql))
- Memcached ([configuration](#memcached)) - Memcached ([configuration](#memcached))
- MySQL ([configuration](#mysql))
- MariaDB ([configuration](#mariadb))
## Installing ## Installing
@ -32,8 +43,7 @@ helm repo update
helm install gitea gitea-charts/gitea helm install gitea gitea-charts/gitea
``` ```
When upgrading, please refer to the [Upgrading](#upgrading) section at the bottom When upgrading, please refer to the [Upgrading](#upgrading) section at the bottom of this document for major and breaking changes.
of this document for major and breaking changes.
## Prerequisites ## Prerequisites
@ -41,30 +51,12 @@ of this document for major and breaking changes.
- Helm 3.0+ - Helm 3.0+
- PV provisioner for persistent data support - PV provisioner for persistent data support
## Configure Commit Signing
When using the rootless image the gpg key folder was is not persistent by
default. If you consider using signed commits for internal Gitea activities
(e.g. initial commit), you'd need to provide a signing key. Prior to
[PR186](https://gitea.com/gitea/helm-chart/pulls/186), imported keys had to be
re-imported once the container got replaced by another.
The mentioned PR introduced a new configuration object `signing` allowing you to
configure prerequisites for commit signing. By default this section is disabled
to maintain backwards compatibility.
```yaml
signing:
enabled: false
gpgHome: /data/git/.gnupg
```
## Examples ## Examples
### Gitea Configuration ### Gitea Configuration
Gitea offers lots of configuration options. This is fully described in the Gitea offers lots of configuration options.
[Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/). This is fully described in the [Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
```yaml ```yaml
gitea: gitea:
@ -78,18 +70,17 @@ gitea:
### Default Configuration ### Default Configuration
This chart will set a few defaults in the Gitea configuration based on the This chart will set a few defaults in the Gitea configuration based on the service and ingress settings.
service and ingress settings. All defaults can be overwritten in `gitea.config`. All defaults can be overwritten in `gitea.config`.
INSTALL_LOCK is always set to true, since we want to configure Gitea with this INSTALL_LOCK is always set to true, since we want to configure Gitea with this helm chart and everything is taken care of.
helm chart and everything is taken care of.
_All default settings are made directly in the generated app.ini, not in the Values._ _All default settings are made directly in the generated app.ini, not in the Values._
#### Database defaults #### Database defaults
If a builtIn database is enabled the database configuration is set If a builtIn database is enabled the database configuration is set automatically.
automatically. For example, PostgreSQL builtIn will appear in the app.ini as: For example, PostgreSQL builtIn will appear in the app.ini as:
```ini ```ini
[database] [database]
@ -102,8 +93,8 @@ USER = gitea
#### Memcached defaults #### Memcached defaults
Memcached is handled the exact same way as database builtIn. Once Memcached Memcached is handled the exact same way as database builtIn.
builtIn is enabled, this chart will generate the following part in the `app.ini`: Once Memcached builtIn is enabled, this chart will generate the following part in the `app.ini`:
```ini ```ini
[cache] [cache]
@ -114,9 +105,9 @@ HOST = RELEASE-NAME-memcached.default.svc.cluster.local:11211
#### Server defaults #### Server defaults
The server defaults are a bit more complex. If ingress is `enabled`, the The server defaults are a bit more complex.
`ROOT_URL`, `DOMAIN` and `SSH_DOMAIN` will be set accordingly. `HTTP_PORT` If ingress is `enabled`, the `ROOT_URL`, `DOMAIN` and `SSH_DOMAIN` will be set accordingly.
always defaults to `3000` as well as `SSH_PORT` to `22`. `HTTP_PORT` always defaults to `3000` as well as `SSH_PORT` to `22`.
```ini ```ini
[server] [server]
@ -143,16 +134,13 @@ ENABLED = false
### Additional _app.ini_ settings ### Additional _app.ini_ settings
> **The [generic](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default) > **The [generic](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default)
section cannot be defined that way.** > section cannot be defined that way.**
Some settings inside _app.ini_ (like passwords or whole authentication configurations) Some settings inside _app.ini_ (like passwords or whole authentication configurations) must be considered sensitive and therefore should not be passed via plain text inside the _values.yaml_ file.
must be considered sensitive and therefore should not be passed via plain text In times of _GitOps_ the values.yaml could be stored in a Git repository where sensitive data should never be accessible.
inside the _values.yaml_ file. In times of _GitOps_ the values.yaml could be stored
in a Git repository where sensitive data should never be accessible.
The Helm Chart supports this approach and let the user define custom sources like The Helm Chart supports this approach and let the user define custom sources like
Kubernetes Secrets to be loaded as environment variables during _app.ini_ creation Kubernetes Secrets to be loaded as environment variables during _app.ini_ creation or update.
or update.
```yaml ```yaml
gitea: gitea:
@ -165,8 +153,7 @@ gitea:
This would mount the two additional volumes (`oauth` and `some-additionals`) This would mount the two additional volumes (`oauth` and `some-additionals`)
from different sources to the init containerwhere the _app.ini_ gets updated. from different sources to the init containerwhere the _app.ini_ gets updated.
All files mounted that way will be read and converted to environment variables All files mounted that way will be read and converted to environment variables and then added to the _app.ini_ using [environment-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini).
and then added to the _app.ini_ using [environment-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini).
The key of such additional source represents the section inside the _app.ini_. The key of such additional source represents the section inside the _app.ini_.
The value for each key can be multiline ini-like definitions. The value for each key can be multiline ini-like definitions.
@ -203,19 +190,15 @@ stringData:
#### User defined environment variables in app.ini #### User defined environment variables in app.ini
Users are able to define their own environment variables, Users are able to define their own environment variables, which are loaded into the containers.
which are loaded into the containers. We also support to We also support to directly interact with the generated _app.ini_.
directly interact with the generated _app.ini_.
To inject self defined variables into the _app.ini_ a To inject self defined variables into the _app.ini_ a certain format needs to be honored.
certain format needs to be honored. This is This is described in detail on the [env-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini) page.
described in detail on the [env-to-ini](https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini)
page.
Note that the Prefix on this helm chart is `ENV_TO_INI`. Note that the Prefix on this helm chart is `ENV_TO_INI`.
For example a database setting needs to have the following For example a database setting needs to have the following format:
format:
```yaml ```yaml
gitea: gitea:
@ -232,19 +215,22 @@ gitea:
Priority (highest to lowest) for defining app.ini variables: Priority (highest to lowest) for defining app.ini variables:
1. Environment variables prefixed with `ENV_TO_INI` 1. Environment variables prefixed with `ENV_TO_INI`
2. Additional config sources 1. Additional config sources
3. Values defined in `gitea.config` 1. Values defined in `gitea.config`
### External Database ### External Database
An external Database can be used instead of builtIn PostgreSQL or MySQL. Any external Database listed in [https://docs.gitea.io/en-us/database-prep/](https://docs.gitea.io/en-us/database-prep/) can be used instead of the built-in PostgreSQL.
In fact, it is **highly recommended** to use an external database to ensure a stable Gitea installation longterm.
If an external database is used, no matter which type, make sure to set `postgresql.enabled` to `false` to disable the use of the built-in PostgreSQL.
```yaml ```yaml
gitea: gitea:
config: config:
database: database:
DB_TYPE: mysql DB_TYPE: mysql
HOST: 127.0.0.1:3306 HOST: <mysql HOST>
NAME: gitea NAME: gitea
USER: root USER: root
PASSWD: gitea PASSWD: gitea
@ -256,7 +242,8 @@ postgresql:
### Ports and external url ### Ports and external url
By default port `3000` is used for web traffic and `22` for ssh. Those can be changed: By default port `3000` is used for web traffic and `22` for ssh.
Those can be changed:
```yaml ```yaml
service: service:
@ -266,15 +253,14 @@ service:
port: 22 port: 22
``` ```
This helm chart automatically configures the clone urls to use the correct This helm chart automatically configures the clone urls to use the correct ports.
ports. You can change these ports by hand using the `gitea.config` dict. However You can change these ports by hand using the `gitea.config` dict.
you should know what you're doing. However you should know what you're doing.
### ClusterIP ### ClusterIP
By default the clusterIP will be set to None, which is the default for headless By default the `clusterIP` will be set to `None`, which is the default for headless services.
services. However if you want to omit the clusterIP field in the service, use However if you want to omit the clusterIP field in the service, use the following values:
the following values:
```yaml ```yaml
service: service:
@ -290,9 +276,8 @@ service:
### SSH and Ingress ### SSH and Ingress
If you're using ingress and want to use SSH, keep in mind, that ingress is not If you're using ingress and want to use SSH, keep in mind, that ingress is not able to forward SSH Ports.
able to forward SSH Ports. You will need a LoadBalancer like `metallb` and a You will need a LoadBalancer like `metallb` and a setting in your ssh service annotations.
setting in your ssh service annotations.
```yaml ```yaml
service: service:
@ -303,8 +288,8 @@ service:
### SSH on crio based kubernetes cluster ### SSH on crio based kubernetes cluster
If you use crio as container runtime it is not possible to read from a remote If you use `crio` as container runtime it is not possible to read from a remote repository.
repository. You should get an error message like this: You should get an error message like this:
```bash ```bash
$ git clone git@k8s-demo.internal:admin/test.git $ git clone git@k8s-demo.internal:admin/test.git
@ -321,15 +306,15 @@ More about this issue [here](https://gitea.com/gitea/helm-chart/issues/161).
### Cache ### Cache
This helm chart can use a built in cache. The default is Memcached from bitnami. This helm chart can use a built in cache.
The default is Memcached from bitnami.
```yaml ```yaml
memcached: memcached:
enabled: true enabled: true
``` ```
If the built in cache should not be used simply configure the cache in If the built in cache should not be used simply configure the cache in `gitea.config`.
`gitea.config`.
```yaml ```yaml
gitea: gitea:
@ -343,15 +328,14 @@ gitea:
### Persistence ### Persistence
Gitea will be deployed as a statefulset. By simply enabling the persistence and Gitea will be deployed as a statefulset.
setting the storage class according to your cluster everything else will be By simply enabling the persistence and setting the storage class according to your cluster everything else will be taken care of.
taken care of. The following example will create a PVC as a part of the The following example will create a PVC as a part of the statefulset.
statefulset. This PVC will not be deleted even if you uninstall the chart. This PVC will not be deleted even if you uninstall the chart.
Please note, that an empty storageClass in the persistence will result in Please note, that an empty storageClass in the persistence will result in kubernetes using your default storage class.
kubernetes using your default storage class.
If you want to use your own storageClass define it as followed: If you want to use your own storage class define it as follows:
```yaml ```yaml
persistence: persistence:
@ -359,8 +343,7 @@ persistence:
storageClass: myOwnStorageClass storageClass: myOwnStorageClass
``` ```
When using PostgreSQL as dependency, this will also be deployed as a statefulset When using PostgreSQL as dependency, this will also be deployed as a statefulset by default.
by default.
If you want to manage your own PVC you can simply pass the PVC name to the chart. If you want to manage your own PVC you can simply pass the PVC name to the chart.
@ -370,7 +353,7 @@ If you want to manage your own PVC you can simply pass the PVC name to the chart
existingClaim: MyAwesomeGiteaClaim existingClaim: MyAwesomeGiteaClaim
``` ```
In case that peristence has been disabled it will simply use an empty dir volume. In case that persistence has been disabled it will simply use an empty dir volume.
PostgreSQL handles the persistence in the exact same way. PostgreSQL handles the persistence in the exact same way.
You can interact with the postgres settings as displayed in the following example: You can interact with the postgres settings as displayed in the following example:
@ -382,22 +365,13 @@ You can interact with the postgres settings as displayed in the following exampl
existingClaim: MyAwesomeGiteaPostgresClaim existingClaim: MyAwesomeGiteaPostgresClaim
``` ```
MySQL also handles persistence the same, even though it is not deployed as a statefulset.
You can interact with the postgres settings as displayed in the following example:
```yaml
mysql:
persistence:
enabled: true
existingClaim: MyAwesomeGiteaMysqlClaim
```
### Admin User ### Admin User
This chart enables you to create a default admin user. It is also possible to This chart enables you to create a default admin user.
update the password for this user by upgrading or redeloying the chart. It is It is also possible to update the password for this user by upgrading or redeloying the chart.
not possible to delete an admin user after it has been created. This has to be It is not possible to delete an admin user after it has been created.
done in the ui. You cannot use `admin` as username. This has to be done in the ui.
You cannot use `admin` as username.
```yaml ```yaml
gitea: gitea:
@ -450,7 +424,7 @@ Multiple LDAP sources can be configured with additional LDAP list items.
publicSSHKeyAttribute: publicSSHKey publicSSHKeyAttribute: publicSSHKey
``` ```
You can also use an existing secret to set the bindDn and bindPassword: You can also use an existing secret to set the `bindDn` and `bindPassword`:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@ -470,9 +444,9 @@ gitea:
... ...
``` ```
⚠️ Some options are just flags and therefore don't have any values. If they ⚠️ Some options are just flags and therefore don't have any values.
are defined in `gitea.ldap` configuration, they will be passed to the Gitea CLI If they are defined in `gitea.ldap` configuration, they will be passed to the Gitea CLI without any value.
without any value. Affected options: Affected options:
- notActive - notActive
- skipTlsVerify - skipTlsVerify
@ -482,9 +456,9 @@ without any value. Affected options:
### OAuth2 Settings ### OAuth2 Settings
Like the admin user, OAuth2 settings can be updated and disabled but not Like the admin user, OAuth2 settings can be updated and disabled but not deleted.
deleted. Deleting OAuth2 settings has to be done in the ui. All OAuth2 values, Deleting OAuth2 settings has to be done in the ui.
which are documented [here](https://docs.gitea.io/en-us/command-line/#admin), are All OAuth2 values, which are documented [here](https://docs.gitea.io/en-us/command-line/#admin), are
available. available.
Multiple OAuth2 sources can be configured with additional OAuth list items. Multiple OAuth2 sources can be configured with additional OAuth list items.
@ -492,11 +466,11 @@ Multiple OAuth2 sources can be configured with additional OAuth list items.
```yaml ```yaml
gitea: gitea:
oauth: oauth:
- name: 'MyAwesomeGiteaOAuth' - name: "MyAwesomeGiteaOAuth"
provider: 'openidConnect' provider: "openidConnect"
key: 'hello' key: "hello"
secret: 'world' secret: "world"
autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration' autoDiscoverUrl: "https://gitea.example.com/.well-known/openid-configuration"
#useCustomUrls: #useCustomUrls:
#customAuthUrl: #customAuthUrl:
#customTokenUrl: #customTokenUrl:
@ -520,21 +494,56 @@ stringData:
```yaml ```yaml
gitea: gitea:
oauth: oauth:
- name: 'MyAwesomeGiteaOAuth' - name: "MyAwesomeGiteaOAuth"
existingSecret: gitea-oauth-secret existingSecret: gitea-oauth-secret
... ...
``` ```
## Configure commit signing
When using the rootless image the gpg key folder is not persistent by default.
If you consider using signed commits for internal Gitea activities (e.g. initial commit), you'd need to provide a signing key.
Prior to [PR186](https://gitea.com/gitea/helm-chart/pulls/186), imported keys had to be re-imported once the container got replaced by another.
The mentioned PR introduced a new configuration object `signing` allowing you to configure prerequisites for commit signing.
By default this section is disabled to maintain backwards compatibility.
```yaml
signing:
enabled: false
gpgHome: /data/git/.gnupg
```
Regardless of the used container image the `signing` object allows to specify a private gpg key.
Either using the `signing.privateKey` to define the key inline, or refer to an existing secret containing the key data by using `signing.existingSecret`.
```yaml
apiVersion: v1
kind: Secret
metadata:
name: custom-gitea-gpg-key
type: Opaque
stringData:
privateKey: |-
-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----
```
```yaml
signing:
existingSecret: custom-gitea-gpg-key
```
To use the gpg key, Gitea needs to be configured accordingly.
A detailed description can be found in the [official Gitea documentation](https://docs.gitea.io/en-us/signing/#general-configuration).
### Metrics and profiling ### Metrics and profiling
A Prometheus `/metrics` endpoint on the `HTTP_PORT` and `pprof` profiling A Prometheus `/metrics` endpoint on the `HTTP_PORT` and `pprof` profiling endpoints on port 6060 can be enabled under `gitea`.
endpoints on port 6060 can be enabled under `gitea`. Beware that the metrics Beware that the metrics endpoint is exposed via the ingress, manage access using ingress annotations for example.
endpoint is exposed via the ingress, manage access using ingress annotations for
example.
To deploy the `ServiceMonitor`, you first need to ensure that you have deployed To deploy the `ServiceMonitor`, you first need to ensure that you have deployed `prometheus-operator` and its [CRDs](https://github.com/prometheus-operator/prometheus-operator#customresourcedefinitions).
`prometheus-operator` and its
[CRDs](https://github.com/prometheus-operator/prometheus-operator#customresourcedefinitions).
```yaml ```yaml
gitea: gitea:
@ -566,6 +575,7 @@ gitea:
| `global.imageRegistry` | global image registry override | `""` | | `global.imageRegistry` | global image registry override | `""` |
| `global.imagePullSecrets` | global image pull secrets override; can be extended by `imagePullSecrets` | `[]` | | `global.imagePullSecrets` | global image pull secrets override; can be extended by `imagePullSecrets` | `[]` |
| `global.storageClass` | global storage class override | `""` | | `global.storageClass` | global storage class override | `""` |
| `global.hostAliases` | global hostAliases which will be added to the pod's hosts files | `[]` |
| `replicaCount` | number of replicas for the statefulset | `1` | | `replicaCount` | number of replicas for the statefulset | `1` |
| `clusterDomain` | cluster domain | `cluster.local` | | `clusterDomain` | cluster domain | `cluster.local` |
@ -639,6 +649,7 @@ gitea:
| `tolerations` | Tolerations for the statefulset | `[]` | | `tolerations` | Tolerations for the statefulset | `[]` |
| `affinity` | Affinity for the statefulset | `{}` | | `affinity` | Affinity for the statefulset | `{}` |
| `dnsConfig` | dnsConfig for the statefulset | `{}` | | `dnsConfig` | dnsConfig for the statefulset | `{}` |
| `priorityClassName` | priorityClassName for the statefulset | `""` |
| `statefulset.env` | Additional environment variables to pass to containers | `[]` | | `statefulset.env` | Additional environment variables to pass to containers | `[]` |
| `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | | `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
| `statefulset.labels` | Labels for the statefulset | `{}` | | `statefulset.labels` | Labels for the statefulset | `{}` |
@ -664,15 +675,20 @@ gitea:
### Init ### Init
| Name | Description | Value | | Name | Description | Value |
| --------------- | --------------------------------------------------------------------- | ----- | | ------------------------------------------ | ------------------------------------------------------------------------------------ | ------- |
| `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` | | `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` |
| `initContainers.resources.limits` | initContainers.limits Kubernetes resource limits for init containers | `{}` |
| `initContainers.resources.requests.cpu` | initContainers.requests.cpu Kubernetes cpu resource limits for init containers | `100m` |
| `initContainers.resources.requests.memory` | initContainers.requests.memory Kubernetes memory resource limits for init containers | `128Mi` |
### Signing ### Signing
| Name | Description | Value | | Name | Description | Value |
| ----------------- | ---------------------------- | ------------------ | | ------------------------ | ----------------------------------------------------------------- | ------------------ |
| `signing.enabled` | Enable commit/action signing | `false` | | `signing.enabled` | Enable commit/action signing | `false` |
| `signing.gpgHome` | GPG home directory | `/data/git/.gnupg` | | `signing.gpgHome` | GPG home directory | `/data/git/.gnupg` |
| `signing.privateKey` | Inline private gpg key for signed Gitea actions | `""` |
| `signing.existingSecret` | Use an existing secret to store the value of `signing.privateKey` | `""` |
### Gitea ### Gitea
@ -690,6 +706,7 @@ gitea:
| `gitea.additionalConfigSources` | Additional configuration from secret or configmap | `[]` | | `gitea.additionalConfigSources` | Additional configuration from secret or configmap | `[]` |
| `gitea.additionalConfigFromEnvs` | Additional configuration sources from environment variables | `[]` | | `gitea.additionalConfigFromEnvs` | Additional configuration sources from environment variables | `[]` |
| `gitea.podAnnotations` | Annotations for the Gitea pod | `{}` | | `gitea.podAnnotations` | Annotations for the Gitea pod | `{}` |
| `gitea.ssh.logLevel` | Configure OpenSSH's log level. Only available for root-based Gitea image. | `INFO` |
### LivenessProbe ### LivenessProbe
@ -730,50 +747,30 @@ gitea:
### Memcached ### Memcached
| Name | Description | Value | | Name | Description | Value |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `memcached.enabled` | Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website. | `true` | | `memcached.enabled` | Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website. | `true` |
| `memcached.service.port` | Port for Memcached | `11211` | | `memcached.service.ports.memcached` | Port for Memcached | `11211` |
### PostgreSQL ### PostgreSQL
| Name | Description | Value | | Name | Description | Value |
| ------------------------------------------------- | -------------------------------------------------------- | ------- | | ------------------------------------------------------- | ---------------------------------------------------------------- | ------- |
| `postgresql.enabled` | Enable PostgreSQL | `true` | | `postgresql.enabled` | Enable PostgreSQL | `true` |
| `postgresql.global.postgresql.postgresqlDatabase` | PostgreSQL database (overrides postgresqlDatabase) | `gitea` | | `postgresql.global.postgresql.auth.password` | Password for the `gitea` user (overrides `auth.password`) | `gitea` |
| `postgresql.global.postgresql.postgresqlUsername` | PostgreSQL username (overrides postgresqlUsername) | `gitea` | | `postgresql.global.postgresql.auth.database` | Name for a custom database to create (overrides `auth.database`) | `gitea` |
| `postgresql.global.postgresql.postgresqlPassword` | PostgreSQL admin password (overrides postgresqlPassword) | `gitea` | | `postgresql.global.postgresql.auth.username` | Name for a custom user to create (overrides `auth.username`) | `gitea` |
| `postgresql.global.postgresql.servicePort` | PostgreSQL port (overrides service.port) | `5432` | | `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`) | `5432` |
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` | | `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume | `10Gi` |
### MySQL
| Name | Description | Value |
| ------------------------ | ------------------------------------------------------------------ | ------- |
| `mysql.enabled` | Enable MySQL | `false` |
| `mysql.root.password` | Password for the root user. Ignored if existing secret is provided | `gitea` |
| `mysql.db.user` | Username of new user to create. | `gitea` |
| `mysql.db.password` | Password for the new user.Ignored if existing secret is provided | `gitea` |
| `mysql.db.name` | Name for new database to create. | `gitea` |
| `mysql.service.port` | Port to connect to MySQL service | `3306` |
| `mysql.persistence.size` | PVC Storage Request for MySQL volume | `10Gi` |
### MariaDB
| Name | Description | Value |
| ---------------------------------- | ----------------------------------------------------------------- | ------- |
| `mariadb.enabled` | Enable MariaDB | `false` |
| `mariadb.auth.database` | Name of the database to create. | `gitea` |
| `mariadb.auth.username` | Username of the new user to create. | `gitea` |
| `mariadb.auth.password` | Password for the new user. Ignored if existing secret is provided | `gitea` |
| `mariadb.auth.rootPassword` | Password for the root user. | `gitea` |
| `mariadb.primary.service.port` | Port to connect to MariaDB service | `3306` |
| `mariadb.primary.persistence.size` | Persistence size for MariaDB | `10Gi` |
### Advanced ### Advanced
| Name | Description | Value | | Name | Description | Value |
| ------------------ | ---------------------------------------------------- | ------ | | ------------------ | ------------------------------------------------------------------ | --------- |
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` | | `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
| `test.enabled` | Set it to false to disable test-connection Pod. | `true` |
| `test.image.name` | Image name for the wget container used in the test-connection Pod. | `busybox` |
| `test.image.tag` | Image tag for the wget container used in the test-connection Pod. | `latest` |
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` |
## Contributing ## Contributing
@ -786,30 +783,47 @@ See [CONTRIBUTORS GUIDE](CONTRIBUTING.md) for details.
This section lists major and breaking changes of each Helm Chart version. This section lists major and breaking changes of each Helm Chart version.
Please read them carefully to upgrade successfully. Please read them carefully to upgrade successfully.
### To 8.0.0
#### Removal of MariaDB and MySQL DB chart dependencies
In this version support for DB chart dependencies of MySQL and MariaDB have been removed to simplify the maintenance of the helm chart.
External MySQL and MariaDB databases are still supported and will be in the future.
#### Postgres Update from v11 to v15
This Chart version updates the Postgres chart dependency and subsequently Postgres from v11 to v15.
Please read the [Postgres Release Notes](https://www.postgresql.org/docs/release/) for version-specific changes.
With respect to `values.yaml`, parameters `username`, `database` and `password` have been regrouped under `auth` and slightly renamed.
`persistence` has also been regrouped under the `primary` key.
Please adjust your `values.yaml` accordingly.
### To 7.0.0
#### Private GPG key configuration for Gitea signing actions
Having `signing.enabled=true` now requires to use either `signing.privateKey` or `signing.existingSecret` so that the Chart can automatically prepare the GPG key for Gitea internal signing actions.
See [Configure commit signing](#configure-commit-signing) for details.
### To 6.0.0 ### To 6.0.0
#### Different volume mounts for init-containers and runtime container #### Different volume mounts for init-containers and runtime container
**The `extraVolumeMounts` is deprecated** in favor of `extraInitVolumeMounts` and **The `extraVolumeMounts` is deprecated** in favor of `extraInitVolumeMounts` and `extraContainerVolumeMounts`.
`extraContainerVolumeMounts`. You can now have different mounts for the initialization You can now have different mounts for the initialization phase and Gitea runtime.
phase and Gitea runtime. The deprecated `extraVolumeMounts` will still be available The deprecated `extraVolumeMounts` will still be available for the time being and is mounted into every container.
for the time being and is mounted into every container. If you want to switch to If you want to switch to the new settings and want to mount specific volumes into all containers, you have to configure their mount points within both new settings.
the new settings and want to mount specific volumes into all containers, you have
to configure their mount points within both new settings.
**Combining values from the deprecated setting with values from the new settings **Combining values from the deprecated setting with values from the new settings is not possible.**
is not possible.**
#### New `enabled` flag for `startupProbe` #### New `enabled` flag for `startupProbe`
Prior to this version the `startupProbe` was just a commented sample within the Prior to this version the `startupProbe` was just a commented sample within the `values.yaml`.
`values.yaml`. With the migration to an auto-generated [Parameters](#parameters) With the migration to an auto-generated [Parameters](#parameters) section, a new parameter `gitea.startupProbe.enabled` has been introduced set to
section, a new parameter `gitea.startupProbe.enabled` has been introduced set to
`false` by default. `false` by default.
If you are using the `startupProbe` you need to add that new If you are using the `startupProbe` you need to add that new parameter and set it to `true`.
parameter and set it to `true`. Otherwise, your defined probe won't be considered Otherwise, your defined probe won't be considered after the upgrade.
after the upgrade.
### To 5.0.0 ### To 5.0.0
@ -817,9 +831,7 @@ after the upgrade.
#### Enable Dependencies #### Enable Dependencies
The values to enable the dependencies, The values to enable the dependencies, such as PostgreSQL, Memcached, MySQL and MariaDB have been moved from `gitea.database.builtIn.` to the dependency values.
such as PostgreSQL, Memcached, MySQL and MariaDB
have been moved from `gitea.database.builtIn.` to the dependency values.
You can now enable the dependencies as followed: You can now enable the dependencies as followed:
@ -839,39 +851,32 @@ mariadb:
#### App.ini generation #### App.ini generation
The app.ini generation has changed and now utilizes the environment-to-ini The app.ini generation has changed and now utilizes the environment-to-ini script provided by newer Gitea versions.
script provided by newer Gitea versions. This change ensures, that the app.ini This change ensures, that the app.ini is now persistent.
is now persistent.
##### Secret Key generation ##### Secret Key generation
Gitea secret keys (SECRET_KEY, INTERNAL_TOKEN, JWT_SECRET) are now generated Gitea secret keys (SECRET_KEY, INTERNAL_TOKEN, JWT_SECRET) are now generated automatically in certain situations:
automatically in certain situations:
- New install: By default the secrets are created automatically. If you provide - New install: By default the secrets are created automatically.
secrets via `gitea.config` they will be used instead of automatic generation. If you provide secrets via `gitea.config` they will be used instead of automatic generation.
- Existing installs: The secrets won't be deployed, neither via - Existing installs: The secrets won't be deployed, neither via configuration nor via auto generation.
configuration nor via auto generation. We explicitly prevent to set new secrets. We explicitly prevent to set new secrets.
> đź’ˇ It would be possible to set new secret keys manually by entering > đź’ˇ It would be possible to set new secret keys manually by entering the running container and rewriting the app.ini by hand.
the running container and rewriting the app.ini by hand. However, this it is > However, this it is not advisable to do so for existing installations.
not advisable to do so for existing installations. Certain settings like > Certain settings like _LDAP_ would not be readable anymore.
_LDAP_ would not be readable anymore.
#### Probes #### Probes
`gitea.customLivenessProbe`, `gitea.customReadinessProbe` and `gitea.customStartupProbe` `gitea.customLivenessProbe`, `gitea.customReadinessProbe` and `gitea.customStartupProbe` have been removed.
have been removed.
They are replaced by the settings `gitea.livenessProbe`, `gitea.readinessProbe` They are replaced by the settings `gitea.livenessProbe`, `gitea.readinessProbe` and `gitea.startupProbe` which are now fully configurable and used _as-is_ for
and `gitea.startupProbe` which are now fully configurable and used _as-is_ for
a Chart deployment. a Chart deployment.
If you have customized their values instead of using the `custom` prefixed settings, If you have customized their values instead of using the `custom` prefixed settings, please ensure that you remove the `enabled` property from each of them.
please ensure that you remove the `enabled` property from each of them.
In case you want to disable one of these probes, let's say the `livenessProbe`, add In case you want to disable one of these probes, let's say the `livenessProbe`, add the following to your values.
the following to your values. The `podAnnotation` is just there to have a bit more The `podAnnotation` is just there to have a bit more context.
context.
```diff ```diff
gitea: gitea:
@ -881,20 +886,17 @@ gitea:
#### Multiple OAuth and LDAP authentication sources #### Multiple OAuth and LDAP authentication sources
With `5.0.0` of this Chart it is now possible to configure Gitea with multiple With `5.0.0` of this Chart it is now possible to configure Gitea with multiple OAuth and LDAP sources.
OAuth and LDAP sources. As a result, you need to update an existing OAuth/LDAP configuration As a result, you need to update an existing OAuth/LDAP configuration in your customized `values.yaml` by replacing the object with settings to a list
in your customized `values.yaml` by replacing the object with settings to a list of settings objects.
of settings objects. See [OAuth2 Settings](#oauth2-settings) and See [OAuth2 Settings](#oauth2-settings) and [LDAP Settings](#ldap-settings) section for details.
[LDAP Settings](#ldap-settings) section for details.
### To 4.0.0 ### To 4.0.0
#### Ingress changes #### Ingress changes
To provide a more flexible Ingress configuration we now support not only host To provide a more flexible Ingress configuration we now support not only host settings but also provide configuration for the path and pathType.
settings but also provide configuration for the path and pathType. So this So this change changes the hosts from a simple string list, to a list containing a more complex object for more configuration.
change changes the hosts from a simple string list, to a list containing a more
complex object for more configuration.
```diff ```diff
ingress: ingress:
@ -915,8 +917,7 @@ ingress:
# - git.example.com # - git.example.com
``` ```
If you want everything as it was before, you can simply add the following code If you want everything as it was before, you can simply add the following code to all your host entries.
to all your host entries.
```yaml ```yaml
paths: paths:
@ -926,41 +927,34 @@ paths:
#### Dropped kebab-case support #### Dropped kebab-case support
In 3.x.x it was possible to provide an ldap configuration via kebab-case, this In 3.x.x it was possible to provide an ldap configuration via kebab-case, this support has now been dropped and only camel case is supported.
support has now been dropped and only camel case is supported. See [LDAP See [LDAP section](#ldap-settings) for more information.
section](#ldap-settings) for more information.
#### Dependency update #### Dependency update
The chart comes with multiple databases and Memcached as dependency, the latest The chart comes with multiple databases and Memcached as dependency, the latest release updated the dependencies.
release updated the dependencies.
- Memcached: `4.2.20` -> `5.9.0` - Memcached: `4.2.20` -> `5.9.0`
- PostgreSQL: `9.7.2` -> `10.3.17` - PostgreSQL: `9.7.2` -> `10.3.17`
- MariaDB: `8.0.0` -> `9.3.6` - MariaDB: `8.0.0` -> `9.3.6`
If you're using the builtin databases you will most likely redeploy the chart in If you're using the builtin databases you will most likely redeploy the chart in order to update the database correctly.
order to update the database correctly.
#### Execution of initPreScript #### Execution of initPreScript
Generally spoken, this might not be a breaking change, but it is worth to be Generally spoken, this might not be a breaking change, but it is worth to be mentioned.
mentioned.
Prior to `4.0.0` only one init container was used to both setup directories and Prior to `4.0.0` only one init container was used to both setup directories and configure Gitea.
configure Gitea. As of now the actual Gitea configuration is separated from the As of now the actual Gitea configuration is separated from the other pre-execution.
other pre-execution. This also includes the execution of _initPreScript_. If you This also includes the execution of _initPreScript_.
have such script, please be aware of this. Dynamically prepare the Gitea setup If you have such script, please be aware of this.
during execution by e.g. adding environment variables to the execution context Dynamically prepare the Gitea setup during execution by e.g. adding environment variables to the execution context won't work anymore.
won't work anymore.
### Misc ### Misc
#### Gitea Version 1.14.X repository ROOT #### Gitea Version 1.14.X repository ROOT
Previously the ROOT folder for the Gitea repositories was located at Previously the ROOT folder for the Gitea repositories was located at `/data/git/gitea-repositories`.
`/data/git/gitea-repositories`. In version `1.14` has the path been changed to In version `1.14` has the path been changed to `/data/gitea-repositories`.
`/data/gitea-repositories`.
This chart will set the `gitea.config.repository.ROOT` value default to This chart will set the `gitea.config.repository.ROOT` value default to `/data/git/gitea-repositories`.
`/data/git/gitea-repositories`.

62
package-lock.json generated
View File

@ -7,14 +7,30 @@
"name": "gitea-helm-chart", "name": "gitea-helm-chart",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"markdownlint-cli": "^0.31.1", "@bitnami/readme-generator-for-helm": "^2.4.2",
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/498ea5d19478a36556f1636e1e041a7510d09289" "markdownlint-cli": "^0.31.1"
}, },
"engines": { "engines": {
"node": ">=16.0.0", "node": ">=16.0.0",
"npm": ">=8.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": { "node_modules/argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@ -331,23 +347,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/readme-generator-for-helm": {
"version": "2.4.1",
"resolved": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/498ea5d19478a36556f1636e1e041a7510d09289",
"integrity": "sha512-vCIT2YuskoOU38vNd/if6EhWCVBixdle0e4w2070jv82MlctrQ/5HAYpHZ0cRZCkfoUJ2QOxkGa38nAgUvBb+A==",
"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": { "node_modules/repeat-string": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
@ -407,6 +406,19 @@
} }
}, },
"dependencies": { "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": { "argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@ -663,18 +675,6 @@
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true "dev": true
}, },
"readme-generator-for-helm": {
"version": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/498ea5d19478a36556f1636e1e041a7510d09289",
"integrity": "sha512-vCIT2YuskoOU38vNd/if6EhWCVBixdle0e4w2070jv82MlctrQ/5HAYpHZ0cRZCkfoUJ2QOxkGa38nAgUvBb+A==",
"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": { "repeat-string": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",

View File

@ -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.4.2",
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/498ea5d19478a36556f1636e1e041a7510d09289" "markdownlint-cli": "^0.31.1"
} }
} }

View File

@ -92,19 +92,11 @@ 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 -}}
{{- 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 "-" -}}
{{- end -}} {{- end -}}
{{- define "memcached.dns" -}} {{- 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 -}} {{- end -}}
{{- define "gitea.default_domain" -}} {{- define "gitea.default_domain" -}}
@ -292,25 +284,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 +307,7 @@ 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 -}}

View File

@ -0,0 +1,8 @@
{{- range .Values.extraDeploy }}
---
{{- if typeIs "string" . }}
{{- tpl . $ }}
{{- else }}
{{- tpl (. | toYaml) $ }}
{{- end }}
{{- end }}

View 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 }}

View File

@ -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
@ -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

View File

@ -39,6 +39,9 @@ spec:
{{- if .Values.schedulerName }} {{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}" schedulerName: "{{ .Values.schedulerName }}"
{{- end }} {{- 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 }}
@ -59,6 +62,10 @@ spec:
{{- if .Values.statefulset.env }} {{- if .Values.statefulset.env }}
{{- toYaml .Values.statefulset.env | nindent 12 }} {{- toYaml .Values.statefulset.env | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.signing.enabled }}
- name: GNUPGHOME
value: {{ .Values.signing.gpgHome }}
{{- end }}
volumeMounts: volumeMounts:
- name: init - name: init
mountPath: /usr/sbin mountPath: /usr/sbin
@ -72,6 +79,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 }}
@ -110,6 +119,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"]
@ -198,6 +241,8 @@ 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 }}
resources:
{{- toYaml .Values.initContainers.resources | nindent 12 }}
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
@ -209,6 +254,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
@ -268,6 +317,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 }}
@ -305,6 +358,15 @@ spec:
{{- end }} {{- end }}
- name: temp - name: temp
emptyDir: {} 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 }} {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
- name: data - name: data
persistentVolumeClaim: persistentVolumeClaim:

View File

@ -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 }}

View 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

View 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
View 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

View 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

View 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

View 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

View 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

View 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

View File

@ -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,6 +15,10 @@ 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 statefulset
replicaCount: 1 replicaCount: 1
@ -63,7 +68,7 @@ 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
@ -120,7 +125,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 +138,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:
@ -153,7 +158,8 @@ ingress:
## @section StatefulSet ## @section StatefulSet
# #
## @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
@ -183,12 +189,16 @@ affinity: {}
## @param dnsConfig dnsConfig for the statefulset ## @param dnsConfig dnsConfig for the statefulset
dnsConfig: {} dnsConfig: {}
## @param priorityClassName priorityClassName for the statefulset
priorityClassName: ""
## @param statefulset.env Additional environment variables to pass to containers ## @param statefulset.env Additional environment variables to pass to containers
## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod ## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod
## @param statefulset.labels Labels for the statefulset ## @param statefulset.labels Labels for the statefulset
## @param statefulset.annotations Annotations for the Gitea StatefulSet to be created ## @param statefulset.annotations Annotations for the Gitea StatefulSet to be created
statefulset: statefulset:
env: [] env:
[]
# - name: VARIABLE # - name: VARIABLE
# value: my-value # value: my-value
terminationGracePeriodSeconds: 60 terminationGracePeriodSeconds: 60
@ -228,7 +238,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 +258,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
# #
@ -281,7 +309,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 +327,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:
@ -335,6 +365,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
@ -398,72 +432,41 @@ gitea:
## @section Memcached ## @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.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: memcached:
enabled: true enabled: true
# image:
# registry: docker.io
# repository: bitnami/memcached
# tag: ""
# digest: ""
# pullPolicy: IfNotPresent
# pullSecrets: []
service: service:
port: 11211 ports:
memcached: 11211
## @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: true
global: global:
postgresql: 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: auth:
password: gitea
database: gitea database: gitea
username: gitea username: gitea
password: gitea
rootPassword: gitea
primary:
service: service:
port: 3306 ports:
postgresql: 5432
primary:
persistence: persistence:
size: 10Gi size: 10Gi
@ -471,4 +474,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: []