|
|
||
|---|---|---|
| .. | ||
| BUILD | ||
| chartfile.lock.json | ||
| chartfile.yaml | ||
| README.md | ||
Helm Charts Management
This directory contains the definition of third-party Helm charts used in the repository.
Adding or Updating a Chart
The process to add or update a Helm chart involves three main steps: editing the definition, syncing the lockfile, and registering the repository in Bazel.
1. Edit chartfile.yaml
Add the chart repository (if not already present) and the chart dependency to third_party/helm/chartfile.yaml.
repositories:
- name: crossplane
url: https://charts.crossplane.io/master/
requires:
- chart: crossplane/crossplane
version: 1.10.0
2. Sync the Lockfile
Run the helm_sync tool via Bazel to resolve the chart versions and update chartfile.lock.json.
Note: Currently, the script requires absolute paths to the files.
bazel run //tools:helm_sync -- $(pwd)/third_party/helm/chartfile.yaml $(pwd)/third_party/helm/chartfile.lock.json
This will fetch the indices, resolve the specific version/digest, and write to chartfile.lock.json.
3. Register in MODULE.bazel
Crucial Step: The new chart repository is not automatically visible to the build system. You must explicitly register it.
- Open
MODULE.bazelin the workspace root. - Find the
helm_depsextension usage block. - Add the generated repository name to the
use_repolist. The name is constructed ashelm_<repo_name>_<chart_name>(replacing hyphens with underscores).
Example:
helm_deps = use_extension("//tools:helm_deps.bzl", "helm_deps")
use_repo(
helm_deps,
"helm_jetstack_cert_manager",
"helm_crossplane_crossplane", # Added this line
)
Using the Chart
Once the chart is added and registered, you can wrap it in a Jsonnet template.
See k8s/configs/templates/README.md for detailed instructions on creating the template and configuring path resolution.