Some checks failed
CI / build (push) Failing after 12s
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
57 lines
1.9 KiB
Markdown
57 lines
1.9 KiB
Markdown
# 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`.
|
|
|
|
```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.
|
|
|
|
```bash
|
|
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.
|
|
|
|
1. Open `MODULE.bazel` in the workspace root.
|
|
2. Find the `helm_deps` extension usage block.
|
|
3. Add the generated repository name to the `use_repo` list. The name is constructed as `helm_<repo_name>_<chart_name>` (replacing hyphens with underscores).
|
|
|
|
Example:
|
|
```python
|
|
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](../../k8s/configs/templates/README.md) for detailed instructions on creating the template and configuring path resolution.
|