Files
helm-gitea/.github/copilot-instructions.md
T
volker.raschekandCopilot e17a4e7a7b
changelog / changelog (push) Successful in 16s
check-and-test / check-and-test (push) Failing after 1m51s
refactor(ingress)!: skip the Ingress when the HTTP Service is disabled
An Ingress that points at a Service which the chart does not render is broken by definition: the backend reference
cannot resolve and the ingress controller reports the rule as unavailable. The render condition therefore now also
requires `service.http.enabled` and lives in the new `gitea.ingress.enabled` helper, so the same rule can be reused
by other templates instead of being duplicated.

The namespace is taken from `.Release.Namespace` again. The `namespace` value is not a documented chart parameter,
and letting a single resource opt out of the release namespace breaks `helm uninstall` and Argo CD pruning, because
neither tracks objects outside the release namespace.

The `ingress.className` default changes from an empty string to `nginx`. An empty class makes the cluster fall back
to the default IngressClass, which silently produces a different result per cluster; naming the controller the chart
is tested against makes the rendered output predictable.

The scattered ingress suites are consolidated into a single `unittests/helm/ingress/ingress.yaml` that pins the
release name, namespace and appVersion, as required by the testing conventions, and covers the enable/disable matrix,
annotations, labels, TLS and a custom HTTP port.

BREAKING CHANGE: The Ingress is no longer rendered when `service.http.enabled` is `false`. `ingress.className` now
defaults to `nginx` instead of the cluster's default IngressClass. The undocumented `namespace` value no longer
applies to the Ingress.

Co-authored-by: Copilot <copilot@github.com>
2026-09-13 20:20:00 +02:00

3.8 KiB

Gitea Helm Chart — Copilot Instructions

Project Overview

Kubernetes Helm chart for deploying Gitea. Uses Go/Helm templating (templates/), YAML values (values.yaml), and includes sub-charts for PostgreSQL, PostgreSQL-HA, Valkey, and Valkey-cluster.

Build & Test

make readme            # Regenerate README.md parameter table + lint
make unittests-helm    # Run Helm unit tests (helm-unittest plugin required)
make unittests-bash    # Run bash/bats script tests (requires git submodule init)
make unittests         # Both of the above

Always run make readme after changing values.yaml @param annotations. Always run make unittests-helm after changing templates or unit tests.

Conventions

values.yaml

  • Use ## @param path.to.key Description annotations for every user-facing value. These drive the auto-generated README parameter table.
  • Property ordering within a resource block: enabled, annotations, labels first, then type-specific fields.
  • Top-level keys are sorted alphabetically within their section group.
  • Use Helm Values pattern from renovatebot. Ensure that the attributes registry, repository and tag are available as part of the dict image. For example:
image:
  registry: docker.io
  repository: library/busybox
  tag: 0.1.0

Templates

  • Helm templates live in templates/gitea/. Helpers live in templates/_helpers.tpl.
  • Use camelCase for all files and variables (e.g httpRoute, backendTLSPolicy, gatewayAPI, statefulSet).
  • Use include "gitea.fullname" for naming resources.
  • Use fail for required-value validation with clear error messages referencing the full values path.
  • Ensure, that the attributes annotations, labels, name and namespace are alphabetically sorted.
  • Render all attributes, even if they are empty, to prevent drift in Argo CD. For example, labels must be rendered, while annotations are defined as yaml:"annotations,omitempty".
  • Use plural for *.tpl files, because they may contain functions for multiple resources of the same kind (e.g. _services.tpl for httpService.yaml or sshService.yaml, _backendTLSPolicies.tpl for backendTLSPolicy.yaml).
  • Use as prefix of YAML files the resource kind (e.g., deployment.yaml for Deployment resources). If there are multiple resources of the same kind, use a descriptive suffix (e.g., deployment_metrics.yaml for a Deployment related to metrics).

Unit Tests

  • Helm unit tests live in unittests/helm/ mirroring the template structure.
  • Test files are YAML using the helm-unittest format.
  • 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. 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.
  • Each unit test must explicitly set a custom namespace and release name, rather than relying on defaults.

Commits & PRs

  • Follow Conventional Commits for PR titles and commit messages (e.g. feat:, fix:, refactor:, docs:, style:).
  • See CONTRIBUTING.md for full PR requirements.
  • Explain in detail why a change is needed, not just what the change is. Include links to relevant issues, PRs, or external references.
  • Add co-authors for any contributions that are not your own. Use the Co-authored-by: trailer in the commit message.

Documentation

  • docs/ contains topic-specific guides (e.g. gateway-api.md, ha-setup.md).
  • README.md parameter tables are auto-generated — never edit them manually.