Compare commits

..
13 Commits
Author SHA1 Message Date
volker.raschekandCopilot 6d68d44894 feat(cloudnativePG): support topologySpreadConstraints
Bash / shellcheck (push) Successful in 7s
Bash / bash-unittest (push) Successful in 25s
changelog / changelog (push) Successful in 15s
Helm / helm-lint (push) Successful in 13s
Helm / helm-unittest (push) Successful in 20s
Markdown linter / markdown-lint (push) Successful in 18s
Markdown linter / markdown-link-checker (push) Successful in 52s
A HA `Cluster` is only actually highly available if its instances end up in different failure domains. Pod
anti-affinity alone cannot express that: it only keeps the instances off the same node, not off the same zone,
and `cloudnativePG.affinity` has no way to encode a skew budget. Without `topologySpreadConstraints` a three
instance cluster can legitimately be scheduled into a single availability zone, where a zone outage takes down
the primary and both replicas at once.

Both `affinity` and `topologySpreadConstraints` are rendered only when they are set. The CloudNativePG API
declares them as `omitempty`, so an empty `{}` or `[]` in the manifest would show up as a permanent diff against
the state the operator writes back.

Tolerations deliberately do not get a dedicated value. CloudNativePG has no `spec.tolerations`, it nests them
below `spec.affinity.tolerations`, so they are configured through `cloudnativePG.affinity` like `nodeSelector`
and the anti-affinity settings. A separate top-level value would only have to be folded back into the same place
and would silently conflict with a tolerations list set via `cloudnativePG.affinity`.

Co-authored-by: Copilot <copilot@github.com>
2026-10-04 00:39:08 +02:00
volker.raschekandCopilot 27db0d26b0 feat!: remove the postgresql sub-chart
With `cloudnativePG` in place, the bundled Bitnami `postgresql` sub-chart is the second in-chart way to run a
database, and the worse one. It is a single, non-HA instance without failover, backup or managed major-version
upgrades, and it ships images that Bitnami no longer distributes freely. Keeping it around means maintaining two
code paths for the same job, including the mutual-exclusion assertion between both dependencies and a second set
of DNS, credential and image helpers.

Removing it leaves exactly two supported choices: a CloudNativePG `Cluster` rendered by this chart, or an
external database configured via `gitea.config.database`. Both scale from a single instance to a HA setup -
`cloudnativePG.instances=1` covers the use case the `postgresql` sub-chart served - so nothing is lost besides
the duplication.

BREAKING CHANGE: The `postgresql` sub-chart and all `postgresql.*` values have been removed. There is no
in-place migration path: dump the database of the old `postgresql` release with `pg_dump`, remove the
`postgresql` values, deploy the chart with `cloudnativePG.enabled=true` and restore the dump. Alternatively
point `gitea.config.database` at an externally managed database. Setting `postgresql` now fails the release with
a pointer to the changelog.

Co-authored-by: Copilot <copilot@github.com>
2026-10-04 00:39:05 +02:00
volker.raschekandCopilot 1b82a15b7f feat!: replace postgresql-ha with CloudNativePG
The bundled `postgresql-ha` sub-chart was the only HA-ready database option, but it pinned us to a Bitnami chart
whose images are no longer freely distributed, and it bundled repmgr and pgpool into the release. Operating a
Postgres cluster through a Helm release also means the chart has to reimplement failover, backup and upgrade
orchestration that a dedicated operator already solves.

CloudNativePG is the de-facto standard operator for Postgres on Kubernetes and handles instance management,
streaming replication, switchover and rolling upgrades itself. The operator is deliberately *not* part of this
chart: cluster-scoped CRDs and controllers do not belong into an application release and would conflict with an
operator that is already installed. The chart only renders the namespaced `Cluster` resource, so the operator can
be managed independently.

Because the operator cannot be assumed to be present, `cloudnativePG.enabled` defaults to `false`. Existing users
of `postgresql` or an external database are therefore unaffected.

Credentials follow the chart-wide `secrets.*` convention. Only the password is read from a Secret, because
CloudNativePG requires `bootstrap.initdb.database` and `bootstrap.initdb.owner` as literals in the `Cluster` spec
and cannot resolve them from a Secret. The password is injected into the `init-app-ini` container as
`GITEA__database__PASSWD` instead of being written into the generated `app.ini`.

BREAKING CHANGE: The `postgresql-ha` sub-chart and all `postgresql-ha.*` values have been removed. There is no
in-place migration path between the two deployments: dump the database of the old `postgresql-ha` release with
`pg_dump`, remove the `postgresql-ha` values, deploy the chart with `cloudnativePG.enabled=true` and restore the
dump. Setting `postgresql-ha` now fails the release with a pointer to the changelog.

Co-authored-by: Copilot <copilot@github.com>
2026-10-04 00:18:34 +02:00
volker.raschekandCopilot eeacda2a25 test: align the file names of the helm unit tests with the chart conventions
The chart conventions demand camelCase file names, forbid short names like `svc` and require the unit tests to
mirror the template structure. The unit tests followed none of that consistently. Four casings existed side by
side - camelCase (extraInitContainers.yaml), kebab-case (checksum-annotations.yaml), a snake and kebab mix
(init_directory_structure.sh-rootless.yaml) and all caps (HA.yaml) - so there was no pattern to copy when
adding a suite, which is how the inconsistency kept growing.

Three groups of problems are fixed:

- svc-configuration.yaml used exactly the short name the conventions forbid for files and keys.
- Several file names repeated their own directory, for example deployment/deployment-additional-config.yaml and
  metric-secret/metrics-secret-servicemonitor-disabled.yaml, which names the subject three times. The directory
  already carries that information, so the file name now only carries the scenario. The default scenario of a
  template is named basics.yaml.
- Four suites lived in a directory of a template they do not assert on. They were filed under deployment/
  because the deployment is rendered as a side effect, not because it is the subject:

      deployment/deprecations.yaml                -> deprecation/deployment.yaml
      deployment/inline-config.yaml               -> config/inlineConfig.yaml
      deployment/storage-class-configuration.yaml -> persistentVolumeClaim/storageClass.yaml
      deployment/svc-configuration.yaml           -> service/configuration.yaml

  storage-class-configuration.yaml is the clearest case: a persistentVolumeClaim directory already existed next
  to it. The suite titles of the two suites whose subject changed are adjusted accordingly.

The Makefile passed `--file unittests/helm/values-conflicting-checks.yaml`, but that file does not exist in the
tree. `helm unittest` ignores a missing path without a warning, so the flag has been dead for an unknown amount
of time while still suggesting the checks run. It is removed; the `unittests/helm/**/*.yaml` glob would pick
the file up anyway if it ever returns.

The naming rule is written down in the copilot instructions, together with the constraint that the glob matches
only a single directory level, so a suite can never be placed directly in unittests/helm/.

All 49 suites and 267 tests still pass.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 22:19:39 +02:00
volker.raschekandCopilot fef4190a74 test: normalize the suite titles of the helm unit tests
Bash / bash-unittest (push) Successful in 14s
Bash / shellcheck (push) Successful in 20s
changelog / changelog (push) Successful in 16s
Helm / helm-lint (push) Successful in 15s
Helm / helm-unittest (push) Successful in 32s
Markdown linter / markdown-lint (push) Successful in 15s
Markdown linter / markdown-link-checker (push) Successful in 56s
The contributor guidelines never defined how a `suite` title has to look, only how an `it` title has to look.
Without a rule five competing schemes grew side by side: `config template | cache config`, `deployment
template (probes)`, `ServiceMonitor template (basic)`, `Test Gateway API httpRoute.yaml` and `Dependency checks
| Customization integrity | valkey`. 24 of the 49 titles started with a lowercase letter, which contradicts the
sentence rule that already applies to the test titles.

More than cosmetics, the missing rule produced three concrete defects:

- `deployment template` was used by both deployment-additional-config.yaml and extraInitContainers.yaml, and
  `Init template` by both init_directory_structure.sh.yaml and its rootless counterpart. `helm unittest`
  identifies a failing suite by its title, so a failure in either file printed the same header and the report
  did not say which file to open.
- deployment/inline-config.yaml was titled `config template`, although it lives in the deployment directory and
  asserts on secret_inlineConfig.yaml. It read like a sixth member of the `config template | ...` group.
- persistentVolumeClaim.yaml was titled `PVC template`, using exactly the short name the chart conventions
  forbid for files and keys.

All suites now follow `Test <subject> <scenario>`, for example `Test deployment probes` or `Test gateway API
httpRoute`. The subject is the template under test, the scenario is what distinguishes the suite from its
siblings, so every title is unique and sorts next to its related suites. The `Test ` prefix of the Gateway API,
ingress and route suites is kept, because it is the only part of the old schemes that already read as a
sentence; the redundant `.yaml` suffix and the `tests` suffix of the storage class suite are dropped.

The rule is written down in the Unit Tests section of the copilot instructions, so the next suite does not have
to guess which of the five schemes was meant.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 21:21:46 +02:00
volker.raschekandCopilot bb3b59f1ee test: normalize the titles of the helm unit tests
Bash / shellcheck (push) Successful in 8s
Bash / bash-unittest (push) Successful in 24s
changelog / changelog (push) Successful in 16s
Helm / helm-lint (push) Successful in 18s
Helm / helm-unittest (push) Successful in 35s
The contributor guidelines require that the title of a unit test is "a short sentence starting with a capital
letter and ending without a period". Only 30 of the 269 titles followed that rule. The remaining ones were
lowercase verb phrases ("renders a deployment"), which made the test output read inconsistently depending on
which suite was running, and made it impossible to tell a convention violation from an intentional style.

All titles are now imperative, capitalized and unquoted-safe:

  renders a deployment                                 -> Render a Deployment
  should not render when gatewayAPI.enabled is false   -> Skip rendering when gatewayAPI.enabled is false
  skips gpg volume spec                                -> Skip the gpg volume spec

The bracketed prefixes of the dependency checks and of the server section suite are kept, because they group
the tests by the chart they assert on. Only the sentence behind the prefix was rewritten.

Beyond the pure capitalization three classes of titles needed real rewording:

- The titles in image-configuration.yaml named a subject instead of a scenario ("default values", "tag
  override", "digest and global registry"). They now describe what is rendered.
- init_directory_structure.sh-rootless.yaml carried "it does not chown /data ...", which rendered as
  "it it does not chown" in the test output.
- The "should" prefix in the Gateway API and route suites added no information once the title is a sentence.

The title of the GIT_GC_REPOS test lost its embedded double quotes. The title was previously an unquoted YAML
scalar, so the quotes were literal characters; quoting the title turned them into a parse error. The value is
unambiguous without them.

Three byte-identical tests asserting pgpool.adminPassword existed in customization-integrity-postgresql-ha.yaml
- same template, same assertion, same expected value. They were a copy-paste artifact and shared one title, so
two of them are removed. No coverage is lost, which is why the test count drops from 269 to 267.

No snapshot files are tracked and no suite uses matchSnapshot, so retitling cannot invalidate stored snapshots.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 21:17:18 +02:00
volker.raschekandCopilot 7c18b18a47 docs: drop the emphasis from the app.ini heading
Bash / shellcheck (push) Successful in 8s
changelog / changelog (push) Successful in 18s
Helm / helm-lint (push) Successful in 15s
Helm / helm-unittest (push) Successful in 41s
Bash / bash-unittest (push) Successful in 25s
Markdown linter / markdown-lint (push) Successful in 16s
Markdown linter / markdown-link-checker (push) Successful in 1m4s
markdown-link-check derives the anchor from the raw heading text, where the underscores of the emphasis survive
slugification as `additional-_appini_-settings`. Gitea and GitHub slugify the rendered heading instead, so the
anchor really is `additional-appini-settings` and the table of contents entry was correct all along - the checker
simply could not see it.

The entry appeared with the last regeneration of the README, which is why the job started failing now even though
the heading has been around for much longer. Removing the emphasis makes both slugifiers agree without changing the
anchor, so existing deep links keep working.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 20:59:40 +02:00
volker.raschekandCopilot 6821e792b2 ci: check the shell scripts with shellcheck
Bash / bash-unittest (push) Successful in 14s
Bash / shellcheck (push) Successful in 20s
changelog / changelog (push) Successful in 15s
Helm / helm-lint (push) Successful in 16s
Helm / helm-unittest (push) Successful in 32s
The chart ships shell scripts into the init containers, where a quoting or exit code bug surfaces as a broken
deployment rather than as a failing test. The bats suite covers the behaviour of config_environment.sh, but not the
classes of defects a static analyser catches, so shellcheck runs alongside it now.

The action is pinned to a commit sha, as the other actions of this workflow already are. Note that the tag is named
`2.0.0` and not `v2.0.0`, so the version comment deviates from the usual `# v<version>` form.

Submodules are deliberately not checked out. The action scans the whole working directory, and bats-core alone would
contribute several hundred files that are not ours to fix.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 20:31:12 +02:00
volker.raschekandCopilot 9f7064724e fix(scripts): resolve the shellcheck findings of config_environment.sh
The script masked the exit codes of every command substitution it ran. `local` and `export` are commands
themselves, so their own return value overwrites the one of the substitution and `set -e` never sees a failure.
This was not only cosmetic: when `gitea generate secret` failed, the init container happily continued and exported
an empty `INTERNAL_TOKEN`, `SECRET_KEY`, `JWT_SECRET` and `LFS_JWT_SECRET`. Declaration and assignment are now
separated, which lets `set -e` abort instead of writing an app.ini with empty secrets. (SC2155)

`env2ini::log` passed its argument as the format string of `printf`. Settings names and section names are read from
user supplied configuration and are logged verbatim, so a value containing a `%` directive made `printf` consume
non-existing arguments. The message is passed as data now. `%b` instead of `%s` keeps the `\n` escapes of the
existing call sites working. (SC2059)

The remaining changes quote the file name variables and add `-r` to the `read` of the `find -print0` loop, where an
unquoted path or a backslash in a mount point would have been mangled. (SC2086, SC2162)

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 20:31:02 +02:00
volker.raschekandCopilot 49a221008a chore: remove the leftovers of the act runner deployment
changelog / changelog (push) Successful in 16s
Bash / bash-unittest (push) Successful in 27s
Helm / helm-unittest (push) Successful in 1m12s
Helm / helm-lint (push) Successful in 10s
Markdown linter / markdown-link-checker (push) Failing after 37s
Markdown linter / markdown-lint (push) Successful in 15s
`scripts/act_runner/token.sh` bootstrapped the registration token of an act runner by patching a Kubernetes Secret
with kubectl. The deployment it belonged to is long gone, and no glob picked the file up either: the chart only ships
`scripts/init-containers/config/*.sh` and `scripts/init-containers/init/*.sh`, so the script was not even part of the
packaged chart.

The label helpers `gitea.labels.actRunner` and `gitea.selectorLabels.actRunner` were orphaned the same way. The former
is referenced by no template at all and the latter only by the former, which left them as a closed loop without an
entry point.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 19:59:53 +02:00
volker.raschekandCopilot 93a576ca11 feat!: remove extraInitVolumeMounts in favour of per init container volumeMounts
Every chart-managed init container already exposes its own `volumeMounts` through the linked configuration block, so
`extraInitVolumeMounts` added a second way to express the same thing. It was also the only mount setting left outside
of `deployment`, which made the mount configuration harder to discover than it needed to be.

Worse, the name promised more than it delivered. The value was only injected into the four linked init containers and
never reached an init container added through `deployment.initContainers[].container`, even though that is exactly
what a reader would expect from a setting called "extra init volume mounts". The documented use case does not need
the fan-out either: the sample `initPreScript` copies the Postgres client certificate onto the `data` volume, so a
single mount on `deployment.initDirectories.volumeMounts` is enough and the later containers pick it up via /data.

With the value gone the `gitea.init-additional-mounts` helper has no purpose left and is removed together with its
four call sites, which now rely on the already existing `volumeMounts` block of the respective init container.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 19:30:50 +02:00
volker.raschekandCopilot c96e5d4132 feat!: remove the deprecated extraVolumeMounts value
`extraVolumeMounts` was deprecated in 6.0.0 in favour of separate mounts for the init phase and the runtime container,
but it was never removed. It had turned into a trap: both helpers treated it as a fallback that silently disappeared as
soon as `extraInitVolumeMounts` respectively `deployment.gitea.volumeMounts` contained a single entry, so adding one
new mount could unmount everything configured through the old value. The documented successor
`extraContainerVolumeMounts` had meanwhile been removed itself, which left the deprecation note pointing at a value
that already fails the deprecation check.

Removing it makes the mount configuration explicit: `extraInitVolumeMounts` for the init containers,
`deployment.gitea.volumeMounts` for the Gitea container, and both when a volume is needed in both places.

The GPG init container used `extraVolumeMounts` directly instead of the shared helper and therefore ignored
`extraInitVolumeMounts`, unlike the three other init containers. It now uses `gitea.init-additional-mounts` as well.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 19:14:20 +02:00
volker.raschekandCopilot ccd470557f docs(values): drop the orphaned deprecation note for the extra init containers
The `preExtraInitContainers` and `postExtraInitContainers` values were removed together with the migration to
`deployment.initContainers` and are covered by a `fail` guard in templates/deprecation.yaml. Only the `## @deprecated`
annotation was left behind, pointing at values that no longer appear anywhere in this file. A reader scanning the
Init section had no way to tell that the note described a completed migration rather than a value still waiting to be
migrated.

Co-authored-by: Copilot <copilot@github.com>
2026-10-03 19:02:17 +02:00
72 changed files with 1040 additions and 933 deletions

No files matched your search

+6
View File
@@ -21,3 +21,9 @@ jobs:
TERM: xterm TERM: xterm
name: Run bash unittests name: Run bash unittests
run: make bash/unittest run: make bash/unittest
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
+4 -2
View File
@@ -2,7 +2,7 @@
## Project Overview ## Project Overview
Kubernetes Helm chart for deploying [Gitea](https://gitea.com). Uses Go/Helm templating (`templates/`), YAML values (`values.yaml`), and includes sub-charts for PostgreSQL, PostgreSQL-HA, Valkey, and Valkey-cluster. Kubernetes Helm chart for deploying [Gitea](https://gitea.com). Uses Go/Helm templating (`templates/`), YAML values (`values.yaml`), and includes a sub-chart for Valkey. The database is provisioned as a CloudNativePG `Cluster` resource, the operator itself is not part of the chart.
## Build & Test ## Build & Test
@@ -52,11 +52,13 @@ data:
### Unit Tests ### Unit Tests
- Helm unit tests live in `unittests/helm/` mirroring the template structure. - Helm unit tests live in `unittests/helm/` mirroring the template structure. A suite belongs into the directory of the template it asserts on, never into the directory of a template it only renders as a side effect.
- Test files are YAML using the [helm-unittest](https://github.com/helm-unittest/helm-unittest) format. - Test files are YAML using the [helm-unittest](https://github.com/helm-unittest/helm-unittest) format.
- Name test files in camelCase after the scenario they cover (e.g. `signingEnabled.yaml`), use `basics.yaml` for the default scenario and do not repeat the directory name in the file name. The `make helm/unittest` glob only matches one directory level, so every suite must live in a subdirectory.
- Each test must set all required values explicitly — do not rely on cross-test state. - Each test must set all required values explicitly — do not rely on cross-test state.
- The `values.yaml` file must pass `yamllint`. The configuration is in `.yamllint.yaml`. Use `make yamllint` to run the linter. - The `values.yaml` file must pass `yamllint`. The configuration is in `.yamllint.yaml`. Use `make yamllint` to run the linter.
- The title of the unit test should clearly describe the scenario being tested. As title must be use a short sentence starting with a capital letter and ending without a period. - The title of the unit test should clearly describe the scenario being tested. As title must be use a short sentence starting with a capital letter and ending without a period.
- The `suite` title follows the pattern `Test <subject> <scenario>` (e.g. `Test deployment probes`). It must be unique across all suites, because `helm unittest` identifies a failing suite by this title.
- Each unit test must explicitly set a custom namespace and release name, rather than relying on defaults. - Each unit test must explicitly set a custom namespace and release name, rather than relying on defaults.
- Assert `Secret` content via `data.*` with `decodeBase64: true` and add a `notExists` assertion for `stringData`. - Assert `Secret` content via `data.*` with `decodeBase64: true` and add a `notExists` assertion for `stringData`.
+2 -8
View File
@@ -1,12 +1,6 @@
dependencies: dependencies:
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.7.27
- name: postgresql-ha
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.3.2
- name: valkey - name: valkey
repository: https://valkey.io/valkey-helm repository: https://valkey.io/valkey-helm
version: 0.10.0 version: 0.10.0
digest: sha256:1afecbf0d4fc9f48e31417573d4bed7e0ac7848040b9e0c5f3989ada9d1f944f digest: sha256:c3deb43d02228f143e1c9525f5ce06dc6a78646e763c7a73c5ec8ea0101ed2f5
generated: "2026-07-20T19:52:11.548874634+02:00" generated: "2026-10-04T00:24:11.331968211+02:00"
-10
View File
@@ -36,16 +36,6 @@ maintainers:
email: christopher.homberger@web.de email: christopher.homberger@web.de
dependencies: dependencies:
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.7.27
condition: postgresql.enabled
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml
- name: postgresql-ha
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.3.2
condition: postgresql-ha.enabled
# https://github.com/bitnami/charts/blob/main/bitnami/valkey/Chart.yaml # https://github.com/bitnami/charts/blob/main/bitnami/valkey/Chart.yaml
- name: valkey - name: valkey
repository: https://valkey.io/valkey-helm repository: https://valkey.io/valkey-helm
+1 -1
View File
@@ -39,7 +39,7 @@ helm/dependency-update:
# ============================================================================== # ==============================================================================
PHONY+=helm/unittest PHONY+=helm/unittest
helm/unittest: helm/unittest:
helm unittest --strict --file 'unittests/helm/**/*.yaml' --file 'unittests/helm/values-conflicting-checks.yaml' ./ helm unittest --strict --file 'unittests/helm/**/*.yaml' ./
# BASH PREPARE # BASH PREPARE
# ============================================================================== # ==============================================================================
+101 -104
View File
@@ -4,7 +4,6 @@
- [Update and versioning policy](#update-and-versioning-policy) - [Update and versioning policy](#update-and-versioning-policy)
- [Dependencies](#dependencies) - [Dependencies](#dependencies)
- [HA Dependencies](#ha-dependencies) - [HA Dependencies](#ha-dependencies)
- [Non-HA Dependencies](#non-ha-dependencies)
- [Dependency Versioning](#dependency-versioning) - [Dependency Versioning](#dependency-versioning)
- [Installing](#installing) - [Installing](#installing)
- [High Availability](#high-availability) - [High Availability](#high-availability)
@@ -19,6 +18,7 @@
- [Gateway API](#gateway-api) - [Gateway API](#gateway-api)
- [Session, Cache and Queue](#session-cache-and-queue) - [Session, Cache and Queue](#session-cache-and-queue)
- [Single-Pod Configurations](#single-pod-configurations) - [Single-Pod Configurations](#single-pod-configurations)
- [Additional app.ini settings](#additional-appini-settings)
- [User defined environment variables in app.ini](#user-defined-environment-variables-in-appini) - [User defined environment variables in app.ini](#user-defined-environment-variables-in-appini)
- [External Database](#external-database) - [External Database](#external-database)
- [Ports and external url](#ports-and-external-url) - [Ports and external url](#ports-and-external-url)
@@ -57,8 +57,7 @@
- [ReadinessProbe](#readinessprobe) - [ReadinessProbe](#readinessprobe)
- [StartupProbe](#startupprobe) - [StartupProbe](#startupprobe)
- [valkey](#valkey) - [valkey](#valkey)
- [PostgreSQL HA](#postgresql-ha) - [CloudNativePG](#cloudnativepg)
- [PostgreSQL](#postgresql)
- [Advanced](#advanced) - [Advanced](#advanced)
- [Contributing](#contributing) - [Contributing](#contributing)
- [Upgrading](#upgrading) - [Upgrading](#upgrading)
@@ -96,24 +95,21 @@ Users can also configure their own external providers via the configuration.
### HA Dependencies ### HA Dependencies
These dependencies are enabled by default: - PostgreSQL ([CloudNativePG](https://cloudnative-pg.io/)), disabled by default
- Valkey ([Official Valkey Helm Chart](https://github.com/valkey-io/valkey-helm)), enabled by default
- PostgreSQL HA ([Bitnami PostgreSQL-HA](https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml)) CloudNativePG is **not** bundled as a sub-chart.
- Valkey ([Official Valkey Helm Chart](https://github.com/valkey-io/valkey-helm)) Only the `Cluster` resource is rendered by this chart, the [CloudNativePG operator](https://cloudnative-pg.io/documentation/current/installation_upgrade/) must already be installed cluster-wide.
Because that operator cannot be assumed to be present, `cloudnativePG.enabled` defaults to `false`.
### Non-HA Dependencies Set it to `true` once the operator is installed, or use an external database instead.
Alternatively, the following non-HA replacements are available:
- PostgreSQL ([Bitnami PostgreSQL](https://github.com/bitnami/charts/blob/main/bitnami/postgresql/Chart.yaml))
### Dependency Versioning ### Dependency Versioning
Updates of sub-charts will be incorporated into the Gitea chart as they are released. Updates of sub-charts will be incorporated into the Gitea chart as they are released.
The reasoning behind this is that new users of the chart will start with the most recent sub-chart dependency versions. The reasoning behind this is that new users of the chart will start with the most recent sub-chart dependency versions.
**Note** If you want to stay on an older appVersion of a sub-chart dependency (e.g. PostgreSQL), you need to override the image tag in your `values.yaml` file. **Note** If you want to stay on an older appVersion of a dependency (e.g. PostgreSQL), you need to override the image tag in your `values.yaml` file.
In fact, we recommend to do so right from the start to be independent of major sub-chart dependency changes as they are released. In fact, we recommend to do so right from the start to be independent of major dependency changes as they are released.
There is no need to update to every new PostgreSQL major version - you can happily skip some and do larger updates when you are ready for them. There is no need to update to every new PostgreSQL major version - you can happily skip some and do larger updates when you are ready for them.
We recommend to use a rolling tag like `:<majorVersion>-debian-<debian major version>` to incorporate minor and patch updates for the respective major version as they are released. We recommend to use a rolling tag like `:<majorVersion>-debian-<debian major version>` to incorporate minor and patch updates for the respective major version as they are released.
@@ -121,8 +117,7 @@ Alternatively you can also use a versioning helper tool like [renovate](https://
Please double-check the image repository and available tags in the sub-chart: Please double-check the image repository and available tags in the sub-chart:
- [PostgreSQL-HA](https://hub.docker.com/r/bitnami/postgresql-repmgr/tags) - [CloudNativePG](https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql)
- [PostgreSQL](https://hub.docker.com/r/bitnami/postgresql/tags)
- [Valkey](https://hub.docker.com/r/valkey/valkey/tags) - [Valkey](https://hub.docker.com/r/valkey/valkey/tags)
and look up the image tag which fits your needs on Dockerhub. and look up the image tag which fits your needs on Dockerhub.
@@ -222,17 +217,20 @@ _All default settings are made directly in the generated `app.ini`, not in the V
#### Database defaults #### Database defaults
If a builtIn database is enabled the database configuration is set automatically. If a builtIn database is enabled the database configuration is set automatically.
For example, PostgreSQL builtIn will appear in the `app.ini` as: For example, the CloudNativePG `Cluster` will appear in the `app.ini` as:
```ini ```ini
[database] [database]
DB_TYPE = postgres DB_TYPE = postgres
HOST = RELEASE-NAME-postgresql.default.svc.cluster.local:5432 HOST = RELEASE-NAME-postgresql-rw.default.svc.cluster.local:5432
NAME = gitea NAME = gitea
PASSWD = gitea
USER = gitea USER = gitea
``` ```
`PASSWD` is not part of the generated `app.ini`.
It is injected into the `init-app-ini` init container as the `GITEA__database__PASSWD` environment variable, sourced
from the credentials Secret referenced by `cloudnativePG.credentials`, and merged into the `app.ini` at startup.
#### Server defaults #### Server defaults
The server defaults are a bit more complex. The server defaults are a bit more complex.
@@ -334,7 +332,7 @@ External tools such as `valkey` or `memcached` handle these workloads much bette
If HA is not needed/desired, the following configurations can be used to deploy a single-pod Gitea instance. If HA is not needed/desired, the following configurations can be used to deploy a single-pod Gitea instance.
1. For a production-ready single-pod Gitea instance without external dependencies (using the chart dependency `postgresql` and `valkey`): 1. For a production-ready single-pod Gitea instance (using the chart dependency `valkey` and a single-instance CloudNativePG `Cluster`):
<details> <details>
@@ -343,10 +341,9 @@ If HA is not needed/desired, the following configurations can be used to deploy
```yaml ```yaml
valkey: valkey:
enabled: true enabled: true
postgresql: cloudnativePG:
enabled: true enabled: true
postgresql-ha: instances: 1
enabled: false
persistence: persistence:
enabled: true enabled: true
@@ -374,9 +371,7 @@ If HA is not needed/desired, the following configurations can be used to deploy
```yaml ```yaml
valkey: valkey:
enabled: false enabled: false
postgresql: cloudnativePG:
enabled: false
postgresql-ha:
enabled: false enabled: false
persistence: persistence:
@@ -396,7 +391,7 @@ If HA is not needed/desired, the following configurations can be used to deploy
</details> </details>
### Additional _app.ini_ settings ### Additional app.ini settings
> **The [generic](https://docs.gitea.com/administration/config-cheat-sheet#overall-default) > **The [generic](https://docs.gitea.com/administration/config-cheat-sheet#overall-default)
> section cannot be defined that way.** > section cannot be defined that way.**
@@ -488,7 +483,7 @@ Priority (highest to lowest) for defining app.ini variables:
Any external database listed in [https://docs.gitea.com/installation/database-prep/](https://docs.gitea.com/installation/database-prep/) can be used instead of the built-in PostgreSQL. Any external database listed in [https://docs.gitea.com/installation/database-prep/](https://docs.gitea.com/installation/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. 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. If an external database is used, no matter which type, make sure to set `cloudnativePG.enabled` to `false` to disable the use of the built-in PostgreSQL.
```yaml ```yaml
gitea: gitea:
@@ -501,10 +496,7 @@ gitea:
PASSWD: gitea PASSWD: gitea
SCHEMA: gitea SCHEMA: gitea
postgresql: cloudnativePG:
enabled: false
postgresql-ha:
enabled: false enabled: false
``` ```
@@ -607,14 +599,14 @@ persistence:
In case that persistence 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. The CloudNativePG `Cluster` handles the persistence on its own.
You can interact with the postgres settings as displayed in the following example: You can interact with its storage settings as displayed in the following example:
```yaml ```yaml
postgresql: cloudnativePG:
persistence: storage:
enabled: true size: 20Gi
existingClaim: MyAwesomeGiteaPostgresClaim storageClass: myOwnStorageClass
``` ```
### Admin User ### Admin User
@@ -1034,8 +1026,8 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `deployment.labels` | Labels for the deployment. | `{}` | | `deployment.labels` | Labels for the deployment. | `{}` |
| `deployment.affinity` | Affinity for the deployment. | `{}` | | `deployment.affinity` | Affinity for the deployment. | `{}` |
| `deployment.dnsConfig` | dnsConfig of the Gitea deployment. | `{}` | | `deployment.dnsConfig` | dnsConfig of the Gitea deployment. | `{}` |
| `deployment.gitea.env` | Additional environment variables to pass to the gitea container. | `[]` | | `deployment.gitea.env` | Additional environment variables to pass to the Gitea container. | `[]` |
| `deployment.gitea.envFrom` | List of environment variables mounted from configMaps or secrets for the gitea container. | `[]` | | `deployment.gitea.envFrom` | List of environment variables mounted from configMaps or secrets for the Gitea container. | `[]` |
| `deployment.gitea.image.registry` | image registry, e.g. gcr.io,docker.io. | `docker.gitea.com` | | `deployment.gitea.image.registry` | image registry, e.g. gcr.io,docker.io. | `docker.gitea.com` |
| `deployment.gitea.image.repository` | Image to start for this pod. | `gitea` | | `deployment.gitea.image.repository` | Image to start for this pod. | `gitea` |
| `deployment.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. | `""` | | `deployment.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. | `""` |
@@ -1121,7 +1113,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `gatewayAPI.core.backendTLSPolicy.targetRefs` | Target references for the BackendTLSPolicy. Defaults to the HTTP service. | `[]` | | `gatewayAPI.core.backendTLSPolicy.targetRefs` | Target references for the BackendTLSPolicy. Defaults to the HTTP service. | `[]` |
| `gatewayAPI.core.backendTLSPolicy.validation` | Validation configuration (required when enabled). See `docs/gateway-api.md`. | `{}` | | `gatewayAPI.core.backendTLSPolicy.validation` | Validation configuration (required when enabled). See `docs/gateway-api.md`. | `{}` |
| `gatewayAPI.core.backendTLSPolicy.validation.caCertificateRefs` | CA certificate references for the BackendTLSPolicy validation. See `docs/gateway-api.md`. | | | `gatewayAPI.core.backendTLSPolicy.validation.caCertificateRefs` | CA certificate references for the BackendTLSPolicy validation. See `docs/gateway-api.md`. | |
| `gatewayAPI.core.backendTLSPolicy.validation.hostname` | Hostname for the BackendTLSPolicy validation. Must be the Common Name (CN) or a Subject Alternative Name (SAN) of the gitea server certificate. See `docs/gateway-api.md`. | | | `gatewayAPI.core.backendTLSPolicy.validation.hostname` | Hostname for the BackendTLSPolicy validation. Must be the Common Name (CN) or a Subject Alternative Name (SAN) of the Gitea server certificate. See `docs/gateway-api.md`. | |
| `gatewayAPI.core.httpRoute.enabled` | Render an HTTPRoute resource. | `false` | | `gatewayAPI.core.httpRoute.enabled` | Render an HTTPRoute resource. | `false` |
| `gatewayAPI.core.httpRoute.annotations` | Annotations applied to the HTTPRoute. | `{}` | | `gatewayAPI.core.httpRoute.annotations` | Annotations applied to the HTTPRoute. | `{}` |
| `gatewayAPI.core.httpRoute.labels` | Additional labels applied to the HTTPRoute. | `{}` | | `gatewayAPI.core.httpRoute.labels` | Additional labels applied to the HTTPRoute. | `{}` |
@@ -1152,7 +1144,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `ingress.hosts[0].host` | Default Ingress host. | `git.example.com` | | `ingress.hosts[0].host` | Default Ingress host. | `git.example.com` |
| `ingress.hosts[0].paths[0].path` | Default Ingress path. | `/` | | `ingress.hosts[0].paths[0].path` | Default Ingress path. | `/` |
| `ingress.tls` | Ingress tls settings. | `[]` | | `ingress.tls` | Ingress tls settings. | `[]` |
| `namespace` | An explicit namespace to deploy gitea into. Defaults to the release namespace if not specified. | `""` | | `namespace` | An explicit namespace to deploy Gitea into. Defaults to the release namespace if not specified. | `""` |
### Network ### Network
@@ -1212,7 +1204,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `secrets.config.existingSecret.secretName` | Name of the already existing config Secret. | `""` | | `secrets.config.existingSecret.secretName` | Name of the already existing config Secret. | `""` |
| `secrets.config.new.annotations` | Annotations for the config Secret. | `{}` | | `secrets.config.new.annotations` | Annotations for the config Secret. | `{}` |
| `secrets.config.new.labels` | Labels for the config Secret. | `{}` | | `secrets.config.new.labels` | Labels for the config Secret. | `{}` |
| `secrets.gpg.enabled` | Enable mounting of a GPG key to sign git commits. | `false` | | `secrets.gpg.enabled` | Enable mounting of a GPG key to sign Git commits. | `false` |
| `secrets.gpg.addSHASumAnnotation` | Add a pod annotation with the SHA sum of the GPG key Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation). | `false` | | `secrets.gpg.addSHASumAnnotation` | Add a pod annotation with the SHA sum of the GPG key Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation). | `false` |
| `secrets.gpg.existingSecret.enabled` | Use an already existing Secret instead of creating the GPG key Secret. | `false` | | `secrets.gpg.existingSecret.enabled` | Use an already existing Secret instead of creating the GPG key Secret. | `false` |
| `secrets.gpg.existingSecret.secretName` | Name of the already existing GPG key Secret. | `""` | | `secrets.gpg.existingSecret.secretName` | Name of the already existing GPG key Secret. | `""` |
@@ -1287,21 +1279,19 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
### Persistence ### Persistence
| Name | Description | Value | | Name | Description | Value |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------- | | --------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------- |
| `persistence.enabled` | Enable persistent storage. | `false` | | `persistence.enabled` | Enable persistent storage. | `false` |
| `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` | | `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` |
| `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` | | `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` |
| `persistence.new.annotations.helm.sh/resource-policy` | Resource policy for the new persistent volume claim. | `keep` | | `persistence.new.annotations.helm.sh/resource-policy` | Resource policy for the new persistent volume claim. | `keep` |
| `persistence.new.labels` | Labels for the new persistent volume claim. | `{}` | | `persistence.new.labels` | Labels for the new persistent volume claim. | `{}` |
| `persistence.new.accessModes` | AccessMode for the new persistent volume claim. | `["ReadWriteOnce"]` | | `persistence.new.accessModes` | AccessMode for the new persistent volume claim. | `["ReadWriteOnce"]` |
| `persistence.new.persistentVolumeName` | Name of the persistent volume for the new persistent volume claim. | `""` | | `persistence.new.persistentVolumeName` | Name of the persistent volume for the new persistent volume claim. | `""` |
| `persistence.new.size` | Size for the new persistent volume claim. | `10Gi` | | `persistence.new.size` | Size for the new persistent volume claim. | `10Gi` |
| `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` | | `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` |
| `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` | | `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` |
| `extraContainers` | Additional sidecar containers to run in the pod. | `[]` | | `extraContainers` | Additional sidecar containers to run in the pod. | `[]` |
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Gitea main container. | `[]` |
### Init ### Init
@@ -1371,6 +1361,38 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `gitea.startupProbe.successThreshold` | Success threshold for startup probe. | `1` | | `gitea.startupProbe.successThreshold` | Success threshold for startup probe. | `1` |
| `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe. | `10` | | `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe. | `10` |
### CloudNativePG
| Name | Description | Value |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
| `cloudnativePG.enabled` | Provision a CloudNativePG `Cluster` for Gitea. Requires the CloudNativePG operator to be installed in the cluster. | `false` |
| `cloudnativePG.annotations` | Annotations for the CloudNativePG `Cluster`. | `{}` |
| `cloudnativePG.labels` | Additional labels for the CloudNativePG `Cluster`. | `{}` |
| `cloudnativePG.image.registry` | Image registry. | `ghcr.io` |
| `cloudnativePG.image.repository` | Image repository. | `cloudnative-pg/postgresql` |
| `cloudnativePG.image.tag` | Image tag. | `18.0` |
| `cloudnativePG.instances` | Number of PostgreSQL instances. Values greater than `1` provision a HA-ready cluster with streaming replication. | `3` |
| `cloudnativePG.credentials.addSHASumAnnotation` | Add a pod annotation with the SHA sum of the credentials Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation). | `false` |
| `cloudnativePG.credentials.database` | Name of the database to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret. | `gitea` |
| `cloudnativePG.credentials.username` | Name of the database owner to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret. | `gitea` |
| `cloudnativePG.credentials.existingSecret.enabled` | Use an already existing Secret instead of creating the credentials Secret. | `false` |
| `cloudnativePG.credentials.existingSecret.secretName` | Name of the already existing credentials Secret. Must be of type `kubernetes.io/basic-auth` and its `username` must match `cloudnativePG.credentials.username`. | `""` |
| `cloudnativePG.credentials.existingSecret.passwordKey` | Key of the password in the existing credentials Secret. | `password` |
| `cloudnativePG.credentials.new.annotations` | Annotations for the credentials Secret. | `{}` |
| `cloudnativePG.credentials.new.labels` | Labels for the credentials Secret. | `{}` |
| `cloudnativePG.credentials.new.password` | Password of the database owner. | `gitea` |
| `cloudnativePG.postgresql.parameters` | Custom PostgreSQL configuration parameters. | `{}` |
| `cloudnativePG.storage.size` | Size of the data volume. | `10Gi` |
| `cloudnativePG.storage.storageClass` | Storage class of the data volume. Defaults to the cluster's default storage class. | `""` |
| `cloudnativePG.walStorage.enabled` | Store the write-ahead log on a dedicated volume. | `false` |
| `cloudnativePG.walStorage.size` | Size of the write-ahead log volume. | `2Gi` |
| `cloudnativePG.walStorage.storageClass` | Storage class of the write-ahead log volume. Defaults to the cluster's default storage class. | `""` |
| `cloudnativePG.affinity` | Affinity for the PostgreSQL pods. CloudNativePG nests `nodeSelector` and `tolerations` below this key as well. | `{}` |
| `cloudnativePG.priorityClassName` | Priority class name for the PostgreSQL pods. | `""` |
| `cloudnativePG.monitoring.enablePodMonitor` | Create a `PodMonitor` for the CloudNativePG `Cluster`. | `false` |
| `cloudnativePG.resources` | Kubernetes resources for the PostgreSQL containers. | `{}` |
| `cloudnativePG.topologySpreadConstraints` | Topology spread constraints for the PostgreSQL pods. | `[]` |
### valkey ### valkey
| Name | Description | Value | | Name | Description | Value |
@@ -1395,47 +1417,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `valkey.metrics.exporter.image.repository` | Image repository. | `oliver006/redis_exporter` | | `valkey.metrics.exporter.image.repository` | Image repository. | `oliver006/redis_exporter` |
| `valkey.metrics.exporter.image.tag` | Image tag. | `""` | | `valkey.metrics.exporter.image.tag` | Image tag. | `""` |
### PostgreSQL HA
| Name | Description | Value |
| -------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------- |
| `postgresql-ha.enabled` | Enable PostgreSQL HA. | `true` |
| `postgresql-ha.global.postgresql.database` | Name for a custom database to create (overrides `auth.database`). | `gitea` |
| `postgresql-ha.global.postgresql.username` | Name for a custom user to create (overrides `auth.username`). | `gitea` |
| `postgresql-ha.global.postgresql.password` | Name for a custom password to create (overrides `auth.password`). | `gitea` |
| `postgresql-ha.metrics.image.repository` | Image repository, eg. `bitnamilegacy/postgres-exporter`. | `bitnamilegacy/postgres-exporter` |
| `postgresql-ha.postgresql.image.repository` | Image repository, eg. `bitnamilegacy/postgresql-repmgr`. | `bitnamilegacy/postgresql-repmgr` |
| `postgresql-ha.postgresql.repmgrPassword` | Repmgr Password. | `changeme2` |
| `postgresql-ha.postgresql.postgresPassword` | postgres Password. | `changeme1` |
| `postgresql-ha.postgresql.password` | Password for the `gitea` user (overrides `auth.password`). | `changeme4` |
| `postgresql-ha.pgpool.adminPassword` | pgpool adminPassword. | `changeme3` |
| `postgresql-ha.pgpool.image.repository` | Image repository, eg. `bitnamilegacy/pgpool`. | `bitnamilegacy/pgpool` |
| `postgresql-ha.pgpool.srCheckPassword` | pgpool srCheckPassword. | `changeme4` |
| `postgresql-ha.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`). | `5432` |
| `postgresql-ha.persistence.enabled` | Enable persistence. | `true` |
| `postgresql-ha.persistence.storageClass` | Persistent Volume Storage Class. | `""` |
| `postgresql-ha.persistence.size` | PVC Storage Request for PostgreSQL HA volume. | `10Gi` |
| `postgresql-ha.volumePermissions.image.repository` | Image repository, eg. `bitnamilegacy/os-shell`. | `bitnamilegacy/os-shell` |
### PostgreSQL
| Name | Description | Value |
| ------------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------- |
| `postgresql.enabled` | Enable PostgreSQL. | `false` |
| `postgresql.global.postgresql.auth.password` | Password for the `gitea` user (overrides `auth.password`). | `gitea` |
| `postgresql.global.postgresql.auth.database` | Name for a custom database to create (overrides `auth.database`). | `gitea` |
| `postgresql.global.postgresql.auth.username` | Name for a custom user to create (overrides `auth.username`). | `gitea` |
| `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`). | `5432` |
| `postgresql.image.repository` | Image repository, eg. `bitnamilegacy/postgresql`. | `bitnamilegacy/postgresql` |
| `postgresql.primary.persistence.enabled` | Enable persistence. | `true` |
| `postgresql.primary.persistence.storageClass` | Persistent Volume storage class. | `""` |
| `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume. | `10Gi` |
| `postgresql.readReplicas.persistence.enabled` | Enable PostgreSQL read only data persistence using PVC. | `true` |
| `postgresql.readReplicas.persistence.storageClass` | Persistent Volume storage class. | `""` |
| `postgresql.readReplicas.persistence.size` | PVC Storage Request for PostgreSQL volume. | `""` |
| `postgresql.metrics.image.repository` | Image repository, eg. `bitnamilegacy/postgres-exporter`. | `bitnamilegacy/postgres-exporter` |
| `postgresql.volumePermissions.image.repository` | Image repository, eg. `bitnamilegacy/os-shell`. | `bitnamilegacy/os-shell` |
### Advanced ### Advanced
| Name | Description | Value | | Name | Description | Value |
@@ -1467,6 +1448,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
- All Secrets created by this chart are now configured through the new `secrets` section. - All Secrets created by this chart are now configured through the new `secrets` section.
It exposes `annotations`, `labels`, a checksum-annotation toggle and an `existingSecret` reference for each of the It exposes `annotations`, `labels`, a checksum-annotation toggle and an `existingSecret` reference for each of the
`admin`, `config`, `gpg`, `init`, `inlineConfig` and `metrics` Secrets. `admin`, `config`, `gpg`, `init`, `inlineConfig` and `metrics` Secrets.
- The `gitea.admin` object has been replaced by `secrets.admin`. - The `gitea.admin` object has been replaced by `secrets.admin`.
The chart fails to render if `gitea.admin` is still set. The chart fails to render if `gitea.admin` is still set.
Migrate as follows: Migrate as follows:
@@ -1487,6 +1469,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
Admin user handling was previously skipped implicitly when neither an existing Secret nor a username and password were Admin user handling was previously skipped implicitly when neither an existing Secret nor a username and password were
set. It is now controlled explicitly via `secrets.admin.enabled`. set. It is now controlled explicitly via `secrets.admin.enabled`.
- The top-level `signing` object has been replaced by `secrets.gpg`. - The top-level `signing` object has been replaced by `secrets.gpg`.
The chart fails to render if `signing` is still set. The chart fails to render if `signing` is still set.
Migrate as follows: Migrate as follows:
@@ -1512,6 +1495,18 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
field of the Ingress resource it populates. The chart fails to render if `ingress.className` is still set, even when field of the Ingress resource it populates. The chart fails to render if `ingress.className` is still set, even when
it is set to an empty string. it is set to an empty string.
- `extraVolumeMounts` has been removed. Deprecated since 6.0.0, it mounted the same volumes into the init containers
and into the Gitea container, and it was silently ignored as soon as `extraInitVolumeMounts` or
`deployment.gitea.volumeMounts` contained a single entry. Split the mounts explicitly: use
`deployment.<initContainer>.volumeMounts` for the init containers and `deployment.gitea.volumeMounts` for the Gitea
container. Volumes that are needed in both places have to be listed in both settings.
- `extraInitVolumeMounts` has been removed. It fanned a mount out to the four chart-managed init containers, but never
reached init containers added through `deployment.initContainers[].container`, despite its name. Configure the mount
on the init containers that actually need it: `deployment.initDirectories.volumeMounts`,
`deployment.initAppIni.volumeMounts`, `deployment.initConfigureGPG.volumeMounts` or
`deployment.initConfigureGitea.volumeMounts`.
</details> </details>
<details> <details>
@@ -1669,15 +1664,17 @@ If you want to switch to a RWX volume and go for HA, you need to
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable-next-line --> <!-- markdownlint-disable-next-line -->
**Transitioning from Postgres to Postgres HA** **Transitioning from Postgres or Postgres HA to CloudNativePG**
<!-- prettier-ignore-end --> <!-- prettier-ignore-end -->
If you are running with a non-HA PG DB from a previous chart release, you need to set The `postgresql` and `postgresql-ha` sub-charts have been replaced by a [CloudNativePG](https://cloudnative-pg.io/) `Cluster` resource, configured via `cloudnativePG`.
The CloudNativePG operator is not bundled with this chart and has to be installed cluster-wide beforehand.
- `postgresql-ha.enabled=false` There is no in-place migration path: dump the database of the old deployment with `pg_dump`, remove the `postgresql` or `postgresql-ha` values and deploy the chart with `cloudnativePG.enabled=true`.
- `postgresql.enabled=true` Afterwards restore the dump into the new cluster.
Alternatively, point the new `Cluster` at the existing data via one of the [CloudNativePG bootstrap methods](https://cloudnative-pg.io/documentation/current/bootstrap/).
This is needed to stay with your existing single-instance DB (as the HA-variant is the new default). For a single-instance database, set `cloudnativePG.instances=1`.
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable-next-line --> <!-- markdownlint-disable-next-line -->
+24 -8
View File
@@ -28,8 +28,8 @@ In addition, the following components are required for full HA-readiness:
- A HA-ready cache (`valkey-cluster`) - A HA-ready cache (`valkey-cluster`)
- A HA-ready DB - A HA-ready DB
`postgres.enabled`, which default to `true`, must be set to `false` for a HA setup. `cloudnativePG.enabled`, which defaults to `false`, must be enabled for a HA setup.
The default `postgres` chart dependency is not HA-ready (there's a dedicated `postgres-ha` chart). It requires the CloudNativePG operator to be installed cluster-wide beforehand.
The following sections discuss each of the components in more detail. The following sections discuss each of the components in more detail.
Note that for each component discussed, the shown configurations only provides a (working) starting point, not necessarily the most optimal setup. Note that for each component discussed, the shown configurations only provides a (working) starting point, not necessarily the most optimal setup.
@@ -153,15 +153,31 @@ persistence:
## Database ## Database
If you do not have an HA-ready DB, using a managed database service in the cloud might be the easiest and most robust solution. By enabling `cloudnativePG`, the chart renders a [CloudNativePG](https://cloudnative-pg.io/) `Cluster`, which provides a HA-ready PostgreSQL via streaming replication.
Remember: disable the built-in `postgres` dependency and configure the database connection manually via `gitea.config.database`: The CloudNativePG operator itself is not part of this chart and has to be [installed cluster-wide](https://cloudnative-pg.io/documentation/current/installation_upgrade/) beforehand.
For that reason the option is disabled by default.
```yml ```yml
cloudnativePG:
enabled: true
instances: 3
storage:
size: 10Gi
storageClass: <storage class>
walStorage:
enabled: true
size: 2Gi
storageClass: <storage class>
```
If you do not want to run the operator, using a managed database service in the cloud might be the easiest and most robust solution.
Remember: keep `cloudnativePG` disabled and configure the database connection manually via `gitea.config.database`:
```yml
cloudnativePG:
enabled: false
gitea: gitea:
database:
builtIn:
postgresql:
enabled: false
config: config:
database: database:
DB_TYPE: postgres DB_TYPE: postgres
-43
View File
@@ -1,43 +0,0 @@
#!/bin/sh
set -eu
timeout_delay=15
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
return 0
}
create_token() {
echo "Waiting for new token to be generated..."
begin=$(date +%s)
end=$((begin + timeout_delay))
while true; do
[ -f /data/actions/token ] && return 0
[ "$(date +%s)" -gt $end ] && return 1
sleep 5
done
}
store_token() {
echo "Storing the token in Kubernetes secret..."
kubectl patch secret "$SECRET_NAME" -p "{\"data\":{\"token\":\"$(base64 /data/actions/token | tr -d '\n')\"}}"
}
if check_token; then
echo "Key already in place, exiting."
exit
fi
if ! create_token; then
echo "Checking for an existing act runner token in secret $SECRET_NAME timed out after $timeout_delay"
exit 1
fi
store_token
@@ -2,7 +2,8 @@
set -euo pipefail set -euo pipefail
function env2ini::log() { function env2ini::log() {
printf "${1}\n" # '%b' expands the \n escapes of the callers without treating the message itself as a format string
printf '%b\n' "${1}"
} }
function env2ini::read_config_to_env() { function env2ini::read_config_to_env() {
@@ -15,7 +16,8 @@ function env2ini::read_config_to_env() {
fi fi
# 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line # 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line
local setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)" local setting
setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
if [[ -z "${setting}" ]]; then if [[ -z "${setting}" ]]; then
env2ini::log ' ! invalid setting' env2ini::log ' ! invalid setting'
@@ -54,7 +56,8 @@ function env2ini::reload_preset_envs() {
fi fi
# 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line # 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line
local setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)" local setting
setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
if [[ -z "${setting}" ]]; then if [[ -z "${setting}" ]]; then
env2ini::log ' ! invalid setting' env2ini::log ' ! invalid setting'
@@ -75,12 +78,13 @@ function env2ini::reload_preset_envs() {
export "${setting^^}=${value}" # '^^' makes the variable content uppercase export "${setting^^}=${value}" # '^^' makes the variable content uppercase
done < "$TMP_EXISTING_ENVS_FILE" done < "$TMP_EXISTING_ENVS_FILE"
rm $TMP_EXISTING_ENVS_FILE rm "$TMP_EXISTING_ENVS_FILE"
} }
function env2ini::process_config_file() { function env2ini::process_config_file() {
local config_file="${1}" local config_file="${1}"
local section="$(basename "${config_file}")" local section
section="$(basename "${config_file}")"
if [[ $section == '_generals_' ]]; then if [[ $section == '_generals_' ]]; then
env2ini::log " [ini root]" env2ini::log " [ini root]"
@@ -100,7 +104,7 @@ function env2ini::load_config_sources() {
if [[ -d "${path}" ]]; then if [[ -d "${path}" ]]; then
env2ini::log "Processing $(basename "${path}")..." env2ini::log "Processing $(basename "${path}")..."
while read -d '' configFile; do while read -r -d '' configFile; do
env2ini::process_config_file "${configFile}" env2ini::process_config_file "${configFile}"
done < <(find "${path}" -type l -not -name '..data' -print0) done < <(find "${path}" -type l -not -name '..data' -print0)
@@ -114,16 +118,20 @@ function env2ini::generate_initial_secrets() {
# - initially used to set up Gitea # - initially used to set up Gitea
# Anyway, they won't harm existing app.ini files # Anyway, they won't harm existing app.ini files
export GITEA__SECURITY__INTERNAL_TOKEN=$(gitea generate secret INTERNAL_TOKEN) GITEA__SECURITY__INTERNAL_TOKEN="$(gitea generate secret INTERNAL_TOKEN)"
export GITEA__SECURITY__SECRET_KEY=$(gitea generate secret SECRET_KEY) GITEA__SECURITY__SECRET_KEY="$(gitea generate secret SECRET_KEY)"
export GITEA__OAUTH2__JWT_SECRET=$(gitea generate secret JWT_SECRET) GITEA__OAUTH2__JWT_SECRET="$(gitea generate secret JWT_SECRET)"
export GITEA__SERVER__LFS_JWT_SECRET=$(gitea generate secret LFS_JWT_SECRET) GITEA__SERVER__LFS_JWT_SECRET="$(gitea generate secret LFS_JWT_SECRET)"
export GITEA__SECURITY__INTERNAL_TOKEN \
GITEA__SECURITY__SECRET_KEY \
GITEA__OAUTH2__JWT_SECRET \
GITEA__SERVER__LFS_JWT_SECRET
env2ini::log "...Initial secrets generated\n" env2ini::log "...Initial secrets generated\n"
} }
# save existing envs prior to script execution. Necessary to keep order of preexisting and custom envs # save existing envs prior to script execution. Necessary to keep order of preexisting and custom envs
env | (grep -e '^GITEA__' || [[ $? == 1 ]]) > $TMP_EXISTING_ENVS_FILE env | (grep -e '^GITEA__' || [[ $? == 1 ]]) > "$TMP_EXISTING_ENVS_FILE"
# MUST BE CALLED BEFORE OTHER CONFIGURATION # MUST BE CALLED BEFORE OTHER CONFIGURATION
env2ini::generate_initial_secrets env2ini::generate_initial_secrets
@@ -137,7 +145,7 @@ env2ini::reload_preset_envs
env2ini::log "=== All configuration sources loaded ===\n" env2ini::log "=== All configuration sources loaded ===\n"
# safety to prevent rewrite of secret keys if an app.ini already exists # safety to prevent rewrite of secret keys if an app.ini already exists
if [ -f ${GITEA_APP_INI} ]; then if [ -f "${GITEA_APP_INI}" ]; then
env2ini::log 'An app.ini file already exists. To prevent overwriting secret keys, these settings are dropped and remain unchanged:' env2ini::log 'An app.ini file already exists. To prevent overwriting secret keys, these settings are dropped and remain unchanged:'
env2ini::log ' - security.INTERNAL_TOKEN' env2ini::log ' - security.INTERNAL_TOKEN'
env2ini::log ' - security.SECRET_KEY' env2ini::log ' - security.SECRET_KEY'
+24
View File
@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/* annotations */}}
{{- define "gitea.cluster.cloudnativePG.annotations" -}}
{{- with .Values.cloudnativePG.annotations }}
{{- toYaml . -}}
{{- end }}
{{- end }}
{{/* labels */}}
{{- define "gitea.cluster.cloudnativePG.labels" -}}
{{ include "gitea.labels" . }}
{{- with .Values.cloudnativePG.labels }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{/* names */}}
{{- define "gitea.cluster.cloudnativePG.name" -}}
{{ include "gitea.fullname" . }}-postgresql
{{- end }}
+8 -49
View File
@@ -166,15 +166,6 @@ version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quo
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}} {{- 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.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/* {{/*
Selector labels Selector labels
*/}} */}}
@@ -183,20 +174,9 @@ app.kubernetes.io/name: {{ include "gitea.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}} {{- end -}}
{{- define "gitea.selectorLabels.actRunner" -}} {{- define "cloudnativePG.dns" -}}
app.kubernetes.io/name: {{ include "gitea.name" . }}-act-runner {{- if .Values.cloudnativePG.enabled -}}
app.kubernetes.io/instance: {{ .Release.Name }} {{- printf "%s-rw.%s.svc.%s:5432" (include "gitea.cluster.cloudnativePG.name" .) (.Values.namespace | default .Release.Namespace) .Values.clusterDomain -}}
{{- end -}}
{{- define "postgresql-ha.dns" -}}
{{- if (index .Values "postgresql-ha").enabled -}}
{{- printf "%s-postgresql-ha-pgpool.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "service" "ports" "postgresql") -}}
{{- end -}}
{{- end -}}
{{- define "postgresql.dns" -}}
{{- if (index .Values "postgresql").enabled -}}
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.service.ports.postgresql -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -455,41 +435,20 @@ https
{{- end -}} {{- end -}}
{{- define "gitea.inline_configuration.defaults.database" -}} {{- define "gitea.inline_configuration.defaults.database" -}}
{{- if (index .Values "postgresql-ha" "enabled") -}} {{- if .Values.cloudnativePG.enabled -}}
{{/* PASSWD is injected as an env-to-ini variable from the credentials Secret. */}}
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}} {{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
{{- if not (.Values.gitea.config.database.HOST) -}} {{- if not (.Values.gitea.config.database.HOST) -}}
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql-ha.dns" .) -}} {{- $_ := set .Values.gitea.config.database "HOST" (include "cloudnativePG.dns" .) -}}
{{- end -}} {{- end -}}
{{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql" "database") -}} {{- $_ := set .Values.gitea.config.database "NAME" .Values.cloudnativePG.credentials.database -}}
{{- $_ := set .Values.gitea.config.database "USER" (index .Values "postgresql-ha" "global" "postgresql" "username") -}} {{- $_ := set .Values.gitea.config.database "USER" .Values.cloudnativePG.credentials.username -}}
{{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql" "password") -}}
{{- end -}}
{{- if (index .Values "postgresql" "enabled") -}}
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
{{- if not (.Values.gitea.config.database.HOST) -}}
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
{{- end -}}
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.auth.database -}}
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.auth.username -}}
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.auth.password -}}
{{- end -}}
{{- end -}}
{{- define "gitea.init-additional-mounts" -}}
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
{{- if gt (len .Values.extraInitVolumeMounts) 0 -}}
{{- toYaml .Values.extraInitVolumeMounts -}}
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
{{- toYaml .Values.extraVolumeMounts -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- define "gitea.container-additional-mounts" -}} {{- define "gitea.container-additional-mounts" -}}
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
{{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}} {{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}}
{{- toYaml .Values.deployment.gitea.volumeMounts -}} {{- toYaml .Values.deployment.gitea.volumeMounts -}}
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
{{- toYaml .Values.extraVolumeMounts -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
+7 -6
View File
@@ -43,7 +43,6 @@
{{- if .Values.persistence.new.subPath }} {{- if .Values.persistence.new.subPath }}
subPath: {{ .Values.persistence.new.subPath }} subPath: {{ .Values.persistence.new.subPath }}
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -85,6 +84,13 @@
value: /tmp/existing-envs value: /tmp/existing-envs
- name: ENV_TO_INI_MOUNT_POINT - name: ENV_TO_INI_MOUNT_POINT
value: /env-to-ini-mounts value: /env-to-ini-mounts
{{- if .Values.cloudnativePG.enabled }}
- name: GITEA__database__PASSWD
valueFrom:
secretKeyRef:
key: {{ include "gitea.secret.cloudnativePG.passwordKey" . }}
name: {{ include "gitea.secret.cloudnativePG.name" . }}
{{- end }}
{{- if .Values.deployment.gitea.env }} {{- if .Values.deployment.gitea.env }}
{{- toYaml .Values.deployment.gitea.env | nindent 4 }} {{- toYaml .Values.deployment.gitea.env | nindent 4 }}
{{- end }} {{- end }}
@@ -114,7 +120,6 @@
- name: additional-config-sources-{{ $idx }} - name: additional-config-sources-{{ $idx }}
mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/" mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/"
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -174,9 +179,6 @@
- name: gpg-private-key - name: gpg-private-key
mountPath: /raw mountPath: /raw
readOnly: true readOnly: true
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 4 }}
{{- end }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -295,7 +297,6 @@
{{- if .Values.persistence.new.subPath }} {{- if .Values.persistence.new.subPath }}
subPath: {{ .Values.persistence.new.subPath }} subPath: {{ .Values.persistence.new.subPath }}
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
+5
View File
@@ -9,6 +9,11 @@
checksum/admin: {{ include "gitea.secret.checksum" (list . "admin") }} checksum/admin: {{ include "gitea.secret.checksum" (list . "admin") }}
{{- end }} {{- end }}
{{/* secret - cloudnativePG */}}
{{- if and .Values.cloudnativePG.enabled .Values.cloudnativePG.credentials.addSHASumAnnotation }}
checksum/cloudnativePG: {{ include "gitea.secret.checksum" (list . "cloudnativePG") }}
{{- end }}
{{/* secret - config */}} {{/* secret - config */}}
{{- if and .Values.secrets.config.enabled .Values.secrets.config.addSHASumAnnotation }} {{- if and .Values.secrets.config.enabled .Values.secrets.config.addSHASumAnnotation }}
checksum/config: {{ include "gitea.secret.checksum" (list . "config") }} checksum/config: {{ include "gitea.secret.checksum" (list . "config") }}
+34 -1
View File
@@ -8,6 +8,12 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "gitea.secret.cloudnativePG.annotations" -}}
{{- with .Values.cloudnativePG.credentials.new.annotations }}
{{- toYaml . -}}
{{- end }}
{{- end }}
{{- define "gitea.secret.config.annotations" -}} {{- define "gitea.secret.config.annotations" -}}
{{- with .Values.secrets.config.new.annotations }} {{- with .Values.secrets.config.new.annotations }}
{{- toYaml . -}} {{- toYaml . -}}
@@ -49,7 +55,11 @@ Arguments: (list $root $key)
{{- define "gitea.secret.checksum" -}} {{- define "gitea.secret.checksum" -}}
{{- $root := index . 0 -}} {{- $root := index . 0 -}}
{{- $key := index . 1 -}} {{- $key := index . 1 -}}
{{- if (index $root.Values.secrets $key).existingSecret.enabled -}} {{- $config := index $root.Values.secrets $key -}}
{{- if eq $key "cloudnativePG" -}}
{{- $config = $root.Values.cloudnativePG.credentials -}}
{{- end -}}
{{- if $config.existingSecret.enabled -}}
{{- $namespace := $root.Values.namespace | default $root.Release.Namespace -}} {{- $namespace := $root.Values.namespace | default $root.Release.Namespace -}}
{{- $name := include (printf "gitea.secret.%s.name" $key) $root -}} {{- $name := include (printf "gitea.secret.%s.name" $key) $root -}}
{{- lookup "v1" "Secret" $namespace $name | toYaml | sha256sum -}} {{- lookup "v1" "Secret" $namespace $name | toYaml | sha256sum -}}
@@ -68,6 +78,13 @@ Arguments: (list $root $key)
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "gitea.secret.cloudnativePG.labels" -}}
{{ include "gitea.labels" . }}
{{- with .Values.cloudnativePG.credentials.new.labels }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{- define "gitea.secret.config.labels" -}} {{- define "gitea.secret.config.labels" -}}
{{ include "gitea.labels" . }} {{ include "gitea.labels" . }}
{{- with .Values.secrets.config.new.labels }} {{- with .Values.secrets.config.new.labels }}
@@ -113,6 +130,14 @@ Arguments: (list $root $key)
{{- end -}} {{- end -}}
{{- end }} {{- end }}
{{- define "gitea.secret.cloudnativePG.name" -}}
{{- if .Values.cloudnativePG.credentials.existingSecret.enabled -}}
{{ required "`cloudnativePG.credentials.existingSecret.secretName` must be set when `cloudnativePG.credentials.existingSecret.enabled` is enabled" .Values.cloudnativePG.credentials.existingSecret.secretName }}
{{- else -}}
{{ include "gitea.cluster.cloudnativePG.name" . }}-app
{{- end -}}
{{- end }}
{{- define "gitea.secret.config.name" -}} {{- define "gitea.secret.config.name" -}}
{{- if .Values.secrets.config.existingSecret.enabled -}} {{- if .Values.secrets.config.existingSecret.enabled -}}
{{ required "`secrets.config.existingSecret.secretName` must be set when `secrets.config.existingSecret.enabled` is enabled" .Values.secrets.config.existingSecret.secretName }} {{ required "`secrets.config.existingSecret.secretName` must be set when `secrets.config.existingSecret.enabled` is enabled" .Values.secrets.config.existingSecret.secretName }}
@@ -179,6 +204,14 @@ username
{{- end -}} {{- end -}}
{{- end }} {{- end }}
{{- define "gitea.secret.cloudnativePG.passwordKey" -}}
{{- if .Values.cloudnativePG.credentials.existingSecret.enabled -}}
{{ .Values.cloudnativePG.credentials.existingSecret.passwordKey }}
{{- else -}}
password
{{- end -}}
{{- end }}
{{- define "gitea.secret.gpg.gpgHomeKey" -}} {{- define "gitea.secret.gpg.gpgHomeKey" -}}
{{- if .Values.secrets.gpg.existingSecret.enabled -}} {{- if .Values.secrets.gpg.existingSecret.enabled -}}
{{ .Values.secrets.gpg.existingSecret.gpgHomeKey }} {{ .Values.secrets.gpg.existingSecret.gpgHomeKey }}
+51
View File
@@ -0,0 +1,51 @@
{{- if .Values.cloudnativePG.enabled -}}
{{- $registry := .Values.global.imageRegistry | default .Values.cloudnativePG.image.registry -}}
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
{{- with (include "gitea.cluster.cloudnativePG.annotations" .) }}
annotations:
{{- . | nindent 4 }}
{{- end }}
labels:
{{- include "gitea.cluster.cloudnativePG.labels" . | nindent 4 }}
name: {{ include "gitea.cluster.cloudnativePG.name" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
spec:
{{- with .Values.cloudnativePG.affinity }}
affinity:
{{- toYaml . | nindent 4 }}
{{- end }}
bootstrap:
initdb:
database: {{ .Values.cloudnativePG.credentials.database | quote }}
owner: {{ .Values.cloudnativePG.credentials.username | quote }}
secret:
name: {{ include "gitea.secret.cloudnativePG.name" . }}
imageName: {{ printf "%s/%s:%s" $registry .Values.cloudnativePG.image.repository (.Values.cloudnativePG.image.tag | toString) | quote }}
instances: {{ .Values.cloudnativePG.instances }}
monitoring:
enablePodMonitor: {{ .Values.cloudnativePG.monitoring.enablePodMonitor }}
postgresql:
parameters:
{{- toYaml .Values.cloudnativePG.postgresql.parameters | nindent 6 }}
priorityClassName: {{ .Values.cloudnativePG.priorityClassName | quote }}
resources:
{{- toYaml .Values.cloudnativePG.resources | nindent 4 }}
storage:
size: {{ .Values.cloudnativePG.storage.size | quote }}
{{- with .Values.cloudnativePG.storage.storageClass }}
storageClass: {{ . | quote }}
{{- end }}
{{- with .Values.cloudnativePG.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.cloudnativePG.walStorage.enabled }}
walStorage:
size: {{ .Values.cloudnativePG.walStorage.size | quote }}
{{- with .Values.cloudnativePG.walStorage.storageClass }}
storageClass: {{ . | quote }}
{{- end }}
{{- end }}
{{- end -}}
+20
View File
@@ -65,6 +65,16 @@
{{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}} {{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}}
{{- end -}} {{- end -}}
{{/* EXTRA INIT VOLUME MOUNTS */}}
{{- if .Values.extraInitVolumeMounts -}}
{{- fail "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead." -}}
{{- end -}}
{{/* EXTRA VOLUME MOUNTS */}}
{{- if .Values.extraVolumeMounts -}}
{{- fail "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead." -}}
{{- end -}}
{{/* EXTRA VOLUMES */}} {{/* EXTRA VOLUMES */}}
{{- if .Values.extraVolumes -}} {{- if .Values.extraVolumes -}}
{{- fail "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead." -}} {{- fail "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead." -}}
@@ -85,6 +95,16 @@
{{- fail "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead." -}} {{- fail "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead." -}}
{{- end -}} {{- end -}}
{{/* POSTGRESQL */}}
{{- if index .Values "postgresql" -}}
{{- fail "`postgresql` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster." -}}
{{- end -}}
{{/* POSTGRESQL HA */}}
{{- if index .Values "postgresql-ha" -}}
{{- fail "`postgresql-ha` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster." -}}
{{- end -}}
{{/* PRIORITY CLASS NAME */}} {{/* PRIORITY CLASS NAME */}}
{{- if .Values.priorityClassName -}} {{- if .Values.priorityClassName -}}
{{- fail "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead." -}} {{- fail "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead." -}}
+18
View File
@@ -0,0 +1,18 @@
{{- if and .Values.cloudnativePG.enabled (not .Values.cloudnativePG.credentials.existingSecret.enabled) -}}
apiVersion: v1
kind: Secret
metadata:
{{- with (include "gitea.secret.cloudnativePG.annotations" .) }}
annotations:
{{- . | nindent 4 }}
{{- end }}
labels:
{{- include "gitea.secret.cloudnativePG.labels" . | nindent 4 }}
name: {{ include "gitea.secret.cloudnativePG.name" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
type: kubernetes.io/basic-auth
data:
password: {{ required "`cloudnativePG.credentials.new.password` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.new.password | b64enc | quote }}
{{- /* CloudNativePG requires the username of a basic-auth bootstrap Secret to match the owner of the Cluster. */}}
username: {{ required "`cloudnativePG.credentials.username` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.username | b64enc | quote }}
{{- end -}}
-5
View File
@@ -21,11 +21,6 @@ data:
{{- define "gitea.config.assertions" -}} {{- define "gitea.config.assertions" -}}
{{- /*assert that only one PG dep is enabled */ -}}
{{- if and (.Values.postgresql.enabled) (index .Values "postgresql-ha" "enabled") -}}
{{- fail "Only one of postgresql or postgresql-ha can be enabled at the same time." -}}
{{- end }}
{{- /* multiple replicas assertions */ -}} {{- /* multiple replicas assertions */ -}}
{{- if gt (.Values.deployment.replicas | int) 1 -}} {{- if gt (.Values.deployment.replicas | int) 1 -}}
{{- if .Values.gitea.config.cron -}} {{- if .Values.gitea.config.cron -}}
@@ -1,18 +1,18 @@
suite: Admin secret template suite: Test admin secret
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_admin.yaml - templates/secret_admin.yaml
tests: tests:
- it: skips rendering when the admin user is disabled - it: "Skip rendering when the admin user is disabled"
set: set:
secrets.admin.enabled: false secrets.admin.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: skips rendering using an existing secret reference - it: "Skip rendering when an existing Secret is referenced"
set: set:
secrets.admin.enabled: true secrets.admin.enabled: true
secrets.admin.existingSecret.enabled: true secrets.admin.existingSecret.enabled: true
@@ -21,14 +21,14 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: fails rendering without credentials - it: "Fail when no credentials are configured"
set: set:
secrets.admin.new.password: "" secrets.admin.new.password: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: Either specify `secrets.admin.new.username` and `secrets.admin.new.password` or reference an existing Secret via `secrets.admin.existingSecret` errorMessage: Either specify `secrets.admin.new.username` and `secrets.admin.new.password` or reference an existing Secret via `secrets.admin.existingSecret`
- it: renders the secret specification with the default credentials - it: "Render the Secret with the default credentials"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@@ -49,7 +49,7 @@ tests:
path: data.username path: data.username
value: "Z2l0ZWFfYWRtaW4=" value: "Z2l0ZWFfYWRtaW4="
- it: supports custom annotations and labels - it: "Render custom annotations and labels"
set: set:
secrets.admin.new.annotations: secrets.admin.new.annotations:
custom-annotation: annotation-value custom-annotation: annotation-value
+182
View File
@@ -0,0 +1,182 @@
suite: Test cluster basics
release:
name: gitea-unittests
namespace: testing
tests:
- it: "Render nothing when cloudnativePG is disabled"
templates:
- templates/cluster.yaml
- templates/secret_cloudnativePG.yaml
set:
cloudnativePG:
enabled: false
asserts:
- hasDocuments:
count: 0
- it: "Render the Cluster with the default values"
template: templates/cluster.yaml
set:
cloudnativePG:
enabled: true
asserts:
- containsDocument:
kind: Cluster
apiVersion: postgresql.cnpg.io/v1
name: gitea-unittests-postgresql
namespace: testing
- equal:
path: spec.instances
value: 3
- equal:
path: spec.imageName
value: "ghcr.io/cloudnative-pg/postgresql:18.0"
- equal:
path: spec.bootstrap.initdb
value:
database: "gitea"
owner: "gitea"
secret:
name: gitea-unittests-postgresql-app
- equal:
path: spec.storage.size
value: "10Gi"
- notExists:
path: spec.storage.storageClass
- notExists:
path: spec.walStorage
- notExists:
path: spec.affinity
- notExists:
path: spec.topologySpreadConstraints
- it: "Render the credential Secret with the default values"
template: templates/secret_cloudnativePG.yaml
set:
cloudnativePG:
enabled: true
asserts:
- containsDocument:
kind: Secret
apiVersion: v1
name: gitea-unittests-postgresql-app
namespace: testing
- equal:
path: type
value: kubernetes.io/basic-auth
- equal:
path: data.password
decodeBase64: true
value: "gitea"
- equal:
path: data.username
decodeBase64: true
value: "gitea"
- notExists:
path: data.database
- notExists:
path: stringData
- it: "Render no credential Secret when an existing Secret is used"
template: templates/secret_cloudnativePG.yaml
set:
cloudnativePG:
enabled: true
credentials:
existingSecret:
enabled: true
secretName: my-credentials
asserts:
- hasDocuments:
count: 0
- it: "Reference the existing Secret in the Cluster"
template: templates/cluster.yaml
set:
cloudnativePG:
enabled: true
credentials:
existingSecret:
enabled: true
secretName: my-credentials
database: my-database
username: my-username
asserts:
- equal:
path: spec.bootstrap.initdb
value:
database: "my-database"
owner: "my-username"
secret:
name: my-credentials
- it: "Apply the storage and walStorage customizations"
template: templates/cluster.yaml
set:
cloudnativePG:
enabled: true
storage:
size: 1337Mi
storageClass: my-storage-class
walStorage:
enabled: true
size: 42Mi
storageClass: my-wal-storage-class
asserts:
- equal:
path: spec.storage
value:
size: "1337Mi"
storageClass: "my-storage-class"
- equal:
path: spec.walStorage
value:
size: "42Mi"
storageClass: "my-wal-storage-class"
- it: "Apply the scheduling customizations"
template: templates/cluster.yaml
set:
cloudnativePG:
enabled: true
affinity:
nodeSelector:
disktype: ssd
podAntiAffinityType: required
tolerations:
- key: my-key
operator: Equal
value: my-value
effect: NoSchedule
priorityClassName: my-priority-class
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: gitea
asserts:
- equal:
path: spec.affinity
value:
nodeSelector:
disktype: ssd
podAntiAffinityType: required
tolerations:
- key: my-key
operator: Equal
value: my-value
effect: NoSchedule
- equal:
path: spec.priorityClassName
value: my-priority-class
- equal:
path: spec.topologySpreadConstraints
value:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: gitea
@@ -1,18 +1,18 @@
suite: config template | actions config suite: Test config actions
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
tests: tests:
- it: "actions are enabled by default (based on vanilla Gitea behavior)" - it: "Enable actions by default to match vanilla Gitea"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
notExists: notExists:
path: data.actions path: data.actions
- it: "actions can be disabled via inline config" - it: "Disable actions via the inline config"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea.config.actions.ENABLED: false gitea.config.actions.ENABLED: false
@@ -1,9 +1,9 @@
suite: config template | cache config suite: Test config cache
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
tests: tests:
- it: "cache is configured correctly for valkey" - it: "Configure the cache for valkey"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -17,7 +17,7 @@ tests:
ADAPTER=redis ADAPTER=redis
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s& HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "cache is configured correctly for 'memory' when valkey is disabled" - it: "Configure the cache for 'memory' when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -31,7 +31,7 @@ tests:
ADAPTER=memory ADAPTER=memory
HOST= HOST=
- it: "cache can be customized when valkey is disabled" - it: "Customize the cache when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
+48
View File
@@ -0,0 +1,48 @@
suite: Test config database
release:
name: gitea-unittests
namespace: testing
tests:
- it: "Connect to the read-write Service of the CloudNativePG Cluster"
template: templates/secret_inlineConfig.yaml
set:
cloudnativePG:
enabled: true
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-rw.testing.svc.cluster.local:5432
- it: "Connect to the read-write Service of the CloudNativePG Cluster with a custom cluster domain"
template: templates/secret_inlineConfig.yaml
set:
clusterDomain: my-special-cluster.local
cloudnativePG:
enabled: true
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-rw.testing.svc.my-special-cluster.local:5432
- it: "Connect to the configured CloudNativePG database"
template: templates/secret_inlineConfig.yaml
set:
cloudnativePG:
enabled: true
credentials:
database: gitea-database
username: gitea-username
asserts:
- documentIndex: 0
equal:
path: data.database
decodeBase64: true
value: |-
DB_TYPE=postgres
HOST=gitea-unittests-postgresql-rw.testing.svc.cluster.local:5432
NAME=gitea-database
USER=gitea-username
@@ -1,4 +1,4 @@
suite: config template | config_environment.sh suite: Test config environment script
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -6,7 +6,7 @@ templates:
- templates/secret_admin.yaml - templates/secret_admin.yaml
- templates/secret_config.yaml - templates/secret_config.yaml
tests: tests:
- it: uses `gitea config edit-ini` to write app.ini from environment variables - it: "Write app.ini from the environment variables via `gitea config edit-ini`"
template: templates/secret_config.yaml template: templates/secret_config.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
@@ -14,7 +14,7 @@ tests:
path: data["config_environment.sh"] path: data["config_environment.sh"]
decodeBase64: true decodeBase64: true
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI' pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
- it: renders data, not stringData, so removed keys are pruned on upgrade - it: "Render data instead of stringData so removed keys are pruned on upgrade"
template: templates/secret_config.yaml template: templates/secret_config.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
@@ -1,11 +1,11 @@
suite: config template suite: Test config inlineConfig
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
tests: tests:
- it: inline config data.server using TPL - it: "Render the inline config of data.server via tpl"
set: set:
global.giteaHostName: "gitea.example.com" global.giteaHostName: "gitea.example.com"
ingress.enabled: true ingress.enabled: true
@@ -34,7 +34,7 @@ tests:
path: data.server path: data.server
decodeBase64: true decodeBase64: true
pattern: SSH_DOMAIN=gitea\.example\.com pattern: SSH_DOMAIN=gitea\.example\.com
- it: renders data, not stringData, so removed sections are pruned on upgrade - it: "Render data instead of stringData so removed sections are pruned on upgrade"
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
notExists: notExists:
@@ -1,9 +1,9 @@
suite: config template | metrics section (metrics token) suite: Test config metrics token
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
tests: tests:
- it: metrics token is set - it: "Configure the metrics token when it is set"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea: gitea:
@@ -18,7 +18,7 @@ tests:
value: |- value: |-
ENABLED=true ENABLED=true
TOKEN=somepassword TOKEN=somepassword
- it: metrics token is empty - it: "Omit the metrics token when it is empty"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea: gitea:
@@ -32,7 +32,7 @@ tests:
decodeBase64: true decodeBase64: true
value: |- value: |-
ENABLED=true ENABLED=true
- it: metrics token is nil - it: "Omit the metrics token when it is nil"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea: gitea:
@@ -46,7 +46,7 @@ tests:
decodeBase64: true decodeBase64: true
value: |- value: |-
ENABLED=true ENABLED=true
- it: does not configures a token if metrics are disabled - it: "Omit the metrics token when metrics are disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea: gitea:
@@ -1,9 +1,9 @@
suite: config template | queue config suite: Test config queue
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
tests: tests:
- it: "queue is configured correctly for valkey" - it: "Configure the queue for valkey"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -17,7 +17,7 @@ tests:
CONN_STR=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s& CONN_STR=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
TYPE=redis TYPE=redis
- it: "queue is configured correctly for 'levelDB' when valkey is disabled" - it: "Configure the queue for 'levelDB' when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -31,7 +31,7 @@ tests:
CONN_STR= CONN_STR=
TYPE=level TYPE=level
- it: "queue can be customized when valkey is disabled" - it: "Customize the queue when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -1,9 +1,9 @@
suite: config template | server section (domain related) suite: Test config server domain
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
tests: tests:
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL" - it: "[default values] Use the ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
@@ -24,7 +24,7 @@ tests:
################################################ ################################################
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL" - it: "[no ingress hosts] Use the HTTP Service for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
ingress: ingress:
@@ -48,7 +48,7 @@ tests:
################################################ ################################################
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL" - it: "[provided via values] Use the configured values for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
gitea.config.server.DOMAIN: provided.example.com gitea.config.server.DOMAIN: provided.example.com
@@ -77,7 +77,7 @@ tests:
################################################ ################################################
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL" - it: "[route enabled] Use the Route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
route: route:
@@ -102,7 +102,7 @@ tests:
################################################ ################################################
- it: "[route tls termination] uses https for ROOT_URL" - it: "[route tls termination] Use https for ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
route: route:
@@ -119,7 +119,7 @@ tests:
################################################ ################################################
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL" - it: "[HTTPRoute enabled] Use the first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
ingress: ingress:
@@ -152,7 +152,7 @@ tests:
################################################ ################################################
- it: "[HTTPRoute tls] switches ROOT_URL to https" - it: "[HTTPRoute tls] Switch ROOT_URL to https"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
ingress: ingress:
@@ -1,9 +1,9 @@
suite: config template | session config suite: Test config session
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
tests: tests:
- it: "session is configured correctly for valkey" - it: "Configure the session for valkey"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -17,7 +17,7 @@ tests:
PROVIDER=redis PROVIDER=redis
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s& PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "session is configured correctly for 'memory' when valkey is disabled" - it: "Configure the session for 'memory' when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -31,7 +31,7 @@ tests:
PROVIDER=memory PROVIDER=memory
PROVIDER_CONFIG= PROVIDER_CONFIG=
- it: "session can be customized when valkey is disabled" - it: "Customize the session when valkey is disabled"
template: templates/secret_inlineConfig.yaml template: templates/secret_inlineConfig.yaml
set: set:
valkey: valkey:
@@ -1,143 +0,0 @@
suite: Dependency checks | Customization integrity | postgresql-ha
release:
name: gitea-unittests
namespace: testing
set:
postgresql:
enabled: false
postgresql-ha:
enabled: true
global:
postgresql:
database: gitea-database
password: gitea-password
username: gitea-username
postgresql:
repmgrPassword: custom-password-repmgr
postgresPassword: custom-password-postgres
password: custom-password-overwritten-by-global-postgresql-password
pgpool:
adminPassword: custom-password-pgpool
srCheckPassword: custom-password-sr-check
service:
ports:
postgresql: 1234
persistence:
size: 1337Mi
tests:
- it: "[postgresql-ha] DB settings are applied as expected"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
asserts:
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: POSTGRES_DB
value: "gitea-database"
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: POSTGRES_USER
value: "gitea-username"
- it: "[postgresql-ha] DB passwords are applied as expected"
template: charts/postgresql-ha/templates/postgresql/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["repmgr-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXJlcG1ncg=="
- documentIndex: 0
equal:
path: data["postgres-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBvc3RncmVz"
- documentIndex: 0
equal:
path: data["password"]
value: "Z2l0ZWEtcGFzc3dvcmQ=" # postgresql-ha.postgresql.password is overwritten by postgresql-ha.global.postgresql.password and should not be referenced here
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.srCheckPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["sr-check-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXNyLWNoZWNr"
- it: "[postgresql-ha] persistence.size is applied as expected"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
asserts:
- documentIndex: 0
equal:
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
value: "1337Mi"
- it: "[postgresql-ha] service.ports.postgresql is applied as expected"
template: charts/postgresql-ha/templates/pgpool/service.yaml
asserts:
- documentIndex: 0
equal:
path: spec.ports[0].port
value: 1234
- it: "[postgresql-ha] renders the referenced service"
template: charts/postgresql-ha/templates/pgpool/service.yaml
asserts:
- containsDocument:
kind: Service
apiVersion: v1
name: gitea-unittests-postgresql-ha-pgpool
namespace: testing
- it: "[gitea] connects to pgpool service"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234
- it: "[gitea] connects to pgpool service with custom cluster domain"
set:
clusterDomain: my-special-cluster.local
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
- it: "[gitea] connects to configured database"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: NAME=gitea-database
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: USER=gitea-username
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: PASSWD=gitea-password
@@ -1,102 +0,0 @@
suite: Dependency checks | Customization integrity | postgresql
release:
name: gitea-unittests
namespace: testing
set:
postgresql-ha:
enabled: false
postgresql:
enabled: true
global:
postgresql:
auth:
password: gitea-password
database: gitea-database
username: gitea-username
service:
ports:
postgresql: 1234
primary:
persistence:
size: 1337Mi
tests:
- it: "[postgresql] DB settings are applied as expected"
template: charts/postgresql/templates/primary/statefulset.yaml
asserts:
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: POSTGRES_DATABASE
value: "gitea-database"
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: POSTGRES_USER
value: "gitea-username"
- it: "[postgresql] DB password is applied as expected"
template: charts/postgresql/templates/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["password"]
value: "Z2l0ZWEtcGFzc3dvcmQ="
- it: "[postgresql] primary.persistence.size is applied as expected"
template: charts/postgresql/templates/primary/statefulset.yaml
asserts:
- documentIndex: 0
equal:
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
value: "1337Mi"
- it: "[postgresql] global.postgresql.service.ports.postgresql is applied as expected"
template: charts/postgresql/templates/primary/svc.yaml
asserts:
- documentIndex: 0
equal:
path: spec.ports[0].port
value: 1234
- it: "[postgresql] renders the referenced service"
template: charts/postgresql/templates/primary/svc.yaml
asserts:
- containsDocument:
kind: Service
apiVersion: v1
name: gitea-unittests-postgresql
namespace: testing
- it: "[gitea] connects to postgresql service"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
- it: "[gitea] connects to postgresql service with custom cluster domain"
set:
clusterDomain: my-special-cluster.local
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
- it: "[gitea] connects to configured database"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: NAME=gitea-database
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: USER=gitea-username
- documentIndex: 0
matchRegex:
path: data.database
decodeBase64: true
pattern: PASSWD=gitea-password
@@ -1,4 +1,4 @@
suite: Dependency checks | Customization integrity | valkey suite: Test dependency customization integrity of valkey
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -12,14 +12,14 @@ set:
permissions: "~* &* +@all" permissions: "~* &* +@all"
password: gitea-password password: gitea-password
tests: tests:
- it: "[valkey] valkey.auth.aclUsers.default.password is applied as expected" - it: "[valkey] Apply valkey.auth.aclUsers.default.password"
template: charts/valkey/templates/secret.yaml template: charts/valkey/templates/secret.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
equal: equal:
path: data.default-password path: data.default-password
value: "Z2l0ZWEtcGFzc3dvcmQ=" value: "Z2l0ZWEtcGFzc3dvcmQ="
- it: "[valkey] renders the referenced service" - it: "[valkey] Render the referenced Service"
template: charts/valkey/templates/service.yaml template: charts/valkey/templates/service.yaml
asserts: asserts:
- containsDocument: - containsDocument:
@@ -34,7 +34,7 @@ tests:
port: 6379 port: 6379
targetPort: tcp targetPort: tcp
protocol: TCP protocol: TCP
- it: "[gitea] waits for valkey to be up and running" - it: "[gitea] Wait for valkey to be up and running"
template: templates/secret_init.yaml template: templates/secret_init.yaml
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
@@ -42,7 +42,7 @@ tests:
path: data["configure_gitea.sh"] path: data["configure_gitea.sh"]
decodeBase64: true decodeBase64: true
pattern: nc -vz -w2 gitea-unittests-valkey.testing.svc.cluster.local 6379 pattern: nc -vz -w2 gitea-unittests-valkey.testing.svc.cluster.local 6379
- it: "[gitea] waits for valkey to be up and running with custom cluster domain" - it: "[gitea] Wait for valkey to be up and running with a custom cluster domain"
set: set:
clusterDomain: my-special-cluster.local clusterDomain: my-special-cluster.local
template: templates/secret_init.yaml template: templates/secret_init.yaml
@@ -1,42 +0,0 @@
suite: Dependency checks | Major image bumps
release:
name: gitea-unittests
namespace: testing
tests:
- it: "[postgresql-ha] ensures we detect major image version upgrades"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
set:
postgresql:
enabled: false
postgresql-ha:
enabled: true
asserts:
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: bitnamilegacy/postgresql-repmgr:17.+$
- it: "[postgresql] ensures we detect major image version upgrades"
template: charts/postgresql/templates/primary/statefulset.yaml
set:
postgresql:
enabled: true
postgresql-ha:
enabled: false
asserts:
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: bitnamilegacy/postgresql:17.+$
- it: "[valkey] ensures we detect major image version upgrades"
template: charts/valkey/templates/deploy_valkey.yaml
set:
valkey:
enabled: true
asserts:
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: valkey/valkey:9.+$
@@ -0,0 +1,16 @@
suite: Test dependency major image bumps
release:
name: gitea-unittests
namespace: testing
tests:
- it: "[valkey] Detect major image version upgrades"
template: charts/valkey/templates/deploy_valkey.yaml
set:
valkey:
enabled: true
asserts:
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: valkey/valkey:9.+$
@@ -1,4 +1,4 @@
suite: deployment template suite: Test deployment additional config
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: Renders a deployment - it: "Render a Deployment with additionalConfigFromEnvs"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- hasDocuments: - hasDocuments:
@@ -20,7 +20,7 @@ tests:
kind: Deployment kind: Deployment
apiVersion: apps/v1 apiVersion: apps/v1
name: gitea-unittests name: gitea-unittests
- it: Deployment with empty additionalConfigFromEnvs - it: "Render the Deployment with empty additionalConfigFromEnvs"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea.additionalConfigFromEnvs: [] gitea.additionalConfigFromEnvs: []
@@ -48,7 +48,7 @@ tests:
value: /tmp/existing-envs value: /tmp/existing-envs
- name: ENV_TO_INI_MOUNT_POINT - name: ENV_TO_INI_MOUNT_POINT
value: /env-to-ini-mounts value: /env-to-ini-mounts
- it: Deployment with standard additionalConfigFromEnvs - it: "Render the Deployment with standard additionalConfigFromEnvs"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: my-db:123}, {name: GITEA_database_USER, value: my-user}] gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: my-db:123}, {name: GITEA_database_USER, value: my-user}]
@@ -80,7 +80,7 @@ tests:
value: my-db:123 value: my-db:123
- name: GITEA_database_USER - name: GITEA_database_USER
value: my-user value: my-user
- it: Deployment with templated additionalConfigFromEnvs - it: "Render the Deployment with templated additionalConfigFromEnvs"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea.misc.host: my-db-host:321 gitea.misc.host: my-db-host:321
@@ -114,7 +114,7 @@ tests:
value: my-db-host:321 value: my-db-host:321
- name: GITEA_database_USER - name: GITEA_database_USER
value: my-db-user value: my-db-user
- it: Deployment with additionalConfigFromEnvs templated secret name - it: "Render the Deployment with a templated Secret name in additionalConfigFromEnvs"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea.misc.existingSecret: my-db-secret gitea.misc.existingSecret: my-db-secret
@@ -1,4 +1,4 @@
suite: deployment template (admin user) suite: Test deployment admin user
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: reads the admin credentials from the generated secret - it: "Read the admin credentials from the generated Secret"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- contains: - contains:
@@ -44,7 +44,7 @@ tests:
name: GITEA_ADMIN_PASSWORD_MODE name: GITEA_ADMIN_PASSWORD_MODE
value: keepUpdated value: keepUpdated
- it: reads the admin credentials from the configured keys of an existing secret - it: "Read the admin credentials from the configured keys of an existing Secret"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.admin.existingSecret.enabled: true secrets.admin.existingSecret.enabled: true
@@ -78,7 +78,7 @@ tests:
key: custom-email key: custom-email
name: custom-admin-secret name: custom-admin-secret
- it: omits the admin environment when the admin user is disabled - it: "Omit the admin environment when the admin user is disabled"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.admin.enabled: false secrets.admin.enabled: false
@@ -94,7 +94,7 @@ tests:
name: GITEA_ADMIN_PASSWORD_MODE name: GITEA_ADMIN_PASSWORD_MODE
any: true any: true
- it: fails on an unsupported password mode - it: "Fail on an unsupported password mode"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.admin.passwordMode: unsupported secrets.admin.passwordMode: unsupported
@@ -1,4 +1,4 @@
suite: deployment template (basic) suite: Test deployment basics
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: renders a deployment - it: "Render a Deployment"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- hasDocuments: - hasDocuments:
@@ -20,14 +20,14 @@ tests:
kind: Deployment kind: Deployment
apiVersion: apps/v1 apiVersion: apps/v1
name: gitea-unittests name: gitea-unittests
- it: renders no deployment when disabled - it: "Skip rendering when the Deployment is disabled"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.enabled: false deployment.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: deployment labels are set - it: "Render the configured Deployment labels"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.labels: deployment.labels:
@@ -45,7 +45,7 @@ tests:
path: spec.selector.matchLabels path: spec.selector.matchLabels
content: content:
hello: world hello: world
- it: deployment labels are not in selector matchLabels - it: "Omit the Deployment labels from the selector matchLabels"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.labels: deployment.labels:
@@ -57,7 +57,7 @@ tests:
value: value:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea-unittests app.kubernetes.io/instance: gitea-unittests
- it: deployment labels are always rendered - it: "Render the Deployment labels even when none are configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- isSubset: - isSubset:
@@ -67,12 +67,12 @@ tests:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea-unittests app.kubernetes.io/instance: gitea-unittests
app.kubernetes.io/managed-by: Helm app.kubernetes.io/managed-by: Helm
- it: deployment annotations are undefined - it: "Omit the Deployment annotations when none are configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: metadata.annotations path: metadata.annotations
- it: deployment annotations are set - it: "Render the configured Deployment annotations"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.annotations: deployment.annotations:
@@ -82,12 +82,12 @@ tests:
path: metadata.annotations path: metadata.annotations
value: value:
hello: world hello: world
- it: nodeSelector is undefined - it: "Omit the nodeSelector when none is configured"
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.nodeSelector path: spec.template.spec.nodeSelector
template: templates/deployment.yaml template: templates/deployment.yaml
- it: nodeSelector is defined - it: "Render the configured nodeSelector"
set: set:
deployment.nodeSelector: deployment.nodeSelector:
foo: bar foo: bar
@@ -99,12 +99,12 @@ tests:
foo: bar foo: bar
bar: foo bar: foo
template: templates/deployment.yaml template: templates/deployment.yaml
- it: affinity is undefined - it: "Omit the affinity when none is configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.affinity path: spec.template.spec.affinity
- it: affinity is defined - it: "Render the configured affinity"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.affinity: deployment.affinity:
@@ -128,12 +128,12 @@ tests:
operator: In operator: In
values: values:
- linux - linux
- it: dnsConfig is undefined - it: "Omit the dnsConfig when none is configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.dnsConfig path: spec.template.spec.dnsConfig
- it: dnsConfig is defined - it: "Render the configured dnsConfig"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.dnsConfig: deployment.dnsConfig:
@@ -151,12 +151,12 @@ tests:
options: options:
- name: ndots - name: ndots
value: "2" value: "2"
- it: priorityClassName is undefined - it: "Omit the priorityClassName when none is configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.priorityClassName path: spec.template.spec.priorityClassName
- it: priorityClassName is defined - it: "Render the configured priorityClassName"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.priorityClassName: high-priority deployment.priorityClassName: high-priority
@@ -164,12 +164,12 @@ tests:
- equal: - equal:
path: spec.template.spec.priorityClassName path: spec.template.spec.priorityClassName
value: high-priority value: high-priority
- it: schedulerName is undefined - it: "Omit the schedulerName when none is configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.schedulerName path: spec.template.spec.schedulerName
- it: schedulerName is defined - it: "Render the configured schedulerName"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.schedulerName: stork deployment.schedulerName: stork
@@ -177,7 +177,7 @@ tests:
- equal: - equal:
path: spec.template.spec.schedulerName path: spec.template.spec.schedulerName
value: stork value: stork
- it: strategy defaults to a rolling update - it: "Default the strategy to a rolling update"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- equal: - equal:
@@ -187,7 +187,7 @@ tests:
rollingUpdate: rollingUpdate:
maxUnavailable: 0 maxUnavailable: 0
maxSurge: 100% maxSurge: 100%
- it: strategy omits rollingUpdate for other strategy types - it: "Omit rollingUpdate for other strategy types"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.strategy.type: Recreate deployment.strategy.type: Recreate
@@ -196,12 +196,12 @@ tests:
path: spec.strategy path: spec.strategy
value: value:
type: Recreate type: Recreate
- it: tolerations are undefined - it: "Omit the tolerations when none are configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.tolerations path: spec.template.spec.tolerations
- it: tolerations are defined - it: "Render the configured tolerations"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.tolerations: deployment.tolerations:
@@ -217,12 +217,12 @@ tests:
operator: Equal operator: Equal
value: postgres value: postgres
effect: NoSchedule effect: NoSchedule
- it: topologySpreadConstraints are undefined - it: "Omit the topologySpreadConstraints when none are configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.topologySpreadConstraints path: spec.template.spec.topologySpreadConstraints
- it: topologySpreadConstraints are defined - it: "Render the configured topologySpreadConstraints"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.topologySpreadConstraints: deployment.topologySpreadConstraints:
@@ -243,7 +243,7 @@ tests:
matchLabels: matchLabels:
app.kubernetes.io/instance: gitea-unittests app.kubernetes.io/instance: gitea-unittests
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container" - it: "Inject TMP_EXISTING_ENVS_FILE into the 'init-app-ini' init container"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- contains: - contains:
@@ -251,7 +251,7 @@ tests:
content: content:
name: TMP_EXISTING_ENVS_FILE name: TMP_EXISTING_ENVS_FILE
value: /tmp/existing-envs value: /tmp/existing-envs
- it: "injects ENV_TO_INI_MOUNT_POINT as environment variable to 'init-app-ini' init container" - it: "Inject ENV_TO_INI_MOUNT_POINT into the 'init-app-ini' init container"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- contains: - contains:
@@ -259,7 +259,7 @@ tests:
content: content:
name: ENV_TO_INI_MOUNT_POINT name: ENV_TO_INI_MOUNT_POINT
value: /env-to-ini-mounts value: /env-to-ini-mounts
- it: "deployment.gitea.env is injected into all init containers and the gitea container" - it: "Inject deployment.gitea.env into all init containers and the gitea container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.env: deployment.gitea.env:
@@ -286,7 +286,7 @@ tests:
content: content:
name: VARIABLE name: VARIABLE
value: my-value value: my-value
- it: CPU resources are defined as well as GOMAXPROCS - it: "Render GOMAXPROCS when the CPU resources are defined"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.resources: deployment.gitea.resources:
@@ -314,7 +314,7 @@ tests:
requests: requests:
cpu: 100ms cpu: 100ms
memory: 100Mi memory: 100Mi
- it: container resources default to an empty map and GOMAXPROCS is omitted - it: "Default the container resources to an empty map and omit GOMAXPROCS"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- equal: - equal:
@@ -328,12 +328,12 @@ tests:
resourceFieldRef: resourceFieldRef:
divisor: "1" divisor: "1"
resource: limits.cpu resource: limits.cpu
- it: pod level resources are undefined - it: "Omit the pod level resources when none are configured"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.resources path: spec.template.spec.resources
- it: pod level resources are defined - it: "Render the configured pod level resources"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.resources: deployment.resources:
@@ -353,7 +353,7 @@ tests:
requests: requests:
cpu: 250m cpu: 250m
memory: 256Mi memory: 256Mi
- it: Init containers have correct volumeMount path - it: "Render the configured volumeMount path of the init containers"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
initContainersScriptsVolumeMountPath: "/custom/init/path" initContainersScriptsVolumeMountPath: "/custom/init/path"
@@ -364,7 +364,7 @@ tests:
- equal: - equal:
path: spec.template.spec.initContainers[*].volumeMounts[?(@.name=="config")].mountPath path: spec.template.spec.initContainers[*].volumeMounts[?(@.name=="config")].mountPath
value: "/custom/init/path" value: "/custom/init/path"
- it: Init containers have correct volumeMount path if there is no override - it: "Render the default volumeMount path of the init containers"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- equal: - equal:
@@ -1,19 +1,22 @@
suite: deployment template (checksum annotations) suite: Test deployment checksum annotations
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
- templates/secret_admin.yaml - templates/secret_admin.yaml
- templates/secret_cloudnativePG.yaml
- templates/secret_config.yaml - templates/secret_config.yaml
- templates/secret_gpg.yaml - templates/secret_gpg.yaml
- templates/secret_init.yaml - templates/secret_init.yaml
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: omits the checksum annotations by default - it: "Omit the checksum annotations by default"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
cloudnativePG.enabled: true
secrets.admin.enabled: true secrets.admin.enabled: true
secrets.config.enabled: true secrets.config.enabled: true
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -26,6 +29,8 @@ tests:
asserts: asserts:
- notExists: - notExists:
path: spec.template.metadata.annotations["checksum/admin"] path: spec.template.metadata.annotations["checksum/admin"]
- notExists:
path: spec.template.metadata.annotations["checksum/cloudnativePG"]
- notExists: - notExists:
path: spec.template.metadata.annotations["checksum/config"] path: spec.template.metadata.annotations["checksum/config"]
- notExists: - notExists:
@@ -37,9 +42,12 @@ tests:
- notExists: - notExists:
path: spec.template.metadata.annotations["checksum/metrics"] path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds a checksum annotation for every Secret when addSHASumAnnotation is enabled - it: "Add a checksum annotation for every Secret when addSHASumAnnotation is enabled"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
cloudnativePG.credentials.addSHASumAnnotation: true
cloudnativePG.enabled: true
secrets.admin.addSHASumAnnotation: true secrets.admin.addSHASumAnnotation: true
secrets.admin.enabled: true secrets.admin.enabled: true
@@ -63,6 +71,8 @@ tests:
asserts: asserts:
- exists: - exists:
path: spec.template.metadata.annotations["checksum/admin"] path: spec.template.metadata.annotations["checksum/admin"]
- exists:
path: spec.template.metadata.annotations["checksum/cloudnativePG"]
- exists: - exists:
path: spec.template.metadata.annotations["checksum/config"] path: spec.template.metadata.annotations["checksum/config"]
- exists: - exists:
@@ -74,7 +84,7 @@ tests:
- exists: - exists:
path: spec.template.metadata.annotations["checksum/metrics"] path: spec.template.metadata.annotations["checksum/metrics"]
- it: omits the checksum annotation of a single disabled Secret only - it: "Omit the checksum annotation of a single disabled Secret only"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.admin.addSHASumAnnotation: false secrets.admin.addSHASumAnnotation: false
@@ -111,7 +121,7 @@ tests:
- notExists: - notExists:
path: spec.template.metadata.annotations["checksum/metrics"] path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds the checksum of Secrets provided by the user - it: "Add the checksum of Secrets provided by the user"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.admin.enabled: true secrets.admin.enabled: true
@@ -0,0 +1,67 @@
suite: Test deployment cloudnativePG credentials
release:
name: gitea-unittests
namespace: testing
templates:
- templates/deployment.yaml
- templates/secret_cloudnativePG.yaml
tests:
- it: "Inject no database password when cloudnativePG is disabled"
template: templates/deployment.yaml
set:
cloudnativePG:
enabled: false
asserts:
- notContains:
path: spec.template.spec.initContainers[1].env
content:
name: GITEA__database__PASSWD
any: true
- it: "Inject the database password from the rendered Secret"
template: templates/deployment.yaml
set:
cloudnativePG:
enabled: true
asserts:
- contains:
path: spec.template.spec.initContainers[1].env
content:
name: GITEA__database__PASSWD
valueFrom:
secretKeyRef:
key: password
name: gitea-unittests-postgresql-app
- it: "Inject the database password from an existing Secret"
template: templates/deployment.yaml
set:
cloudnativePG:
enabled: true
credentials:
existingSecret:
enabled: true
secretName: my-credentials
passwordKey: my-password-key
asserts:
- contains:
path: spec.template.spec.initContainers[1].env
content:
name: GITEA__database__PASSWD
valueFrom:
secretKeyRef:
key: my-password-key
name: my-credentials
- it: "Fail when an existing Secret is used without a name"
template: templates/deployment.yaml
set:
cloudnativePG:
enabled: true
credentials:
existingSecret:
enabled: true
secretName: ""
asserts:
- failedTemplate:
errorMessage: "`cloudnativePG.credentials.existingSecret.secretName` must be set when `cloudnativePG.credentials.existingSecret.enabled` is enabled"
@@ -1,4 +1,4 @@
suite: deployment template (extraEnvSourceFile) suite: Test deployment extraEnvSourceFile
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: uses direct execution when extraEnvSourceFile is not set - it: "Use direct execution when extraEnvSourceFile is not set"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- equal: - equal:
@@ -25,7 +25,7 @@ tests:
- notExists: - notExists:
path: spec.template.spec.initContainers[2].args path: spec.template.spec.initContainers[2].args
- it: sources env file in init-app-ini when extraEnvSourceFile is set - it: "Source the env file in init-app-ini when extraEnvSourceFile is set"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -41,7 +41,7 @@ tests:
path: spec.template.spec.initContainers[1].args[0] path: spec.template.spec.initContainers[1].args[0]
pattern: config_environment\.sh pattern: config_environment\.sh
- it: sources env file in configure-gitea when extraEnvSourceFile is set - it: "Source the env file in configure-gitea when extraEnvSourceFile is set"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -57,7 +57,7 @@ tests:
path: spec.template.spec.initContainers[2].args[0] path: spec.template.spec.initContainers[2].args[0]
pattern: configure_gitea\.sh pattern: configure_gitea\.sh
- it: sources env file in configure-gpg when extraEnvSourceFile is set with signing enabled - it: "Source the env file in configure-gpg when extraEnvSourceFile is set and signing is enabled"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -76,7 +76,7 @@ tests:
path: spec.template.spec.initContainers[2].args[0] path: spec.template.spec.initContainers[2].args[0]
pattern: configure_gpg_environment\.sh pattern: configure_gpg_environment\.sh
- it: includes file existence check in source command - it: "Include a file existence check in the source command"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -1,4 +1,4 @@
suite: deployment template suite: Test deployment extraInitContainers
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: Render the deployment (default) - it: "Render the Deployment with the default init containers"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@@ -21,7 +21,7 @@ tests:
count: 3 count: 3
template: templates/deployment.yaml template: templates/deployment.yaml
- it: Render the deployment (signing) - it: "Render the Deployment with the signing init container"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
secrets.gpg.existingSecret.enabled: true secrets.gpg.existingSecret.enabled: true
@@ -35,7 +35,7 @@ tests:
count: 4 count: 4
template: templates/deployment.yaml template: templates/deployment.yaml
- it: Render the deployment (extraInitContainers) - it: "Render the Deployment with extraInitContainers"
set: set:
deployment.initContainers: deployment.initContainers:
- container: - container:
@@ -68,7 +68,7 @@ tests:
value: foo value: foo
template: templates/deployment.yaml template: templates/deployment.yaml
- it: renders the chart-managed init containers in the configured order - it: "Render the chart-managed init containers in the configured order"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initContainers: deployment.initContainers:
@@ -82,7 +82,7 @@ tests:
path: spec.template.spec.initContainers[1].name path: spec.template.spec.initContainers[1].name
value: init-directories value: init-directories
- it: fails when an init container entry sets both container and link - it: "Fail when an init container entry sets both container and link"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initContainers: deployment.initContainers:
@@ -94,7 +94,7 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: "deployment.initContainers[0]: `container` and `link` are mutually exclusive" errorMessage: "deployment.initContainers[0]: `container` and `link` are mutually exclusive"
- it: fails when an init container entry sets neither container nor link - it: "Fail when an init container entry sets neither container nor link"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initContainers: deployment.initContainers:
@@ -103,7 +103,7 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: "deployment.initContainers[0]: either `container` or `link` must be set" errorMessage: "deployment.initContainers[0]: either `container` or `link` must be set"
- it: fails when an init container links to an unknown configuration - it: "Fail when an init container links to an unknown configuration"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initContainers: deployment.initContainers:
@@ -1,4 +1,4 @@
suite: deployment template (HA) suite: Test deployment high availability
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled - it: "Fail with multiple replicas and GIT_GC_REPOS enabled"
template: templates/secret_config.yaml template: templates/secret_config.yaml
set: set:
deployment: deployment:
@@ -28,7 +28,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'." errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
- it: fails with multiple replicas and RWX file system not set - it: "Fail with multiple replicas and no RWX file system"
template: templates/secret_config.yaml template: templates/secret_config.yaml
set: set:
deployment: deployment:
@@ -36,7 +36,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.new.accessModes[0] must be set to ReadWriteMany." errorMessage: "When using multiple replicas, a RWX file system is required and persistence.new.accessModes[0] must be set to ReadWriteMany."
- it: fails with multiple replicas and bleve issue indexer - it: "Fail with multiple replicas and the bleve issue indexer"
template: templates/secret_config.yaml template: templates/secret_config.yaml
set: set:
deployment: deployment:
@@ -52,7 +52,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)." errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
- it: fails with multiple replicas and bleve repo indexer - it: "Fail with multiple replicas and the bleve repo indexer"
template: templates/secret_config.yaml template: templates/secret_config.yaml
set: set:
deployment: deployment:
@@ -1,4 +1,4 @@
suite: deployment template (image configuration) suite: Test deployment image configuration
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -14,13 +14,13 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: default values - it: "Render the default image reference"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.3-rootless" value: "docker.gitea.com/gitea:1.19.3-rootless"
- it: tag override - it: "Render a custom image tag"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.tag: "1.19.4" deployment.gitea.image.tag: "1.19.4"
@@ -28,7 +28,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.4-rootless" value: "docker.gitea.com/gitea:1.19.4-rootless"
- it: root-based image - it: "Render the root-based image variant"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
@@ -36,7 +36,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.3" value: "docker.gitea.com/gitea:1.19.3"
- it: scoped registry - it: "Render a scoped image registry"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.registry: "example.com" deployment.gitea.image.registry: "example.com"
@@ -44,7 +44,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "example.com/gitea:1.19.3-rootless" value: "example.com/gitea:1.19.3-rootless"
- it: global registry - it: "Render the global image registry"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
global.imageRegistry: "global.example.com" global.imageRegistry: "global.example.com"
@@ -52,7 +52,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "global.example.com/gitea:1.19.3-rootless" value: "global.example.com/gitea:1.19.3-rootless"
- it: digest for rootless image - it: "Render a digest for the rootless image"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment: deployment:
@@ -64,7 +64,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" value: "docker.gitea.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
- it: image fullOverride (does not append rootless) - it: "Render image.fullOverride without appending the rootless suffix"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment: deployment:
@@ -81,7 +81,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.3" value: "docker.gitea.com/gitea:1.19.3"
- it: digest for root-based image - it: "Render a digest for the root-based image"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment: deployment:
@@ -93,7 +93,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" value: "docker.gitea.com/gitea:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
- it: digest and global registry - it: "Render a digest together with the global image registry"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
global.imageRegistry: "global.example.com" global.imageRegistry: "global.example.com"
@@ -102,7 +102,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "global.example.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a" value: "global.example.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
- it: correctly renders floating tag references - it: "Render unquoted floating tag references"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
# use non-quoted values on purpose. See: https://gitea.com/gitea/helm-gitea/issues/631 # use non-quoted values on purpose. See: https://gitea.com/gitea/helm-gitea/issues/631
@@ -123,7 +123,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: "docker.gitea.com/gitea:1.21-rootless" value: "docker.gitea.com/gitea:1.21-rootless"
- it: init containers use their own image configuration - it: "Render the own image configuration of the init containers"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initDirectories.image.registry: "init.example.com" deployment.initDirectories.image.registry: "init.example.com"
@@ -1,4 +1,4 @@
suite: deployment template (init container configuration) suite: Test deployment init container configuration
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: appends the per-container env - it: "Append the per-container env"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initDirectories.env: deployment.initDirectories.env:
@@ -37,7 +37,7 @@ tests:
name: INIT_DIRECTORIES name: INIT_DIRECTORIES
value: "1" value: "1"
- it: renders the per-container envFrom - it: "Render the per-container envFrom"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initAppIni.envFrom: deployment.initAppIni.envFrom:
@@ -52,7 +52,7 @@ tests:
- secretRef: - secretRef:
name: special-secret name: special-secret
- it: appends the per-container volumeMounts - it: "Append the per-container volumeMounts"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initConfigureGitea.volumeMounts: deployment.initConfigureGitea.volumeMounts:
@@ -73,7 +73,7 @@ tests:
mountPath: /configmap mountPath: /configmap
readOnly: true readOnly: true
- it: overrides the resources of a single init container - it: "Override the resources of a single init container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.initDirectories.resources: deployment.initDirectories.resources:
@@ -93,7 +93,7 @@ tests:
cpu: 100m cpu: 100m
memory: 128Mi memory: 128Mi
- it: overrides the security context of a single init container - it: "Override the security context of a single init container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.securityContext: deployment.gitea.securityContext:
@@ -108,7 +108,7 @@ tests:
path: spec.template.spec.initContainers[1].securityContext.runAsUser path: spec.template.spec.initContainers[1].securityContext.runAsUser
value: 1000 value: 1000
- it: renders the envFrom of the gitea container - it: "Render the envFrom of the gitea container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.envFrom: deployment.gitea.envFrom:
@@ -121,7 +121,7 @@ tests:
- configMapRef: - configMapRef:
name: special-config name: special-config
- it: omits envFrom when unset - it: "Omit the envFrom when it is unset"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
+5 -5
View File
@@ -1,4 +1,4 @@
suite: deployment template (openshift) suite: Test deployment on OpenShift
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: renders openshift-compatible defaults for chart-managed containers - it: "Render OpenShift compatible defaults for the chart-managed containers"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
openshift.enabled: true openshift.enabled: true
@@ -61,7 +61,7 @@ tests:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
- it: does not force runAsUser 1000 for command init containers on OpenShift - it: "Omit runAsUser 1000 for command init containers on OpenShift"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
openshift.enabled: true openshift.enabled: true
@@ -74,7 +74,7 @@ tests:
- notExists: - notExists:
path: spec.template.spec.initContainers[3].securityContext.runAsUser path: spec.template.spec.initContainers[3].securityContext.runAsUser
- it: preserves explicit pod and container security context overrides on OpenShift - it: "Preserve explicit pod and container security context overrides on OpenShift"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
openshift: openshift:
@@ -102,7 +102,7 @@ tests:
path: spec.template.spec.containers[0].securityContext.runAsGroup path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000620000 value: 1000620000
- it: renders an explicit hostUsers=false override on OpenShift - it: "Render an explicit hostUsers=false override on OpenShift"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
openshift: openshift:
+11 -11
View File
@@ -1,4 +1,4 @@
suite: deployment template (probes) suite: Test deployment probes
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: renders default liveness probe - it: "Render the default liveness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
@@ -26,7 +26,7 @@ tests:
tcpSocket: tcpSocket:
port: http port: http
timeoutSeconds: 1 timeoutSeconds: 1
- it: renders default readiness probe - it: "Render the default readiness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
@@ -41,12 +41,12 @@ tests:
tcpSocket: tcpSocket:
port: http port: http
timeoutSeconds: 1 timeoutSeconds: 1
- it: does not render a default startup probe - it: "Skip the startup probe by default"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.containers[0].startupProbe path: spec.template.spec.containers[0].startupProbe
- it: allows enabling a startup probe - it: "Render the startup probe when it is enabled"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea.startupProbe.enabled: true gitea.startupProbe.enabled: true
@@ -64,7 +64,7 @@ tests:
port: http port: http
timeoutSeconds: 1 timeoutSeconds: 1
- it: allows overwriting the default port of the liveness probe - it: "Overwrite the default port of the liveness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -78,7 +78,7 @@ tests:
tcpSocket: tcpSocket:
port: my-port port: my-port
- it: allows overwriting the default port of the readiness probe - it: "Overwrite the default port of the readiness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -92,7 +92,7 @@ tests:
tcpSocket: tcpSocket:
port: my-port port: my-port
- it: allows overwriting the default port of the startup probe - it: "Overwrite the default port of the startup probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -107,7 +107,7 @@ tests:
tcpSocket: tcpSocket:
port: my-port port: my-port
- it: allows using a non-default method as liveness probe - it: "Use a non-default method as liveness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -135,7 +135,7 @@ tests:
port: http port: http
timeoutSeconds: 13372 timeoutSeconds: 13372
- it: allows using a non-default method as readiness probe - it: "Use a non-default method as readiness probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -163,7 +163,7 @@ tests:
port: http port: http
timeoutSeconds: 13372 timeoutSeconds: 13372
- it: allows using a non-default method as startup probe - it: "Use a non-default method as startup probe"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
gitea: gitea:
@@ -1,4 +1,4 @@
suite: sidecar container suite: Test deployment sidecar container
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: supports adding a sidecar container - it: "Render an additional sidecar container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
extraContainers: extraContainers:
@@ -1,4 +1,4 @@
suite: deployment template (signing disabled) suite: Test deployment with signing disabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: skips gpg init container - it: "Skip the gpg init container"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notContains: - notContains:
@@ -19,7 +19,7 @@ tests:
any: true any: true
content: content:
name: configure-gpg name: configure-gpg
- it: skips gpg env in `init-directories` init container - it: "Skip the gpg env of the `init-directories` init container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: false secrets.gpg.enabled: false
@@ -28,14 +28,14 @@ tests:
path: spec.template.spec.initContainers[0].env path: spec.template.spec.initContainers[0].env
content: content:
name: GNUPGHOME name: GNUPGHOME
- it: skips gpg env in runtime container - it: "Skip the gpg env of the runtime container"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notContains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: GNUPGHOME name: GNUPGHOME
- it: skips gpg volume spec - it: "Skip the gpg volume spec"
template: templates/deployment.yaml template: templates/deployment.yaml
asserts: asserts:
- notContains: - notContains:
@@ -1,4 +1,4 @@
suite: deployment template (signing enabled) suite: Test deployment with signing enabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: adds gpg init container - it: "Add the gpg init container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -48,7 +48,7 @@ tests:
- name: gpg-private-key - name: gpg-private-key
mountPath: /raw mountPath: /raw
readOnly: true readOnly: true
- it: adds gpg env in `init-directories` init container - it: "Add the gpg env to the `init-directories` init container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -63,7 +63,7 @@ tests:
secretKeyRef: secretKeyRef:
name: custom-gpg-secret name: custom-gpg-secret
key: gpgHome key: gpgHome
- it: adds gpg env in runtime container - it: "Add the gpg env to the runtime container"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -78,7 +78,7 @@ tests:
secretKeyRef: secretKeyRef:
name: custom-gpg-secret name: custom-gpg-secret
key: gpgHome key: gpgHome
- it: reads the gpg home from the configured key of an existing secret - it: "Read the gpg home from the configured key of an existing Secret"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -94,7 +94,7 @@ tests:
secretKeyRef: secretKeyRef:
name: custom-gpg-secret name: custom-gpg-secret
key: custom-gpg-home key: custom-gpg-home
- it: adds gpg volume spec - it: "Add the gpg volume spec"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -110,7 +110,7 @@ tests:
- key: privateKey - key: privateKey
path: private.asc path: private.asc
defaultMode: 0100 defaultMode: 0100
- it: supports gpg volume spec with external reference - it: "Render the gpg volume spec with an external reference"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -1,4 +1,4 @@
suite: deployment template (SSH configuration) suite: Test deployment SSH configuration
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml - templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: supports defining SSH log level for root based image - it: "Define the SSH log level for the root based image"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
@@ -21,7 +21,7 @@ tests:
content: content:
name: SSH_LOG_LEVEL name: SSH_LOG_LEVEL
value: "INFO" value: "INFO"
- it: supports overriding SSH log level - it: "Override the SSH log level"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
@@ -32,7 +32,7 @@ tests:
content: content:
name: SSH_LOG_LEVEL name: SSH_LOG_LEVEL
value: "DEBUG" value: "DEBUG"
- it: supports overriding SSH log level (even when image.fullOverride set) - it: "Override the SSH log level when image.fullOverride is set"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3 deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
@@ -44,7 +44,7 @@ tests:
content: content:
name: SSH_LOG_LEVEL name: SSH_LOG_LEVEL
value: "DEBUG" value: "DEBUG"
- it: skips SSH_LOG_LEVEL for rootless image - it: "Skip SSH_LOG_LEVEL for the rootless image"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.rootless: true deployment.gitea.image.rootless: true
@@ -55,7 +55,7 @@ tests:
any: true any: true
content: content:
name: SSH_LOG_LEVEL name: SSH_LOG_LEVEL
- it: skips SSH_LOG_LEVEL for rootless image (even when image.fullOverride set) - it: "Skip SSH_LOG_LEVEL for the rootless image when image.fullOverride is set"
template: templates/deployment.yaml template: templates/deployment.yaml
set: set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3 deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
@@ -1,15 +1,15 @@
suite: deprecation template (deployment) suite: Test deployment deprecations
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/deprecation.yaml - templates/deprecation.yaml
tests: tests:
- it: renders nothing with the default values - it: "Render nothing with the default values"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: fails when the removed `affinity` value is set - it: "Fail when the removed `affinity` value is set"
set: set:
affinity: affinity:
nodeAffinity: nodeAffinity:
@@ -23,14 +23,14 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`affinity` does no longer exist. Please refer to the changelog and configure `deployment.affinity` instead." errorMessage: "`affinity` does no longer exist. Please refer to the changelog and configure `deployment.affinity` instead."
- it: fails when the removed `containerSecurityContext` value is set - it: "Fail when the removed `containerSecurityContext` value is set"
set: set:
containerSecurityContext: containerSecurityContext:
runAsUser: 1000 runAsUser: 1000
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`containerSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.gitea.securityContext` instead." errorMessage: "`containerSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.gitea.securityContext` instead."
- it: fails when the removed `deployment.env` value is set - it: "Fail when the removed `deployment.env` value is set"
set: set:
deployment.env: deployment.env:
- name: VARIABLE - name: VARIABLE
@@ -38,7 +38,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead." errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead."
- it: fails when the removed `dnsConfig` value is set - it: "Fail when the removed `dnsConfig` value is set"
set: set:
dnsConfig: dnsConfig:
nameservers: nameservers:
@@ -46,7 +46,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead." errorMessage: "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead."
- it: fails when the removed `extraContainerVolumeMounts` value is set - it: "Fail when the removed `extraContainerVolumeMounts` value is set"
set: set:
extraContainerVolumeMounts: extraContainerVolumeMounts:
- name: postgres-ssl-vol - name: postgres-ssl-vol
@@ -54,7 +54,23 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead."
- it: fails when the removed `extraVolumes` value is set - it: "Fail when the removed `extraInitVolumeMounts` value is set"
set:
extraInitVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
asserts:
- failedTemplate:
errorMessage: "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead."
- it: "Fail when the removed `extraVolumeMounts` value is set"
set:
extraVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
asserts:
- failedTemplate:
errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead."
- it: "Fail when the removed `extraVolumes` value is set"
set: set:
extraVolumes: extraVolumes:
- name: postgres-ssl-vol - name: postgres-ssl-vol
@@ -63,39 +79,53 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead." errorMessage: "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead."
- it: fails when the removed `ingress.className` value is set - it: "Fail when the removed `ingress.className` value is set"
set: set:
ingress.className: "" ingress.className: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`ingress.className` does no longer exist. Please refer to the changelog and configure `ingress.ingressClassName` instead." errorMessage: "`ingress.className` does no longer exist. Please refer to the changelog and configure `ingress.ingressClassName` instead."
- it: fails when the removed `nodeSelector` value is set - it: "Fail when the removed `nodeSelector` value is set"
set: set:
nodeSelector: nodeSelector:
foo: bar foo: bar
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead." errorMessage: "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead."
- it: fails when the removed `openshift.hostUsers` value is set - it: "Fail when the removed `openshift.hostUsers` value is set"
set: set:
openshift.hostUsers: false openshift.hostUsers: false
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead." errorMessage: "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead."
- it: fails when the removed `priorityClassName` value is set - it: "Fail when the removed `postgresql` value is set"
set:
postgresql:
enabled: true
asserts:
- failedTemplate:
errorMessage: "`postgresql` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster."
- it: "Fail when the removed `postgresql-ha` value is set"
set:
postgresql-ha:
enabled: true
asserts:
- failedTemplate:
errorMessage: "`postgresql-ha` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster."
- it: "Fail when the removed `priorityClassName` value is set"
set: set:
priorityClassName: high-priority priorityClassName: high-priority
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead." errorMessage: "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead."
- it: fails when the removed `podSecurityContext` value is set - it: "Fail when the removed `podSecurityContext` value is set"
set: set:
podSecurityContext: podSecurityContext:
fsGroup: 1000 fsGroup: 1000
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`podSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` instead." errorMessage: "`podSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` instead."
- it: fails when the removed `postExtraInitContainers` value is set - it: "Fail when the removed `postExtraInitContainers` value is set"
set: set:
postExtraInitContainers: postExtraInitContainers:
- name: post-init-container - name: post-init-container
@@ -103,7 +133,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`postExtraInitContainers` does no longer exist. Please refer to the changelog and append an entry with a `container` key to `deployment.initContainers` instead." errorMessage: "`postExtraInitContainers` does no longer exist. Please refer to the changelog and append an entry with a `container` key to `deployment.initContainers` instead."
- it: fails when the removed `preExtraInitContainers` value is set - it: "Fail when the removed `preExtraInitContainers` value is set"
set: set:
preExtraInitContainers: preExtraInitContainers:
- name: pre-init-container - name: pre-init-container
@@ -111,7 +141,7 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`preExtraInitContainers` does no longer exist. Please refer to the changelog and prepend an entry with a `container` key to `deployment.initContainers` instead." errorMessage: "`preExtraInitContainers` does no longer exist. Please refer to the changelog and prepend an entry with a `container` key to `deployment.initContainers` instead."
- it: fails when the removed `resources` value is set - it: "Fail when the removed `resources` value is set"
set: set:
resources: resources:
limits: limits:
@@ -119,40 +149,40 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead." errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
- it: fails when the removed `replicaCount` value is set - it: "Fail when the removed `replicaCount` value is set"
set: set:
replicaCount: 2 replicaCount: 2
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead." errorMessage: "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead."
- it: fails when the removed `schedulerName` value is set - it: "Fail when the removed `schedulerName` value is set"
set: set:
schedulerName: stork schedulerName: stork
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead." errorMessage: "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead."
- it: fails when the removed `securityContext` value is set - it: "Fail when the removed `securityContext` value is set"
set: set:
securityContext: securityContext:
runAsUser: 1000 runAsUser: 1000
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`securityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` and `deployment.gitea.securityContext` instead." errorMessage: "`securityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` and `deployment.gitea.securityContext` instead."
- it: fails when the removed `strategy` value is set - it: "Fail when the removed `strategy` value is set"
set: set:
strategy: strategy:
type: Recreate type: Recreate
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`strategy` does no longer exist. Please refer to the changelog and configure `deployment.strategy` instead." errorMessage: "`strategy` does no longer exist. Please refer to the changelog and configure `deployment.strategy` instead."
- it: fails when the removed `test` value is set - it: "Fail when the removed `test` value is set"
set: set:
test: test:
enabled: false enabled: false
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`test` does no longer exist. Please refer to the changelog. The `helm test` connection Pod has been removed without replacement." errorMessage: "`test` does no longer exist. Please refer to the changelog. The `helm test` connection Pod has been removed without replacement."
- it: fails when the removed `tolerations` value is set - it: "Fail when the removed `tolerations` value is set"
set: set:
tolerations: tolerations:
- key: database/type - key: database/type
@@ -162,14 +192,14 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead." errorMessage: "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead."
- it: fails when the removed `topologySpreadConstraints` value is set - it: "Fail when the removed `topologySpreadConstraints` value is set"
set: set:
topologySpreadConstraints: topologySpreadConstraints:
- topologyKey: kubernetes.io/hostname - topologyKey: kubernetes.io/hostname
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`topologySpreadConstraints` does no longer exist. Please refer to the changelog and configure `deployment.topologySpreadConstraints` instead." errorMessage: "`topologySpreadConstraints` does no longer exist. Please refer to the changelog and configure `deployment.topologySpreadConstraints` instead."
- it: skips the deprecation checks when `checkDeprecation` is disabled - it: "Skip the deprecation checks when `checkDeprecation` is disabled"
set: set:
checkDeprecation: false checkDeprecation: false
affinity: affinity:
@@ -185,6 +215,12 @@ tests:
extraContainerVolumeMounts: extraContainerVolumeMounts:
- name: postgres-ssl-vol - name: postgres-ssl-vol
mountPath: /pg-ssl mountPath: /pg-ssl
extraInitVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
extraVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
extraVolumes: extraVolumes:
- name: postgres-ssl-vol - name: postgres-ssl-vol
secret: secret:
@@ -1,11 +1,11 @@
suite: Test Gateway API backendTLSPolicy.yaml suite: Test gateway API backendTLSPolicy
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/backendTLSPolicy.yaml - templates/backendTLSPolicy.yaml
tests: tests:
- it: should not render when gatewayAPI.enabled is false - it: "Skip rendering when gatewayAPI.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: false enabled: false
@@ -22,7 +22,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should not render when backendTLSPolicy.enabled is false - it: "Skip rendering when backendTLSPolicy.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -31,7 +31,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should render a BackendTLSPolicy targeting the http Service by default - it: "Render a BackendTLSPolicy targeting the HTTP Service by default"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -65,7 +65,7 @@ tests:
path: spec.validation.hostname path: spec.validation.hostname
value: git.internal value: git.internal
- it: should fail when validation is missing - it: "Fail when the validation is missing"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -76,7 +76,7 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required
- it: should fail when validation is an empty dict - it: "Fail when the validation is an empty dict"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -1,11 +1,11 @@
suite: Test Gateway API clientSettingsPolicy.yaml suite: Test gateway API clientSettingsPolicy
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/clientSettingsPolicy.yaml - templates/clientSettingsPolicy.yaml
tests: tests:
- it: should not render when gatewayAPI.enabled is false - it: "Skip rendering when gatewayAPI.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: false enabled: false
@@ -18,7 +18,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should not render when clientSettingsPolicies.enabled is false - it: "Skip rendering when clientSettingsPolicies.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -27,7 +27,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should render a ClientSettingsPolicy targeting the HTTPRoute by default - it: "Render a ClientSettingsPolicy targeting the HTTPRoute by default"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -60,7 +60,7 @@ tests:
path: spec.body.maxSize path: spec.body.maxSize
value: 100m value: 100m
- it: should honor a custom targetRef - it: "Render a custom targetRef"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -81,7 +81,7 @@ tests:
path: spec.targetRef.name path: spec.targetRef.name
value: shared-gateway value: shared-gateway
- it: should fail when body is missing - it: "Fail when the body is missing"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -92,7 +92,7 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: gatewayAPI.nginx.clientSettingsPolicies.body is required errorMessage: gatewayAPI.nginx.clientSettingsPolicies.body is required
- it: should fail when body is an empty dict - it: "Fail when the body is an empty dict"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
+6 -6
View File
@@ -1,11 +1,11 @@
suite: Test Gateway API httpRoute.yaml suite: Test gateway API httpRoute
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/httpRoute.yaml - templates/httpRoute.yaml
tests: tests:
- it: should not render when gatewayAPI.enabled is false - it: "Skip rendering when gatewayAPI.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: false enabled: false
@@ -20,7 +20,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should not render when httpRoute.enabled is false - it: "Skip rendering when httpRoute.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -29,7 +29,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should render a single HTTPRoute with default rule - it: "Render a single HTTPRoute with the default rule"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -85,7 +85,7 @@ tests:
path: spec.rules[0].backendRefs[0].weight path: spec.rules[0].backendRefs[0].weight
value: 1 value: 1
- it: should fail when parentRefs missing - it: "Fail when the parentRefs are missing"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -98,7 +98,7 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: gatewayAPI.core.httpRoute.parentRefs is required errorMessage: gatewayAPI.core.httpRoute.parentRefs is required
- it: hostname tpl rendering - it: "Render the hostnames via tpl"
set: set:
global: global:
giteaHostName: gitea.tpl.example.com giteaHostName: gitea.tpl.example.com
+5 -5
View File
@@ -1,11 +1,11 @@
suite: Test Gateway API tcpRoute.yaml suite: Test gateway API tcpRoute
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/tcpRoute.yaml - templates/tcpRoute.yaml
tests: tests:
- it: should not render when gatewayAPI.enabled is false - it: "Skip rendering when gatewayAPI.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: false enabled: false
@@ -18,7 +18,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should not render when tcpRoute.enabled is false - it: "Skip rendering when tcpRoute.enabled is false"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -27,7 +27,7 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: should render a TCPRoute defaulting to the SSH service - it: "Render a TCPRoute defaulting to the SSH Service"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -67,7 +67,7 @@ tests:
path: spec.rules[0].backendRefs[0].weight path: spec.rules[0].backendRefs[0].weight
value: 1 value: 1
- it: should fail when parentRefs missing - it: "Fail when the parentRefs are missing"
set: set:
gatewayAPI: gatewayAPI:
enabled: true enabled: true
@@ -1,11 +1,11 @@
suite: GPG secret template (signing disabled) suite: Test gpg secret with signing disabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_gpg.yaml - templates/secret_gpg.yaml
tests: tests:
- it: renders nothing - it: "Skip rendering when signing is disabled"
set: set:
secrets.gpg.enabled: false secrets.gpg.enabled: false
asserts: asserts:
@@ -1,17 +1,17 @@
suite: GPG secret template (signing enabled) suite: Test gpg secret with signing enabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_gpg.yaml - templates/secret_gpg.yaml
tests: tests:
- it: fails rendering when nothing is configured - it: "Fail when no gpg key is configured"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: Either specify `secrets.gpg.new.privateKey` or reference an existing Secret via `secrets.gpg.existingSecret` errorMessage: Either specify `secrets.gpg.new.privateKey` or reference an existing Secret via `secrets.gpg.existingSecret`
- it: skips rendering using external secret reference - it: "Skip rendering when an existing Secret is referenced"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
secrets.gpg.existingSecret.enabled: true secrets.gpg.existingSecret.enabled: true
@@ -19,7 +19,7 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders secret specification using inline gpg key - it: "Render the Secret with an inline gpg key"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
secrets.gpg.new.privateKey: "gpg-key-placeholder" secrets.gpg.new.privateKey: "gpg-key-placeholder"
@@ -3,7 +3,7 @@ chart:
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
suite: Test ingress.yaml suite: Test ingress
templates: templates:
- templates/ingress.yaml - templates/ingress.yaml
tests: tests:
@@ -1,11 +1,11 @@
suite: Init template (basic) suite: Test init secret basics
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_init.yaml - templates/secret_init.yaml
tests: tests:
- it: renders a secret - it: "Render the Secret"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@@ -1,11 +1,11 @@
suite: Init template suite: Test init directory structure script
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_init.yaml - templates/secret_init.yaml
tests: tests:
- it: runs gpg in batch mode - it: "Run gpg in batch mode"
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -22,7 +22,7 @@ tests:
set -eu set -eu
gpg --batch --import "$TMP_RAW_GPG_KEY" gpg --batch --import "$TMP_RAW_GPG_KEY"
- it: skips gpg script block for disabled signing - it: "Skip the gpg script block when signing is disabled"
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
asserts: asserts:
@@ -42,7 +42,7 @@ tests:
mkdir -pv "${GITEA_TEMP}" mkdir -pv "${GITEA_TEMP}"
chown -v 1000:1000 "${GITEA_TEMP}" chown -v 1000:1000 "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}" chmod -v ug+rwx "${GITEA_TEMP}"
- it: adds gpg script block for enabled signing - it: "Add the gpg script block when signing is enabled"
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
secrets.gpg.enabled: true secrets.gpg.enabled: true
@@ -73,7 +73,7 @@ tests:
chmod -v 700 "${GNUPGHOME}" chmod -v 700 "${GNUPGHOME}"
chown -v 1000:1000 "${GNUPGHOME}" chown -v 1000:1000 "${GNUPGHOME}"
fi fi
- it: renders data, not stringData, so removed keys are pruned on upgrade - it: "Render data instead of stringData so removed keys are pruned on upgrade"
set: set:
deployment.gitea.image.rootless: false deployment.gitea.image.rootless: false
asserts: asserts:
@@ -1,11 +1,11 @@
suite: Init template suite: Test init directory structure script for the rootless image
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_init.yaml - templates/secret_init.yaml
tests: tests:
- it: runs gpg in batch mode - it: "Run gpg in batch mode"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |- secrets.gpg.new.privateKey: |-
@@ -21,7 +21,7 @@ tests:
set -eu set -eu
gpg --batch --import "$TMP_RAW_GPG_KEY" gpg --batch --import "$TMP_RAW_GPG_KEY"
- it: skips gpg script block for disabled signing - it: "Skip the gpg script block when signing is disabled"
asserts: asserts:
- equal: - equal:
path: data["init_directory_structure.sh"] path: data["init_directory_structure.sh"]
@@ -37,7 +37,7 @@ tests:
# prepare temp directory structure # prepare temp directory structure
mkdir -pv "${GITEA_TEMP}" mkdir -pv "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}" chmod -v ug+rwx "${GITEA_TEMP}"
- it: adds gpg script block for enabled signing - it: "Add the gpg script block when signing is enabled"
set: set:
secrets.gpg.enabled: true secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |- secrets.gpg.new.privateKey: |-
@@ -65,7 +65,7 @@ tests:
chmod -v 700 "${GNUPGHOME}" chmod -v 700 "${GNUPGHOME}"
chown -v 1000:1000 "${GNUPGHOME}" chown -v 1000:1000 "${GNUPGHOME}"
fi fi
- it: it does not chown /data even when image.fullOverride is set - it: "Skip the chown of /data even when image.fullOverride is set"
template: templates/secret_init.yaml template: templates/secret_init.yaml
set: set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.20.5 deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.20.5
@@ -84,7 +84,7 @@ tests:
# prepare temp directory structure # prepare temp directory structure
mkdir -pv "${GITEA_TEMP}" mkdir -pv "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}" chmod -v ug+rwx "${GITEA_TEMP}"
- it: renders data, not stringData, so removed keys are pruned on upgrade - it: "Render data instead of stringData so removed keys are pruned on upgrade"
asserts: asserts:
- notExists: - notExists:
path: stringData path: stringData
@@ -1,11 +1,11 @@
suite: Metrics secret template (monitoring disabled) suite: Test metrics secret with monitoring disabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: renders nothing if monitoring disabled and gitea.metrics.token empty - it: "Skip rendering when monitoring is disabled and gitea.metrics.token is empty"
set: set:
gitea.metrics.enabled: false gitea.metrics.enabled: false
gitea.metrics.serviceMonitor.enabled: false gitea.metrics.serviceMonitor.enabled: false
@@ -13,7 +13,7 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders nothing if monitoring disabled and gitea.metrics.token not empty - it: "Skip rendering when monitoring is disabled and gitea.metrics.token is not empty"
set: set:
gitea.metrics.enabled: false gitea.metrics.enabled: false
gitea.metrics.serviceMonitor.enabled: false gitea.metrics.serviceMonitor.enabled: false
@@ -1,11 +1,11 @@
suite: Metrics secret template (monitoring enabled) suite: Test metrics secret with monitoring enabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/secret_metrics.yaml - templates/secret_metrics.yaml
tests: tests:
- it: renders nothing if monitoring enabled and gitea.metrics.token empty - it: "Skip rendering when monitoring is enabled and gitea.metrics.token is empty"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
@@ -13,7 +13,7 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders Secret if monitoring enabled and gitea.metrics.token not empty - it: "Render the Secret when monitoring is enabled and gitea.metrics.token is not empty"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
@@ -3,7 +3,7 @@ chart:
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
suite: PVC template suite: Test persistentVolumeClaim
templates: templates:
- templates/persistentVolumeClaim.yaml - templates/persistentVolumeClaim.yaml
tests: tests:
@@ -3,11 +3,11 @@ chart:
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
suite: Storage class configuration tests suite: Test persistentVolumeClaim storage class
templates: templates:
- templates/persistentVolumeClaim.yaml - templates/persistentVolumeClaim.yaml
tests: tests:
- it: Set storageClassName when persistence.new.storageClassName is defined - it: "Render the storageClassName when persistence.new.storageClassName is defined"
set: set:
persistence.enabled: true persistence.enabled: true
persistence.new.storageClassName: my-storage-class persistence.new.storageClassName: my-storage-class
@@ -1,11 +1,11 @@
suite: Test route.yaml suite: Test route
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/route.yaml - templates/route.yaml
tests: tests:
- it: should create route when route.enabled is true - it: "Render the Route when route.enabled is true"
set: set:
route: route:
enabled: true enabled: true
@@ -50,7 +50,7 @@ tests:
path: spec.tls.insecureEdgeTerminationPolicy path: spec.tls.insecureEdgeTerminationPolicy
value: Redirect value: Redirect
- it: should not create route when route.enabled is false - it: "Skip rendering when route.enabled is false"
set: set:
route.enabled: false route.enabled: false
asserts: asserts:
@@ -1,4 +1,4 @@
suite: sshService / httpService template (Services configuration) suite: Test httpService and sshService configuration
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
@@ -6,7 +6,7 @@ templates:
- templates/service_ssh.yaml - templates/service_ssh.yaml
- templates/service_http.yaml - templates/service_http.yaml
tests: tests:
- it: supports adding custom labels to sshService - it: "Add custom labels to the SSH Service"
template: templates/service_ssh.yaml template: templates/service_ssh.yaml
set: set:
service: service:
@@ -18,7 +18,7 @@ tests:
path: metadata.labels["gitea/testkey"] path: metadata.labels["gitea/testkey"]
value: "testvalue" value: "testvalue"
- it: keeps existing labels (ssh) - it: "Keep the existing labels of the SSH Service"
template: templates/service_ssh.yaml template: templates/service_ssh.yaml
set: set:
service: service:
@@ -28,7 +28,7 @@ tests:
- exists: - exists:
path: metadata.labels["app"] path: metadata.labels["app"]
- it: supports adding custom labels to httpService - it: "Add custom labels to the HTTP Service"
template: templates/service_http.yaml template: templates/service_http.yaml
set: set:
service: service:
@@ -40,7 +40,7 @@ tests:
path: metadata.labels["gitea/testkey"] path: metadata.labels["gitea/testkey"]
value: "testvalue" value: "testvalue"
- it: keeps existing labels (http) - it: "Keep the existing labels of the HTTP Service"
template: templates/service_http.yaml template: templates/service_http.yaml
set: set:
service: service:
@@ -50,7 +50,7 @@ tests:
- exists: - exists:
path: metadata.labels["app"] path: metadata.labels["app"]
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer - it: "Render service.ssh.loadBalancerClass when the type is LoadBalancer"
template: templates/service_ssh.yaml template: templates/service_ssh.yaml
set: set:
service: service:
@@ -72,7 +72,7 @@ tests:
path: spec.loadBalancerSourceRanges path: spec.loadBalancerSourceRanges
value: ["1.2.3.4/32", "5.6.7.8/32"] value: ["1.2.3.4/32", "5.6.7.8/32"]
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass - it: "Skip the loadBalancer properties when the type is not LoadBalancer"
template: templates/service_http.yaml template: templates/service_http.yaml
set: set:
service: service:
@@ -91,7 +91,7 @@ tests:
- notExists: - notExists:
path: spec.loadBalancerSourceRanges path: spec.loadBalancerSourceRanges
- it: does not render loadBalancerClass by default even when type is LoadBalancer - it: "Skip loadBalancerClass by default even when the type is LoadBalancer"
template: templates/service_http.yaml template: templates/service_http.yaml
set: set:
service: service:
@@ -105,7 +105,7 @@ tests:
path: spec.loadBalancerIP path: spec.loadBalancerIP
value: "1.2.3.4" value: "1.2.3.4"
- it: both ssh and http services exist - it: "Render both the SSH and the HTTP Service"
templates: templates:
- templates/service_ssh.yaml - templates/service_ssh.yaml
- templates/service_http.yaml - templates/service_http.yaml
@@ -3,7 +3,7 @@ chart:
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
suite: ServiceAccount template suite: Test serviceAccount
templates: templates:
- templates/serviceAccount.yaml - templates/serviceAccount.yaml
tests: tests:
@@ -1,27 +1,27 @@
suite: ServiceMonitor template (basic) suite: Test serviceMonitor basics
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/serviceMonitor.yaml - templates/serviceMonitor.yaml
tests: tests:
- it: skips rendering by default - it: "Skip rendering by default"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders default ServiceMonitor object with gitea.metrics.enabled=true - it: "Render the ServiceMonitor when gitea.metrics.enabled is true"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders default ServiceMonitor object with gitea.metrics.serviceMonitor.enabled=true - it: "Render the ServiceMonitor when gitea.metrics.serviceMonitor.enabled is true"
set: set:
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders defaults - it: "Render the default ServiceMonitor spec"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
@@ -45,7 +45,7 @@ tests:
path: spec.endpoints[0].scrapeTimeout path: spec.endpoints[0].scrapeTimeout
- notExists: - notExists:
path: spec.endpoints[0].tlsConfig path: spec.endpoints[0].tlsConfig
- it: renders custom scrape interval - it: "Render a custom scrape interval"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
@@ -58,7 +58,7 @@ tests:
- equal: - equal:
path: spec.endpoints[0].scrapeTimeout path: spec.endpoints[0].scrapeTimeout
value: 5s value: 5s
- it: renders custom tls config - it: "Render a custom tls config"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true gitea.metrics.serviceMonitor.enabled: true
@@ -1,11 +1,11 @@
suite: ServiceMonitor template (monitoring disabled) suite: Test serviceMonitor with monitoring disabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/serviceMonitor.yaml - templates/serviceMonitor.yaml
tests: tests:
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty - it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is empty"
set: set:
gitea.metrics.enabled: false gitea.metrics.enabled: false
gitea.metrics.token: "" gitea.metrics.token: ""
@@ -13,7 +13,7 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token not empty - it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is not empty"
set: set:
gitea.metrics.enabled: false gitea.metrics.enabled: false
gitea.metrics.token: "test-token" gitea.metrics.token: "test-token"
@@ -1,11 +1,11 @@
suite: ServiceMonitor template (monitoring enabled) suite: Test serviceMonitor with monitoring enabled
release: release:
name: gitea-unittests name: gitea-unittests
namespace: testing namespace: testing
templates: templates:
- templates/serviceMonitor.yaml - templates/serviceMonitor.yaml
tests: tests:
- it: renders unsecure ServiceMonitor if gitea.metrics.token nil - it: "Render an unsecured ServiceMonitor when gitea.metrics.token is nil"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.token: gitea.metrics.token:
@@ -24,7 +24,7 @@ tests:
path: spec.endpoints path: spec.endpoints
value: value:
- port: http - port: http
- it: renders unsecure ServiceMonitor if gitea.metrics.token empty - it: "Render an unsecured ServiceMonitor when gitea.metrics.token is empty"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.token: "" gitea.metrics.token: ""
@@ -43,7 +43,7 @@ tests:
path: spec.endpoints path: spec.endpoints
value: value:
- port: http - port: http
- it: renders secure ServiceMonitor if gitea.metrics.token not empty - it: "Render a secured ServiceMonitor when gitea.metrics.token is not empty"
set: set:
gitea.metrics.enabled: true gitea.metrics.enabled: true
gitea.metrics.token: "test-token" gitea.metrics.token: "test-token"
+83 -124
View File
@@ -924,23 +924,6 @@ extraContainers: []
# image: busybox # image: busybox
# command: [/bin/sh, -c, 'echo "Hello world"'] # command: [/bin/sh, -c, 'echo "Hello world"']
## @deprecated The preExtraInitContainers and postExtraInitContainers variables have been replaced by
## deployment.initContainers. Add an entry with a `container` key before or after the linked
## chart-managed init containers to achieve the same result.
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
extraInitVolumeMounts: []
## @deprecated The extraVolumeMounts variable has been split two:
## - deployment.gitea.volumeMounts
## - extraInitVolumeMounts
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
## @param extraVolumeMounts **DEPRECATED** Additional volume mounts for init containers and the Gitea main container.
extraVolumeMounts: []
# - name: postgres-ssl-vol
# readOnly: true
# mountPath: "/pg-ssl"
## @section Init ## @section Init
## @param initPreScript Bash shell script copied verbatim to the start of the init-container. ## @param initPreScript Bash shell script copied verbatim to the start of the init-container.
initPreScript: "" initPreScript: ""
@@ -1129,6 +1112,89 @@ gitea:
successThreshold: 1 successThreshold: 1
failureThreshold: 10 failureThreshold: 10
## @section CloudNativePG
# The CloudNativePG operator itself is not part of this chart. It must be installed cluster-wide beforehand:
# https://cloudnative-pg.io/documentation/current/installation_upgrade/
cloudnativePG:
## @param cloudnativePG.enabled Provision a CloudNativePG `Cluster` for Gitea. Requires the CloudNativePG operator to be installed in the cluster.
enabled: false
## @param cloudnativePG.annotations Annotations for the CloudNativePG `Cluster`.
## @param cloudnativePG.labels Additional labels for the CloudNativePG `Cluster`.
annotations: {}
labels: {}
## @param cloudnativePG.image.registry Image registry.
## @param cloudnativePG.image.repository Image repository.
## @param cloudnativePG.image.tag Image tag.
image:
registry: ghcr.io
repository: cloudnative-pg/postgresql
tag: "18.0"
## @param cloudnativePG.instances Number of PostgreSQL instances. Values greater than `1` provision a HA-ready cluster with streaming replication.
instances: 3
credentials:
## @param cloudnativePG.credentials.addSHASumAnnotation Add a pod annotation with the SHA sum of the credentials Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation).
addSHASumAnnotation: false
## @param cloudnativePG.credentials.database Name of the database to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret.
## @param cloudnativePG.credentials.username Name of the database owner to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret.
database: gitea
username: gitea
## @param cloudnativePG.credentials.existingSecret.enabled Use an already existing Secret instead of creating the credentials Secret.
## @param cloudnativePG.credentials.existingSecret.secretName Name of the already existing credentials Secret. Must be of type `kubernetes.io/basic-auth` and its `username` must match `cloudnativePG.credentials.username`.
## @param cloudnativePG.credentials.existingSecret.passwordKey Key of the password in the existing credentials Secret.
existingSecret:
enabled: false
secretName: ""
passwordKey: password
## @param cloudnativePG.credentials.new.annotations Annotations for the credentials Secret.
## @param cloudnativePG.credentials.new.labels Labels for the credentials Secret.
## @param cloudnativePG.credentials.new.password Password of the database owner.
new:
annotations: {}
labels: {}
password: gitea
## @param cloudnativePG.postgresql.parameters Custom PostgreSQL configuration parameters.
postgresql:
parameters: {}
## @param cloudnativePG.storage.size Size of the data volume.
## @param cloudnativePG.storage.storageClass Storage class of the data volume. Defaults to the cluster's default storage class.
storage:
size: 10Gi
storageClass: ""
## @param cloudnativePG.walStorage.enabled Store the write-ahead log on a dedicated volume.
## @param cloudnativePG.walStorage.size Size of the write-ahead log volume.
## @param cloudnativePG.walStorage.storageClass Storage class of the write-ahead log volume. Defaults to the cluster's default storage class.
walStorage:
enabled: false
size: 2Gi
storageClass: ""
## @param cloudnativePG.affinity Affinity for the PostgreSQL pods. CloudNativePG nests `nodeSelector` and `tolerations` below this key as well.
affinity: {}
## @param cloudnativePG.priorityClassName Priority class name for the PostgreSQL pods.
priorityClassName: ""
## @param cloudnativePG.monitoring.enablePodMonitor Create a `PodMonitor` for the CloudNativePG `Cluster`.
monitoring:
enablePodMonitor: false
## @param cloudnativePG.resources Kubernetes resources for the PostgreSQL containers.
resources: {}
## @param cloudnativePG.topologySpreadConstraints Topology spread constraints for the PostgreSQL pods.
topologySpreadConstraints: []
## @section valkey ## @section valkey
valkey: valkey:
## @param valkey.enabled Enable valkey standalone or replicated. ## @param valkey.enabled Enable valkey standalone or replicated.
@@ -1187,113 +1253,6 @@ valkey:
repository: oliver006/redis_exporter repository: oliver006/redis_exporter
tag: "" tag: ""
## @section PostgreSQL HA
postgresql-ha:
## @param postgresql-ha.enabled Enable PostgreSQL HA.
enabled: true
## @param postgresql-ha.global.postgresql.database Name for a custom database to create (overrides `auth.database`).
## @param postgresql-ha.global.postgresql.username Name for a custom user to create (overrides `auth.username`).
## @param postgresql-ha.global.postgresql.password Name for a custom password to create (overrides `auth.password`).
global:
postgresql:
database: gitea
password: gitea
username: gitea
## @param postgresql-ha.metrics.image.repository Image repository, eg. `bitnamilegacy/postgres-exporter`.
metrics:
image:
repository: bitnamilegacy/postgres-exporter
## @param postgresql-ha.postgresql.image.repository Image repository, eg. `bitnamilegacy/postgresql-repmgr`.
## @param postgresql-ha.postgresql.repmgrPassword Repmgr Password.
## @param postgresql-ha.postgresql.postgresPassword postgres Password.
## @param postgresql-ha.postgresql.password Password for the `gitea` user (overrides `auth.password`).
postgresql:
image:
repository: bitnamilegacy/postgresql-repmgr
repmgrPassword: changeme2
postgresPassword: changeme1
password: changeme4
## @param postgresql-ha.pgpool.adminPassword pgpool adminPassword.
## @param postgresql-ha.pgpool.image.repository Image repository, eg. `bitnamilegacy/pgpool`.
## @param postgresql-ha.pgpool.srCheckPassword pgpool srCheckPassword.
pgpool:
adminPassword: changeme3
image:
repository: bitnamilegacy/pgpool
srCheckPassword: changeme4
## @param postgresql-ha.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`).
service:
ports:
postgresql: 5432
## @param postgresql-ha.persistence.enabled Enable persistence.
## @param postgresql-ha.persistence.storageClass Persistent Volume Storage Class.
## @param postgresql-ha.persistence.size PVC Storage Request for PostgreSQL HA volume.
persistence:
enabled: true
storageClass: ""
size: 10Gi
## @param postgresql-ha.volumePermissions.image.repository Image repository, eg. `bitnamilegacy/os-shell`.
volumePermissions:
image:
repository: bitnamilegacy/os-shell
## @section PostgreSQL
postgresql:
## @param postgresql.enabled Enable PostgreSQL.
enabled: false
## @param postgresql.global.postgresql.auth.password Password for the `gitea` user (overrides `auth.password`).
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`).
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`).
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`).
global:
postgresql:
auth:
password: gitea
database: gitea
username: gitea
service:
ports:
postgresql: 5432
## @param postgresql.image.repository Image repository, eg. `bitnamilegacy/postgresql`.
image:
repository: bitnamilegacy/postgresql
primary:
## @param postgresql.primary.persistence.enabled Enable persistence.
## @param postgresql.primary.persistence.storageClass Persistent Volume storage class.
## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume.
persistence:
enabled: true
storageClass: ""
size: 10Gi
readReplicas:
## @param postgresql.readReplicas.persistence.enabled Enable PostgreSQL read only data persistence using PVC.
## @param postgresql.readReplicas.persistence.storageClass Persistent Volume storage class.
## @param postgresql.readReplicas.persistence.size PVC Storage Request for PostgreSQL volume.
persistence:
enabled: true
storageClass: ""
size: ""
## @param postgresql.metrics.image.repository Image repository, eg. `bitnamilegacy/postgres-exporter`.
metrics:
image:
repository: bitnamilegacy/postgres-exporter
## @param postgresql.volumePermissions.image.repository Image repository, eg. `bitnamilegacy/os-shell`.
volumePermissions:
image:
repository: bitnamilegacy/os-shell
# By default, removed or moved settings that still remain in a user defined values.yaml will cause Helm to fail running the install/update. # By default, removed or moved settings that still remain in a user defined values.yaml will cause Helm to fail running the install/update.
# Set it to false to skip this basic validation check. # Set it to false to skip this basic validation check.