This guide covers setting up your local environment, common development tasks, and CI workflows for contributing to the Perses Helm Charts repository.
Run make or make help to see all available targets with descriptions.
Tools are managed via Makefile.tools. They are installed to the local bin/ directory and pinned to specific versions.
make helm # Install Helm
make mdox # Install mdox (markdown formatter)
make clean-tools # Remove all installed toolsTool versions and CI environment variables (Kind, cert-manager) are centralized in .github/env.
make helm-lint # Run helm lint --strict on all charts
make helm-template # Render all chart templates
make helm-validate # Run both lint and templateUnit tests use the helm-unittest plugin. Tests live under charts/<chart>/unittests/ and validate template rendering without a cluster.
Run all unit tests:
make helm-unit-testRun unit tests for a single chart:
make helm-unit-test CHART=charts/perses-operatorThe plugin is installed automatically on first run. Tests cover deployment, services, RBAC, cert-manager, and conditional resources (webhook, metrics, ServiceMonitor).
The Makefile provides targets to spin up a Kind cluster, install cert-manager (required by the operator chart), deploy charts, and run Helm tests.
# 1. Create Kind cluster with cert-manager
make kind-create
# 2. Install a chart from local source
make helm-local-install CHART=charts/perses-operator
# 3. Verify resources
kubectl get deployment -n default | grep controller-manager
kubectl get svc -n default | grep perses-operator
kubectl get crd | grep perses
kubectl get certificate -n default
kubectl get issuer -n default
# 4. Run helm tests (bats integration tests)
bin/helm test perses-operator
# 5. Run unit tests (no cluster needed)
make helm-unit-test
# 6. Check test pod logs
kubectl logs perses-operator-test -n default
# 7. Uninstall the chart
make helm-local-uninstall CHART=charts/perses-operator
# 8. Tear down the cluster
make kind-deleteAlternatively, helm-test handles the full lifecycle (create cluster, install, test, cleanup):
make helm-test # All charts
make helm-test CHART=charts/perses-operator # Single chartThe chart-install-and-test workflow runs on every pull request that modifies files under charts/. It:
- Sets up a Kind cluster
- Installs cert-manager
- Runs
ct install --all(chart-testing: installs each chart and runshelm test) - Validates chart READMEs are up to date
When a new perses-operator version is released:
- Update
charts/perses-operator/Chart.yaml— setappVersionto the new operator version and bumpversion(chart version) - Update
charts/perses-operator/values.yaml— setmanager.image.tagto match the newappVersion - Run
make sync-crds— syncs CRDs from upstream (see below) - Update
charts/perses-operator/CHANGELOG.mdandartifacthub.io/changesinChart.yaml - Run
make update-helm-readme— regenerates README - Run
make helm-validateandmake helm-unit-test— validates and tests
The perses-operator CRDs in charts/perses-operator/templates/crd/ are sourced from the perses-operator repository (config/crd/bases/). The script at hack/sync-crds.sh follows the same pattern as the kube-prometheus-stack CRD updater -- it downloads each CRD individually and wraps it with the necessary Helm templating:
{{- if .Values.crd.enable }}conditional installhelm.sh/resource-policy: keepannotation (controlled bycrd.keep)cert-manager.io/inject-ca-fromannotation (controlled bycertManager.enable)- Webhook conversion block with templated service name/namespace (for CRDs with multiple versions)
Currently synced CRDs:
| Upstream file | Destination | Webhook |
|---|---|---|
perses.dev_perses.yaml |
perses.perses.dev.yaml |
yes |
perses.dev_persesdashboards.yaml |
persesdashboards.perses.dev.yaml |
yes |
perses.dev_persesdatasources.yaml |
persesdatasources.perses.dev.yaml |
no |
perses.dev_persesglobaldatasources.yaml |
persesglobaldatasources.perses.dev.yaml |
yes |
The script reads appVersion from charts/perses-operator/Chart.yaml to determine which release tag to download from.
make sync-crdsAfter syncing, always run make helm-validate to ensure the templates still render correctly, and review the diff to verify the Helm wrappers were applied properly.
Chart READMEs are auto-generated using helm-docs and formatted with mdox.
make update-helm-readmeThis runs helm-docs (via Docker) for each chart followed by mdox fmt to format all markdown files.
CI runs make update-helm-readme && make checkdocs to verify there are no uncommitted changes to markdown files after regeneration.
Use the # -- comment style in values.yaml so helm-docs picks up descriptions:
# -- Enable metrics endpoint
enable: trueEach chart has a README.md.gotmpl template that controls the generated README structure. Edit the template to change sections like prerequisites, install instructions, etc.
- Create the chart under
charts/<chart-name>/ - Add a
README.md.gotmpltemplate for helm-docs - Use
# --comments invalues.yamlfor value descriptions - Add helm integration tests under
templates/tests/ - Add helm unit tests under
unittests/and addunittests/to.helmignore - Run
make update-helm-readmeto generate docs and formatting - Update
.github/CODEOWNERSwith ownership - Update
renovate.jsonif the chart tracks anappVersionfrom a container image - Run
make helm-validate,make helm-unit-test CHART=charts/<chart-name>, andmake helm-test CHART=charts/<chart-name>to verify