14 Commits

Author SHA1 Message Date
de8e3b37f8 chore: add maintainer volker.raschek to the chart 2025-08-21 11:21:25 +02:00
bb50a19f4d chore: add maintainer ChristopherHX to the chart (#33)
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/33
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-committed-by: ChristopherHX <christopher.homberger@web.de>
2025-08-21 04:16:07 +00:00
b2459f322b chore: add maintainers to the chart (#32)
Add my own mainter note to the Chart.yaml

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/32
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: Daan Selen <dselen@nerthus.nl>
Co-committed-by: Daan Selen <dselen@nerthus.nl>
2025-08-20 20:48:31 +00:00
aa99df60b7 chore(readme): fix typo 2025-08-14 21:41:39 +00:00
9a7e82ee3b chore(readme): expand the readme to have an intro into the chart (#30)
Currently people are dropped directly into the Repo with no guidance.
I want to add this to ease people in, so they may use the chart more easily.

Co-authored-by: Daan Selen <dselen@systemec.nl>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/30
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: Daan Selen <dselen@nerthus.nl>
Co-committed-by: Daan Selen <dselen@nerthus.nl>
2025-08-14 21:40:35 +00:00
77b995a723 chore(chart): make wget more robuust (#29)
This PR adds a simple redirection to the wget command. Diff:

Original:
```
Trying to reach Gitea on http://gitea-http.gitea.svc.cluster.local:3000
<!DOCTYPE html>
<html lang="en-US" data-theme="gitea-auto">
<head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Gitea server</title>
        <link rel="manifest" href="data:application/json;base64,eyJuYW1lIjoiU3lzdGVtZWMgR2l0ZWEgc2VydmVyIiwic2hvcnRfbmFtZSI6IlN5c3RlbWVjIEdpdGVhIHNlcnZlciIsInN0YXJ0X3VybCI6Imh0dHBzOi8vZGFyamVlbGluZy5zeXN0ZW1lYy5ubC8iLCJpY29ucyI6W3sic3JjIjoiaHR0cHM6Ly9kYXJqZWVsaW5nLnN5c3RlbWVjLm5sL2Fzc2V0cy9pbWcvbG9nby5wbmciLCJ0eXBlIjoiaW1hZ2UvcG5nIiwic2l6ZXMiOiI1MTJ4NTEyIn0seyJzcmMiOiJodHRwczovL2RhcmplZWxpbmcuc3lzdGVtZWMubmwvYXNzZXRzL2ltZy9sb2dvLnN2ZyIsInR5cGUiOiJpbWFnZS9zdmcreG1sIiwic2l6ZXMiOiI1MTJ4NTEyIn1dfQ==">
        <meta name="author" content="Gitea - Git with a cup of tea">
        <meta name="description" content="Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go">
        <meta name="keywords" content="go,git,self-hosted,gitea">
        <meta name="referrer" content="no-referrer">

        <link rel="icon" href="/assets/img/favicon.svg" type="image/svg+xml">
        <link rel="alternate icon" href="/assets/img/favicon.png" type="image/png">

.... SNAP .... (To reduce output)

<div role="main" aria-label="Home" class="page-content home">
        <div class="tw-mb-8 tw-px-8">
                <div class="center">
                        <img class="logo" width="220" height="220" src="/assets/img/logo.svg" alt="Logo">
                        <div class="hero">
                                <h1 class="ui icon header title tw-text-balance">
                                        Gitea server
                                </h1>
                                <h2 class="tw-text-balance">A painless, self-hosted Git service</h2>
                        </div>
                </div>
        </div>
        <div class="ui stackable middle very relaxed page grid">
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                <svg viewBox="0 0 16 16" class="svg octicon-flame" aria-hidden="true" width="16" height="16"><path d="M9.533.753V.752c.217 2.385 1.463 3.626 2.653 4.81C13.37 6.74 14.498 7.863 14.498 10c0 3.5-3 6-6.5 6S1.5 13.512 1.5 10c0-1.298.536-2.56 1.425-3.286.376-.308.862 0 1.035.454C4.46 8.487 5.581 8.419 6 8c.282-.282.341-.811-.003-1.5C4.34 3.187 7.035.75 8.77.146c.39-.137.726.194.763.607M7.998 14.5c2.832 0 5-1.98 5-4.5 0-1.463-.68-2.19-1.879-3.383l-.036-.037c-1.013-1.008-2.3-2.29-2.834-4.434-.322.256-.63.579-.864.953-.432.696-.621 1.58-.046 2.73.473.947.67 2.284-.278 3.232-.61.61-1.545.84-2.403.633a2.8 2.8 0 0 1-1.436-.874A3.2 3.2 0 0 0 3 10c0 2.53 2.164 4.5 4.998 4.5"/></svg> Easy to install
                        </h1>
                        <p class="large tw-text-balance">
                                Simply <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-binary">run the binary</a> for your platform, ship it with <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea/tree/master/docker">Docker</a>, or get it <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-package">packaged</a>.
                        </p>
                </div>
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                <svg viewBox="0 0 16 16" class="svg octicon-device-desktop" aria-hidden="true" width="16" height="16"><path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.7 5.7 0 0 1-.765 2.5h3.566a5.7 5.7 0 0 1-.765-2.5"/></svg> Cross-platform
                        </h1>
                        <p class="large tw-text-balance">
                                Gitea runs anywhere <a target="_blank" rel="noopener noreferrer" href="https://go.dev/">Go</a> can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love!
                        </p>
                </div>
        </div>
        <div class="ui stackable middle very relaxed page grid">
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                <svg viewBox="0 0 16 16" class="svg octicon-rocket" aria-hidden="true" width="16" height="16"><path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.75 8.75 0 0 1-2.564 6.186l-.458.459q-.472.471-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.75.75 0 0 1-1.11-.418l-.954-3.102a1 1 0 0 1-.145-.125L3.754 9.816a1 1 0 0 1-.124-.145L.528 8.717a.75.75 0 0 1-.418-1.11l1.71-2.774A1.75 1.75 0 0 1 3.31 4h3.204q.433-.508.904-.979l.459-.458A8.75 8.75 0 0 1 14.064 0M8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.25 7.25 0 0 0-5.125 2.123M3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.23.23 0 0 1-.201-.064.23.23 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12m6.94-3.935q-.132.09-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766q.087-.135.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg> Lightweight
                        </h1>
                        <p class="large tw-text-balance">
                                Gitea has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!
                        </p>
                </div>
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                <svg viewBox="0 0 16 16" class="svg octicon-code" aria-hidden="true" width="16" height="16"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.75.75 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.75.75 0 0 1 .734.215m-6.56 0a.75.75 0 0 1 1.042.018.75.75 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.75.75 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"/></svg> Open Source
                        </h1>
                        <p class="large tw-text-balance">
                                Go get <a target="_blank" rel="noopener noreferrer" href="https://code.gitea.io/gitea">code.gitea.io/gitea</a>! Join us by <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">contributing</a> to make this project even better. Don't be shy to be a contributor!
                        </p>
                </div>
        </div>
</div>

        </div>

        <footer class="page-footer" role="group" aria-label="Footer">
        <div class="left-links" role="contentinfo" aria-label="About Software">

                        <a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">Powered by Gitea</a>

                        Version:

                                1.24.3

                        Page: <strong>0ms</strong>
                        Template: <strong>0ms</strong>

        </div>
        <div class="right-links" role="group" aria-label="Links">
                <div class="ui dropdown upward">
                        <span class="flex-text-inline"><svg viewBox="0 0 16 16" class="svg octicon-globe" aria-hidden="true" width="14" height="14"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M5.78 8.75a9.64 9.64 0 0 0 1.363 4.177q.383.64.857 1.215c.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a10 10 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.51 6.51 0 0 0 4.666 5.5q-.184-.271-.352-.552c-.715-1.192-1.437-2.874-1.581-4.948m-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948q.18-.295.353-.552a6.51 6.51 0 0 0-4.666 5.5m10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948q-.18.296-.353.552a6.51 6.51 0 0 0 4.666-5.5Zm2.733-1.5a6.51 6.51 0 0 0-4.666-5.5q.184.272.353.552c.714 1.192 1.436 2.874 1.58 4.948Z"/></svg> English</span>
                        <div class="menu language-menu">
                                <a lang="id-ID" data-url="/?lang=id-ID" class="item ">Bahasa Indonesia</a>
                                <a lang="de-DE" data-url="/?lang=de-DE" class="item ">Deutsch</a>
                                <a lang="en-US" data-url="/?lang=en-US" class="item selected">English</a>
                                <a lang="es-ES" data-url="/?lang=es-ES" class="item ">Español</a>
                                <a lang="fr-FR" data-url="/?lang=fr-FR" class="item ">Français</a>
                                <a lang="ga-IE" data-url="/?lang=ga-IE" class="item ">Gaeilge</a>
                                <a lang="it-IT" data-url="/?lang=it-IT" class="item ">Italiano</a>
                                <a lang="lv-LV" data-url="/?lang=lv-LV" class="item ">Latviešu</a>
                                <a lang="hu-HU" data-url="/?lang=hu-HU" class="item ">Magyar nyelv</a>
                                <a lang="nl-NL" data-url="/?lang=nl-NL" class="item ">Nederlands</a>
                                <a lang="pl-PL" data-url="/?lang=pl-PL" class="item ">Polski</a>
                                <a lang="pt-PT" data-url="/?lang=pt-PT" class="item ">Português de Portugal</a>
                                <a lang="pt-BR" data-url="/?lang=pt-BR" class="item ">Português do Brasil</a>
                                <a lang="fi-FI" data-url="/?lang=fi-FI" class="item ">Suomi</a>
                                <a lang="sv-SE" data-url="/?lang=sv-SE" class="item ">Svenska</a>
                                <a lang="tr-TR" data-url="/?lang=tr-TR" class="item ">Türkçe</a>
                                <a lang="cs-CZ" data-url="/?lang=cs-CZ" class="item ">Čeština</a>
                                <a lang="el-GR" data-url="/?lang=el-GR" class="item ">Ελληνικά</a>
                                <a lang="bg-BG" data-url="/?lang=bg-BG" class="item ">Български</a>
                                <a lang="ru-RU" data-url="/?lang=ru-RU" class="item ">Русский</a>
                                <a lang="uk-UA" data-url="/?lang=uk-UA" class="item ">Українська</a>
                                <a lang="fa-IR" data-url="/?lang=fa-IR" class="item ">فارسی</a>
                                <a lang="ml-IN" data-url="/?lang=ml-IN" class="item ">മലയാളം</a>
                                <a lang="ja-JP" data-url="/?lang=ja-JP" class="item ">日本語</a>
                                <a lang="zh-CN" data-url="/?lang=zh-CN" class="item ">简体中文</a>
                                <a lang="zh-TW" data-url="/?lang=zh-TW" class="item ">繁體中文(台灣)</a>
                                <a lang="zh-HK" data-url="/?lang=zh-HK" class="item ">繁體中文(香港)</a>
                                <a lang="ko-KR" data-url="/?lang=ko-KR" class="item ">한국어</a>
                                </div>
                </div>
                <a href="/assets/licenses.txt">Licenses</a>
                <a href="/api/swagger">API</a>

        </div>
</footer>

        <script src="/assets/js/index.js?v=1.24.3" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script>

</body>
</html>

Gitea has been reached!
```

After this.
```
k logs -f pod/gitea-actions-act-runner-1 -c init-gitea
Trying to reach Gitea on http://gitea-http.gitea.svc.cluster.local:3000
Gitea has been reached!
```

Co-authored-by: Daan Selen <dselen@systemec.nl>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/29
Reviewed-by: Markus Pesch <volker.raschek@noreply.gitea.com>
2025-08-14 09:18:24 +00:00
a3d093702c refactor(chart): replace the netcat command with the busybox wget variant (#26)
### Description of the change

replace the netcat command with wget commands.

### Benefits

Less noise in the log(s)

### Possible drawbacks

<!-- Describe any known limitations with your change -->
No limitations. As far as I am aware.

- Fixes #

https://gitea.com/gitea/helm-actions/pulls/23#issuecomment-1027779

### Additional information

As the PR Title suggests, it replaces the netcat command to a wget command which makes the noise in the log stop.

### 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`
- [X] Helm templating unittests are added (required when changing anything in `templates` folder)
- [X] Bash unittests are added (required when changing anything in `scripts` folder)
- [X] All added template resources MUST render a namespace in metadata

Co-authored-by: Daan Selen <dselen@systemec.nl>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/26
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: Daan Selen <dselen@nerthus.nl>
Co-committed-by: Daan Selen <dselen@nerthus.nl>
2025-08-13 21:27:56 +00:00
8c95dcd282 refactor!: remove actions runner token provisioning (#15)
To be discussed. In https://gitea.com/gitea/helm-actions/issues/9#issuecomment-1002191 and https://gitea.com/gitea/helm-actions/pulls/13 I described that a migration of provisioning is currently not feasible due to
- helm limitations
  - You are forced to repeat a lot of stuff for the default branch
  -  helm-actions cannot read values of the helm-gitea chart to fix this
- No agreement about making helm-gitea a optional dependency of helm-actions can be reached at the moment

# Proposal

- Create a new repository that includes both helm-gitea **and** helm-actions
- Provisioning leaves this repository as well like it did in helm-gitea
- Create that as gitea/helm-stack or whatever name
- Provisioning code and tests moves to gitea/helm-stack

We would need help with the repository creation

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/15
Reviewed-by: DaanSelen <daanselen@noreply.gitea.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-committed-by: ChristopherHX <christopherhx@noreply.gitea.com>
2025-08-13 21:15:21 +00:00
7ad8e12e45 feat(chart): add replicas parameter for multiple act-runner pods (#24)
This PR adds a parameter to add multiple pods of act-runner from a single values.yaml file (to the statefulSet).

Suggested by: https://gitea.com/gitea/helm-actions/pulls/23

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/24
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: Daan Selen <dselen@nerthus.nl>
Co-committed-by: Daan Selen <dselen@nerthus.nl>
2025-08-12 20:37:11 +00:00
75bf520697 fix: always reference the correct ServiceAccount and Secret namespace (#11)
### Description of the change

Use the same namespace template for all `namespace:` fields, this would be no error if the ServiceAccount would had the same different template than the reference.

I found this while analyzing existing code statically via `namespace:` search.

Updated to also use correct namespace in existing secret lookup

### Benefits

Previously if .Values.namespace and .Release.Namespace didn't match this might caused an install error.

e.g. in values.yml
```yaml
namespace: test
# ** enable provisioning job is required
```
However installed using
```
helm install -f values.yml --create-namespace --namespace install-name-space myactions .
```

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/11
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-04-12 10:36:05 +00:00
41c4bf1bc7 refactor: use gitea.actions for global defines (#10)
### Description of the change

Just moves all defines under a new gitea.actions prefix.

### Additional information

Reduce possibility to cause a name clash with the helm-gitea chart if both would be included in a single helm chart installation.

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/10
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-04-09 19:33:45 +00:00
490e690e09 refactor: remove unused secretName template variable (#12)
### Description of the change

Removes unused variable in template, does not change existing behavior

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/12
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-04-08 16:03:48 +00:00
bf978cf728 feat: allow parameterization of Act Runners persistence (#3)
See [original implementation](https://gitea.com/gitea/helm-gitea/pulls/812).

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/3
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Jack Jackson <scubbojj@gmail.com>
Co-committed-by: Jack Jackson <scubbojj@gmail.com>
2025-04-04 17:18:22 +00:00
7f868a0a27 chore(ci): add shellcheck (#7)
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/7
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com>
Co-authored-by: Markus Pesch <markus.pesch@cryptic.systems>
Co-committed-by: Markus Pesch <markus.pesch@cryptic.systems>
2025-04-03 17:52:36 +00:00
26 changed files with 117 additions and 764 deletions

View File

@ -9,4 +9,7 @@ indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
insert_final_newline = false
[Makefile]
indent_style = tab

View File

@ -0,0 +1,14 @@
name: Lint Shell files
on:
pull_request:
branches: ["*"]
types: ["opened", "reopened", "synchronize"]
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- run: apt update --yes && apt install --yes shellcheck
- run: find . -type f -name "*.sh" -exec shellcheck -a {} \;

1
CODEOWNERS Normal file
View File

@ -0,0 +1 @@
* @rossigee @volker.raschek @ChristopherHX

View File

@ -13,7 +13,18 @@ keywords:
sources:
- https://gitea.com/gitea/helm-actions
- https://gitea.com/gitea/act
# FIXME:
# maintainers:
maintainers:
# https://gitea.com/DaanSelen
- name: Daan Selen
email: dselen@nerthus.nl
# https://gitea.com/volker.raschek
- name: Markus Pesch
email: markus.pesch+apps@cryptic.systems
# https://gitea.com/ChristopherHX
- name: Christopher Homberger
email: christopher.homberger@web.de
dependencies: []

View File

@ -16,4 +16,7 @@ unittests-helm:
.PHONY: helm
update-helm-dependencies:
helm dependency update
.PHONY: yamllint
yamllint:
yamllint -c .yamllint .

View File

@ -1,4 +1,10 @@
# helm-act
# Gitea Actions Helm Chart
This helm chart serves as the way to deploy the Gitea [act-runners](https://gitea.com/gitea/act_runner) alongside a running Gitea instance.
It serves as a standalone chart and does not rely on Gitea to be present in the same environment, however it needs to be able to reach a Gitea instance to function.
The parameters which can be used to customize the deployment are described below, check those out if you want to see if something is supported.
If you want to propose a new feature or mechanism, submit an [issue here](https://gitea.com/gitea/helm-actions/issues).
## Rootless Defaults
@ -15,6 +21,7 @@ If `.Values.image.rootless: true`, then the following will occur. In case you us
| `enabled` | Create an act runner StatefulSet. | `false` |
| `init.image.repository` | The image used for the init containers | `busybox` |
| `init.image.tag` | The image tag used for the init containers | `1.37.0` |
| `statefulset.replicas` | the amount of (replica) runner pods deployed | `1` |
| `statefulset.annotations` | Act runner annotations | `{}` |
| `statefulset.labels` | Act runner labels | `{}` |
| `statefulset.resources` | Act runner resources | `{}` |
@ -32,49 +39,11 @@ If `.Values.image.rootless: true`, then the following will occur. In case you us
| `statefulset.dind.pullPolicy` | The Docker-in-Docker pullPolicy | `IfNotPresent` |
| `statefulset.dind.extraVolumeMounts` | Allows mounting extra volumes in the Docker-in-Docker container | `[]` |
| `statefulset.dind.extraEnvs` | Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY` | `[]` |
| `provisioning.enabled` | Create a job that will create and save the token in a Kubernetes Secret | `false` |
| `provisioning.annotations` | Job's annotations | `{}` |
| `provisioning.labels` | Job's labels | `{}` |
| `provisioning.resources` | Job's resources | `{}` |
| `provisioning.nodeSelector` | NodeSelector for the job | `{}` |
| `provisioning.tolerations` | Tolerations for the job | `[]` |
| `provisioning.affinity` | Affinity for the job | `{}` |
| `provisioning.ttlSecondsAfterFinished` | ttl for the job after finished in order to allow helm to properly recognize that the job completed | `300` |
| `provisioning.publish.repository` | The image that can create the secret via kubectl | `bitnami/kubectl` |
| `provisioning.publish.tag` | The publish image tag that can create the secret | `1.29.0` |
| `provisioning.publish.pullPolicy` | The publish image pullPolicy that can create the secret | `IfNotPresent` |
| `statefulset.persistence.size` | Size for persistence to store act runner data | `1Gi` |
| `existingSecret` | Secret that contains the token | `""` |
| `existingSecretKey` | Secret key | `""` |
| `giteaRootURL` | URL the act_runner registers and connect with | `""` |
### Persistence
| Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------- |
| `persistence.enabled` | Enable persistent storage | `true` |
| `persistence.create` | Whether to create the persistentVolumeClaim for shared storage | `true` |
| `persistence.mount` | Whether the persistentVolumeClaim should be mounted (even if not created) | `true` |
| `persistence.claimName` | Use an existing claim to store repository information | `gitea-shared-storage` |
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
| `persistence.accessModes` | AccessMode for persistence | `["ReadWriteOnce"]` |
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
| `persistence.annotations.helm.sh/resource-policy` | Resource policy for the persistence volume claim | `keep` |
| `persistence.storageClass` | Name of the storage class to use | `nil` |
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
| `persistence.volumeName` | Name of persistent volume in PVC | `""` |
### Image
| Name | Description | Value |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `image.registry` | image registry, e.g. gcr.io,docker.io | `docker.gitea.com` |
| `image.repository` | Image to start for this pod | `gitea` |
| `image.tag` | Visit: [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated). Defaults to `appVersion` within Chart.yaml. | `""` |
| `image.digest` | Image digest. Allows to pin the given image tag. Useful for having control over mutable tags like `latest` | `""` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.rootless` | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `true` |
| `image.fullOverride` | Completely overrides the image registry, path/image, tag and digest. **Adjust `image.rootless` accordingly and review [Rootless defaults](#rootless-defaults).** | `""` |
### Global
| Name | Description | Value |

View File

@ -8,9 +8,14 @@ check_token() {
set +e
echo "Checking for existing token..."
token="$(kubectl get secret "$SECRET_NAME" -o jsonpath="{.data['token']}" 2> /dev/null)"
[ $? -ne 0 ] && return 1
[ -z "$token" ] && return 2
if ! token=$(kubectl get secret "${SECRET_NAME}" -o jsonpath="{.data['token']}" 2> /dev/null); then
return 1
fi
if [ -z "${token}" ]; then
return 2
fi
return 0
}

View File

@ -1,15 +1,6 @@
{{- if .Values.enabled -}}
{{- if .Values.provisioning.enabled -}}
{{- if not (and .Values.persistence.enabled .Values.persistence.mount) -}}
{{- fail "persistence.enabled and persistence.mount are required when provisioning is enabled" -}}
{{- end -}}
{{- if and .Values.persistence.enabled .Values.persistence.mount -}}
{{- if .Values.existingSecret -}}
{{- fail "Can't specify both actions.provisioning.enabled and actions.existingSecret" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if and (not .Values.provisioning.enabled) (or (empty .Values.existingSecret) (empty .Values.existingSecretKey)) -}}
{{- if or (empty .Values.existingSecret) (empty .Values.existingSecretKey) -}}
{{- fail "existingSecret and existingSecretKey are required when provisioning is disabled" -}}
{{- end -}}
{{- if not .Values.giteaRootURL -}}

View File

@ -3,7 +3,7 @@
Expand the name of the chart.
*/}}
{{- define "gitea.name" -}}
{{- define "gitea.actions.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@ -12,7 +12,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "gitea.fullname" -}}
{{- define "gitea.actions.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
@ -28,45 +28,22 @@ If release name contains chart name it will be used as a full name.
{{/*
Create a default worker name.
*/}}
{{- define "gitea.workername" -}}
{{- define "gitea.actions.workername" -}}
{{- printf "%s-%s" .global.Release.Name .worker | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "gitea.chart" -}}
{{- define "gitea.actions.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create image name and tag used by the deployment.
*/}}
{{- define "gitea.image" -}}
{{- $fullOverride := .Values.image.fullOverride | default "" -}}
{{- $registry := .Values.global.imageRegistry | default .Values.image.registry -}}
{{- $repository := .Values.image.repository -}}
{{- $separator := ":" -}}
{{- $tag := .Values.image.tag | default .Chart.AppVersion | toString -}}
{{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}}
{{- $digest := "" -}}
{{- if .Values.image.digest }}
{{- $digest = (printf "@%s" (.Values.image.digest | toString)) -}}
{{- end -}}
{{- if $fullOverride }}
{{- printf "%s" $fullOverride -}}
{{- else if $registry }}
{{- printf "%s/%s%s%s%s%s" $registry $repository $separator $tag $rootless $digest -}}
{{- else -}}
{{- printf "%s%s%s%s%s" $repository $separator $tag $rootless $digest -}}
{{- end -}}
{{- end -}}
{{/*
Storage Class
*/}}
{{- define "gitea.persistence.storageClass" -}}
{{- $storageClass := (tpl ( default "" .Values.persistence.storageClass) .) | default (tpl ( default "" .Values.global.storageClass) .) }}
{{- define "gitea.actions.persistence.storageClass" -}}
{{- $storageClass := default (tpl ( default "" .Values.global.storageClass) .) }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
@ -75,57 +52,37 @@ storageClassName: {{ $storageClass | quote }}
{{/*
Common labels
*/}}
{{- define "gitea.labels" -}}
helm.sh/chart: {{ include "gitea.chart" . }}
app: {{ include "gitea.name" . }}
{{ include "gitea.selectorLabels" . }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
{{- define "gitea.actions.labels" -}}
helm.sh/chart: {{ include "gitea.actions.chart" . }}
app: {{ include "gitea.actions.name" . }}
{{ include "gitea.actions.selectorLabels" . }}
app.kubernetes.io/version: {{ default .Chart.AppVersion | quote }}
version: {{ default .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "gitea.labels.actRunner" -}}
helm.sh/chart: {{ include "gitea.chart" . }}
app: {{ include "gitea.name" . }}-act-runner
{{ include "gitea.selectorLabels.actRunner" . }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
{{- define "gitea.actions.labels.actRunner" -}}
helm.sh/chart: {{ include "gitea.actions.chart" . }}
app: {{ include "gitea.actions.name" . }}-act-runner
{{ include "gitea.actions.selectorLabels.actRunner" . }}
app.kubernetes.io/version: {{ default .Chart.AppVersion | quote }}
version: {{ default .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "gitea.selectorLabels" -}}
app.kubernetes.io/name: {{ include "gitea.name" . }}
{{- define "gitea.actions.selectorLabels" -}}
app.kubernetes.io/name: {{ include "gitea.actions.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "gitea.selectorLabels.actRunner" -}}
app.kubernetes.io/name: {{ include "gitea.name" . }}-act-runner
{{- define "gitea.actions.selectorLabels.actRunner" -}}
app.kubernetes.io/name: {{ include "gitea.actions.name" . }}-act-runner
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "gitea.act_runner.local_root_url" -}}
{{- define "gitea.actions.local_root_url" -}}
{{- .Values.giteaRootURL -}}
{{- end -}}
{{/*
Parse the http url to hostname + port separated by space for the nc command
*/}}
{{- define "gitea.act_runner.nc" -}}
{{- $url := include "gitea.act_runner.local_root_url" . | urlParse -}}
{{- $host := get $url "host" -}}
{{- $scheme := get $url "scheme" -}}
{{- $port := "80" -}}
{{- if contains ":" $host -}}
{{- $hostAndPort := regexSplit ":" $host 2 -}}
{{- $host = index $hostAndPort 0 -}}
{{- $port = index $hostAndPort 1 -}}
{{- else if eq $scheme "https" -}}
{{- $port = "443" -}}
{{- else if eq $scheme "http" -}}
{{- $port = "80" -}}
{{- end -}}
{{- printf "%s %s" $host $port -}}
{{- end -}}

View File

@ -3,10 +3,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "gitea.fullname" . }}-act-runner-config
name: {{ include "gitea.actions.fullname" . }}-act-runner-config
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
{{- include "gitea.actions.labels" . | nindent 4 }}
data:
config.yaml: |
{{- with .Values.statefulset.actRunner.config -}}

View File

@ -1,14 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "gitea.fullname" . }}-scripts
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
data:
{{ (.Files.Glob "scripts/*.sh").AsConfig | indent 2 }}
{{- end }}
{{- end }}

View File

@ -1,115 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
{{- $name := include "gitea.workername" (dict "global" . "worker" "actions-token-job") }}
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ $name }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
{{- with .Values.provisioning.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app.kubernetes.io/component: token-job
annotations:
{{- with .Values.provisioning.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: {{ .Values.provisioning.ttlSecondsAfterFinished }}
template:
metadata:
labels:
{{- include "gitea.labels" . | nindent 8 }}
{{- with .Values.provisioning.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/component: token-job
spec:
initContainers:
- name: init-gitea
image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}"
command:
- sh
- -c
- |
while ! nc -z {{ include "gitea.act_runner.nc" . }}; do
sleep 5
done
containers:
- name: actions-token-create
image: "{{ include "gitea.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: GITEA_APP_INI
value: /data/gitea/conf/app.ini
command:
- sh
- -c
- |
echo "Generating act_runner token via 'gitea actions generate-runner-token'..."
mkdir -p /data/actions/
gitea actions generate-runner-token | grep -E '^.{40}$' | tr -d '\n' > /data/actions/token
resources:
{{- toYaml .Values.provisioning.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /data
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
- name: actions-token-upload
image: "{{ .Values.provisioning.publish.repository }}:{{ .Values.provisioning.publish.tag }}"
imagePullPolicy: {{ .Values.provisioning.publish.pullPolicy }}
env:
- name: SECRET_NAME
value: {{ $secretName }}
command:
- sh
- -c
- |
printf "Checking rights to update kubernetes act_runner secret..."
kubectl auth can-i update secret/${SECRET_NAME}
/scripts/token.sh
resources:
{{- toYaml .Values.provisioning.resources | nindent 12 }}
volumeMounts:
- mountPath: /scripts
name: scripts
readOnly: true
- mountPath: /data
name: data
readOnly: true
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- range $key, $value := .Values.provisioning.nodeSelector }}
nodeSelector:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- with .Values.provisioning.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.provisioning.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Never
serviceAccount: {{ $name }}
volumes:
- name: scripts
configMap:
name: {{ include "gitea.fullname" . }}-scripts
defaultMode: 0755
- name: data
persistentVolumeClaim:
claimName: {{ .Values.persistence.claimName }}
parallelism: 1
completions: 1
backoffLimit: 1
{{- end }}
{{- end }}

View File

@ -1,26 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
{{- $name := include "gitea.workername" (dict "global" . "worker" "actions-token-job") }}
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $name }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
app.kubernetes.io/component: token-job
rules:
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- {{ $secretName }}
verbs:
- get
- update
- patch
{{- end }}
{{- end }}

View File

@ -1,23 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
{{- $name := include "gitea.workername" (dict "global" . "worker" "actions-token-job") }}
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $name }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
app.kubernetes.io/component: token-job
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $name }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}

View File

@ -1,20 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
{{- $name := include "gitea.workername" (dict "global" . "worker" "actions-token-job") }}
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
app.kubernetes.io/component: token-job
{{ $secret := (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
{{ if $secret -}}
data:
token: {{ (b64dec (index $secret.data "token")) | b64enc }}
{{ end -}}
{{- end }}
{{- end }}

View File

@ -1,14 +0,0 @@
{{- if .Values.enabled }}
{{- if and (and .Values.provisioning.enabled .Values.persistence.enabled) .Values.persistence.mount }}
{{- $name := include "gitea.workername" (dict "global" . "worker" "actions-token-job") }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $name }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "gitea.labels" . | nindent 4 }}
app.kubernetes.io/component: token-job
{{- end }}
{{- end }}

View File

@ -1,11 +1,11 @@
{{- if .Values.enabled }}
{{- $secretName := include "gitea.workername" (dict "global" . "worker" "actions-token") }}
{{- $secretName := include "gitea.actions.workername" (dict "global" . "worker" "actions-token") }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
{{- include "gitea.labels.actRunner" . | nindent 4 }}
{{- include "gitea.actions.labels.actRunner" . | nindent 4 }}
{{- with .Values.statefulset.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
@ -13,18 +13,19 @@ metadata:
{{- with .Values.statefulset.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "gitea.fullname" . }}-act-runner
name: {{ include "gitea.actions.fullname" . }}-act-runner
namespace: {{ .Values.namespace | default .Release.Namespace }}
spec:
replicas: {{ .Values.statefulset.replicas | default 1 }}
selector:
matchLabels:
{{- include "gitea.selectorLabels.actRunner" . | nindent 6 }}
{{- include "gitea.actions.selectorLabels.actRunner" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/config-act-runner.yaml") . | sha256sum }}
labels:
{{- include "gitea.labels.actRunner" . | nindent 8 }}
{{- include "gitea.actions.labels.actRunner" . | nindent 8 }}
{{- with .Values.statefulset.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
@ -36,9 +37,12 @@ spec:
- sh
- -c
- |
while ! nc -z {{ include "gitea.act_runner.nc" . }}; do
sleep 5
echo 'Trying to reach Gitea on {{ include "gitea.actions.local_root_url" . }}'
until timeout 10 wget --no-check-certificate --spider {{ include "gitea.actions.local_root_url" . }}; do
sleep 3
echo "Trying again in 3 seconds..."
done
echo "Gitea has been reached!"
containers:
- name: act-runner
image: "{{ .Values.statefulset.actRunner.repository }}:{{ .Values.statefulset.actRunner.tag }}"
@ -57,7 +61,7 @@ spec:
name: "{{ .Values.existingSecret | default $secretName }}"
key: "{{ .Values.existingSecretKey | default "token" }}"
- name: GITEA_INSTANCE_URL
value: {{ include "gitea.act_runner.local_root_url" . }}
value: {{ include "gitea.actions.local_root_url" . }}
- name: CONFIG_FILE
value: /actrunner/config.yaml
resources:
@ -111,7 +115,7 @@ spec:
volumes:
- name: act-runner-config
configMap:
name: {{ include "gitea.fullname" . }}-act-runner-config
name: {{ include "gitea.actions.fullname" . }}-act-runner-config
- name: docker-certs
emptyDir: {}
{{- with .Values.statefulset.extraVolumes }}
@ -122,8 +126,8 @@ spec:
name: data-act-runner
spec:
accessModes: [ "ReadWriteOnce" ]
{{- include "gitea.persistence.storageClass" . | nindent 8 }}
{{- include "gitea.actions.persistence.storageClass" . | nindent 8 }}
resources:
requests:
storage: 1Mi
storage: {{ .Values.statefulset.persistence.size }}
{{- end }}

View File

@ -5,49 +5,15 @@ release:
templates:
- templates/01-consistency-checks.yaml
tests:
- it: fails when provisioning is enabled BUT persistence is completely disabled
set:
persistence:
enabled: false
enabled: true
provisioning:
enabled: true
asserts:
- failedTemplate:
errorMessage: "persistence.enabled and persistence.mount are required when provisioning is enabled"
- it: fails when provisioning is enabled BUT mount is disabled, although persistence is enabled
set:
persistence:
enabled: true
mount: false
enabled: true
provisioning:
enabled: true
asserts:
- failedTemplate:
errorMessage: "persistence.enabled and persistence.mount are required when provisioning is enabled"
- it: fails when provisioning is enabled AND existingSecret is given
set:
enabled: true
provisioning:
enabled: true
existingSecret: "secret-reference"
asserts:
- failedTemplate:
errorMessage: "Can't specify both actions.provisioning.enabled and actions.existingSecret"
- it: fails when provisioning is disabled BUT existingSecret and existingSecretKey are missing
set:
enabled: true
provisioning:
enabled: false
asserts:
- failedTemplate:
errorMessage: "existingSecret and existingSecretKey are required when provisioning is disabled"
- it: fails when provisioning is disabled BUT existingSecretKey is missing
set:
enabled: true
provisioning:
enabled: false
existingSecret: "my-secret"
asserts:
- failedTemplate:
@ -55,8 +21,6 @@ tests:
- it: fails when provisioning is disabled BUT existingSecret is missing
set:
enabled: true
provisioning:
enabled: false
existingSecretKey: "my-secret-key"
asserts:
- failedTemplate:
@ -64,8 +28,6 @@ tests:
- it: fails when LOCAL_ROOT_URL is missing
set:
enabled: true
provisioning:
enabled: false
existingSecret: "my-secret"
existingSecretKey: "my-secret-key"
asserts:

View File

@ -1,47 +0,0 @@
suite: actions template | config-scripts
release:
name: gitea-unittests
namespace: testing
templates:
- templates/config-scripts.yaml
tests:
- it: renders a ConfigMap when all criteria are met
template: templates/config-scripts.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: ConfigMap
apiVersion: v1
name: gitea-unittests-actions-scripts
- isNotNullOrEmpty:
path: data["token.sh"]
- it: doesn't renders a ConfigMap by default
template: templates/config-scripts.yaml
asserts:
- hasDocuments:
count: 0
- it: doesn't renders a ConfigMap with disabled actions but enabled provisioning
template: templates/config-scripts.yaml
asserts:
- hasDocuments:
count: 0
- it: doesn't renders a ConfigMap with disabled actions but otherwise met criteria
template: templates/config-scripts.yaml
set:
enabled: false
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 0

View File

@ -1,88 +0,0 @@
suite: actions template | job
release:
name: gitea-unittests
namespace: testing
chart:
# Override appVersion to have a pinned version for comparison
appVersion: 1.23.6
templates:
- templates/job.yaml
tests:
- it: renders a Job
template: templates/job.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Job
apiVersion: batch/v1
name: gitea-unittests-actions-token-job
- equal:
path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.23.6-rootless"
- it: tag override
template: templates/job.yaml
set:
image.tag: "1.23.7"
enabled: true
provisioning:
enabled: true
publish:
tag: "1.29.0"
persistence:
enabled: true
mount: true
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.23.7-rootless"
- equal:
path: spec.template.spec.containers[1].image
value: "bitnami/kubectl:1.29.0"
- it: doesn't renders a Job by default
template: templates/job.yaml
asserts:
- hasDocuments:
count: 0
- it: doesn't renders a Job when provisioning is enabled BUT actions are not enabled
template: templates/job.yaml
set:
enabled: false
provisioning:
enabled: true
asserts:
- hasDocuments:
count: 0
- it: renders a Job with correct nc command
template: templates/job.yaml
set:
enabled: true
giteaRootURL: "https://git.example.com:8443"
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Job
apiVersion: batch/v1
name: gitea-unittests-actions-token-job
- equal:
path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.23.6-rootless"
- equal:
path: spec.template.spec.initContainers[0].command[2]
value: |
while ! nc -z git.example.com 8443; do
sleep 5
done

View File

@ -1,40 +0,0 @@
suite: actions template | role-job
release:
name: gitea-unittests
namespace: testing
templates:
- templates/role-job.yaml
tests:
- it: doesn't renders a Role by default
template: templates/role-job.yaml
asserts:
- hasDocuments:
count: 0
- it: renders a Role
template: templates/role-job.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
name: gitea-unittests-actions-token-job
- it: doesn't renders a Role when criteria met BUT actions are not enabled
template: templates/role-job.yaml
set:
enabled: false
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 0

View File

@ -1,40 +0,0 @@
suite: actions template | rolebinding-job
release:
name: gitea-unittests
namespace: testing
templates:
- templates/rolebinding-job.yaml
tests:
- it: doesn't renders a RoleBinding by default
template: templates/rolebinding-job.yaml
asserts:
- hasDocuments:
count: 0
- it: renders a RoleBinding
template: templates/rolebinding-job.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
name: gitea-unittests-actions-token-job
- it: doesn't renders a RoleBinding when criteria met BUT actions are not enabled
template: templates/rolebinding-job.yaml
set:
enabled: false
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 0

View File

@ -1,40 +0,0 @@
suite: actions template | secret-token
release:
name: gitea-unittests
namespace: testing
templates:
- templates/secret-token.yaml
tests:
- it: doesn't renders a Secret by default
template: templates/secret-token.yaml
asserts:
- hasDocuments:
count: 0
- it: renders a Secret
template: templates/secret-token.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Secret
apiVersion: v1
name: gitea-unittests-actions-token
- it: doesn't renders a Secret when criteria met BUT actions are not enabled
template: templates/secret-token.yaml
set:
enabled: false
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 0

View File

@ -1,40 +0,0 @@
suite: actions template | serviceaccount-job
release:
name: gitea-unittests
namespace: testing
templates:
- templates/serviceaccount-job.yaml
tests:
- it: doesn't renders a ServiceAccount by default
template: templates/serviceaccount-job.yaml
asserts:
- hasDocuments:
count: 0
- it: renders a ServiceAccount
template: templates/serviceaccount-job.yaml
set:
enabled: true
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: ServiceAccount
apiVersion: v1
name: gitea-unittests-actions-token-job
- it: doesn't renders a ServiceAccount when criteria met BUT actions are not enabled
template: templates/serviceaccount-job.yaml
set:
enabled: false
provisioning:
enabled: true
persistence:
enabled: true
mount: true
asserts:
- hasDocuments:
count: 0

View File

@ -69,7 +69,7 @@ tests:
name: gitea-unittests-actions-act-runner
- equal:
path: spec.template.metadata.annotations["checksum/config"]
value: "e01f6cc186c5b523cba245cbfc9d556df49a71f7f650c979c2dbfd2bf40b9098"
value: "7566d9c60261bf8cbff6a6936fc7aead96cec540d8c793d142a5ad4664c56ba5"
- it: renders a StatefulSet http (with correct GITEA_INSTANCE_URL env from giteaRootURL)
template: templates/statefulset.yaml
set:
@ -92,9 +92,12 @@ tests:
- equal:
path: spec.template.spec.initContainers[0].command[2]
value: |
while ! nc -z git.example.com 80; do
sleep 5
echo 'Trying to reach Gitea on http://git.example.com'
until timeout 10 wget --no-check-certificate --spider http://git.example.com; do
sleep 3
echo "Trying again in 3 seconds..."
done
echo "Gitea has been reached!"
- it: renders a StatefulSet https (with correct GITEA_INSTANCE_URL env from giteaRootURL)
template: templates/statefulset.yaml
set:
@ -117,9 +120,12 @@ tests:
- equal:
path: spec.template.spec.initContainers[0].command[2]
value: |
while ! nc -z git.example.com 443; do
sleep 5
echo 'Trying to reach Gitea on https://git.example.com'
until timeout 10 wget --no-check-certificate --spider https://git.example.com; do
sleep 3
echo "Trying again in 3 seconds..."
done
echo "Gitea has been reached!"
- it: renders a StatefulSet https (with correct GITEA_INSTANCE_URL env from giteaRootURL)
template: templates/statefulset.yaml
set:
@ -142,9 +148,12 @@ tests:
- equal:
path: spec.template.spec.initContainers[0].command[2]
value: |
while ! nc -z git.example.com 8443; do
sleep 5
echo 'Trying to reach Gitea on https://git.example.com:8443'
until timeout 10 wget --no-check-certificate --spider https://git.example.com:8443; do
sleep 3
echo "Trying again in 3 seconds..."
done
echo "Gitea has been reached!"
- it: allows adding custom environment variables to the docker-in-docker container
template: templates/statefulset.yaml
set:

View File

@ -1,10 +1,10 @@
# Configure Gitea Actions
# - must enable persistence if the job is enabled
## @section Gitea Actions
#
## @param enabled Create an act runner StatefulSet.
## @param init.image.repository The image used for the init containers
## @param init.image.tag The image tag used for the init containers
## @param statefulset.replicas the amount of (replica) runner pods deployed
## @param statefulset.annotations Act runner annotations
## @param statefulset.labels Act runner labels
## @param statefulset.resources Act runner resources
@ -22,22 +22,13 @@
## @param statefulset.dind.pullPolicy The Docker-in-Docker pullPolicy
## @param statefulset.dind.extraVolumeMounts Allows mounting extra volumes in the Docker-in-Docker container
## @param statefulset.dind.extraEnvs Allows adding custom environment variables, such as `DOCKER_IPTABLES_LEGACY`
## @param provisioning.enabled Create a job that will create and save the token in a Kubernetes Secret
## @param provisioning.annotations Job's annotations
## @param provisioning.labels Job's labels
## @param provisioning.resources Job's resources
## @param provisioning.nodeSelector NodeSelector for the job
## @param provisioning.tolerations Tolerations for the job
## @param provisioning.affinity Affinity for the job
## @param provisioning.ttlSecondsAfterFinished ttl for the job after finished in order to allow helm to properly recognize that the job completed
## @param provisioning.publish.repository The image that can create the secret via kubectl
## @param provisioning.publish.tag The publish image tag that can create the secret
## @param provisioning.publish.pullPolicy The publish image pullPolicy that can create the secret
## @param statefulset.persistence.size Size for persistence to store act runner data
## @param existingSecret Secret that contains the token
## @param existingSecretKey Secret key
## @param giteaRootURL URL the act_runner registers and connect with
enabled: false
statefulset:
replicas: 1
annotations: {}
labels: {}
resources: {}
@ -72,29 +63,15 @@ statefulset:
# - name: "DOCKER_IPTABLES_LEGACY"
# value: "1"
persistence:
size: 1Gi
init:
image:
repository: busybox
# Overrides the image tag whose default is the chart appVersion.
tag: "1.37.0"
provisioning:
enabled: false
annotations: {}
labels: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
publish:
repository: bitnami/kubectl
tag: 1.29.0
pullPolicy: IfNotPresent
ttlSecondsAfterFinished: 300
## Specify an existing token secret
##
existingSecret: ""
@ -103,52 +80,6 @@ existingSecretKey: ""
## Specify the root URL of the Gitea instance
giteaRootURL: ""
## @section Persistence
#
## @param persistence.enabled Enable persistent storage
## @param persistence.create Whether to create the persistentVolumeClaim for shared storage
## @param persistence.mount Whether the persistentVolumeClaim should be mounted (even if not created)
## @param persistence.claimName Use an existing claim to store repository information
## @param persistence.size Size for persistence to store repo information
## @param persistence.accessModes AccessMode for persistence
## @param persistence.labels Labels for the persistence volume claim to be created
## @param persistence.annotations.helm.sh/resource-policy Resource policy for the persistence volume claim
## @param persistence.storageClass Name of the storage class to use
## @param persistence.subPath Subdirectory of the volume to mount at
## @param persistence.volumeName Name of persistent volume in PVC
persistence:
enabled: true
create: true
mount: true
claimName: gitea-shared-storage
size: 10Gi
accessModes:
- ReadWriteOnce
labels: {}
storageClass:
subPath:
volumeName: ""
annotations:
helm.sh/resource-policy: keep
## @section Image
## @param image.registry image registry, e.g. gcr.io,docker.io
## @param image.repository Image to start for this pod
## @param image.tag Visit: [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated). Defaults to `appVersion` within Chart.yaml.
## @param image.digest Image digest. Allows to pin the given image tag. Useful for having control over mutable tags like `latest`
## @param image.pullPolicy Image pull policy
## @param image.rootless Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher
## @param image.fullOverride Completely overrides the image registry, path/image, tag and digest. **Adjust `image.rootless` accordingly and review [Rootless defaults](#rootless-defaults).**
image:
registry: "docker.gitea.com"
repository: gitea
# Overrides the image tag whose default is the chart appVersion.
tag: ""
digest: ""
pullPolicy: IfNotPresent
rootless: true
fullOverride: ""
## @section Global
#
## @param global.imageRegistry global image registry override