skip to content

What forms can the repository field of a Helm chart dependency take?

level: middleimportance: should knowfreq 52%

answer

  1. It answers where, not which
  2. A base URL, not an archive link
  3. One form leans on local configuration
  4. One form stops short of the chart name
  5. Blank means already sitting in charts/

basics

~20 s

A Helm dependency's repository can be an https chart-repository base URL, an oci:// registry path that Helm appends the chart name to, a file:// path to a chart in the same tree, an @name reference to a locally added repository, or empty when the chart is already vendored under charts/.

solid answer

~50 s

`repository` tells Helm where to obtain the chart named by `name`. The classic form is an `https://` **base URL of a chart repository** — Helm fetches that repository's `index.yaml`, finds the entry for `name`, picks the newest version satisfying the range and downloads it; you do not need to have run `helm repo add` for this to work. `@myrepo` (or `alias:myrepo`) instead points at a repository already added locally, which is how credentialed repositories are usually referenced. `oci://registry.example.com/charts` is a registry path **without** the chart name: Helm appends `name` and uses the version as the tag, and because there is no `index.yaml` it must list tags to resolve a range. `file://../shared-chart` points at a chart in the same source tree. An empty string means the chart is already vendored in `charts/` and Helm should not fetch anything.

code

yaml · 16 lines
yaml
dependencies:
  - name: ingress-controller
    version: "4.13.2"
    repository: https://charts.example.com/public
  - name: session-store
    version: "3.8.1"
    repository: oci://registry.example.com/charts
  - name: reranker-common
    version: "0.9.4"
    repository: "file://../reranker-common"
  - name: audit-sidecar
    version: "1.2.6"
    repository: "@platform"
  - name: legacy-metrics
    version: "0.3.1"
    repository: ""

go deeper

for a junior

Be able to recognise the two forms you will meet daily: a plain https chart-repository URL and an oci:// registry path. Knowing that the URL is the repository root rather than a link to the chart archive is enough at this level.

for a middle

Explain what Helm does with each form — fetching index.yaml for https, appending the chart name and using the version as a tag for oci://, copying a local directory for file:// — and why an empty repository means no fetch happens at all.

for a senior

Show judgment about reproducibility: which forms leave the chart resolvable on a clean CI runner, which depend on machine-local repository configuration or credentials, and how you keep a published chart from depending on a path only your monorepo has.

for a principal

Own the organisational choice of one distribution path — classic index-based repositories or an OCI registry — and the cost of a fleet of charts that mix the two, including who can list tags and how consumers outside your network resolve anything.

## What the field has to do Helm has to turn a dependency entry into an actual chart archive on disk. `name` and `version` say *which* chart; `repository` says *where the fetch happens*. Every form of the field is a different answer to that question, and each has a different failure mode when it is wrong. ## The classic chart repository: an https base URL A chart repository is nothing more than a web server hosting packaged `.tgz` charts plus an `index.yaml` that lists every chart, every version and the URL of each archive. When `repository` is `https://charts.example.com/public`, Helm fetches `index.yaml` from that base URL, looks for entries named `name`, chooses the highest version satisfying the constraint and downloads the archive the index points to. Two things surprise people. First, the URL is the **repository root**, not a link to a `.tgz` — pointing it at a file is a common and confusing error. Second, you do **not** need `helm repo add` for a dependency: the entry carries the location, so resolution works on a fresh machine or a clean CI runner with no local repository configuration at all. `helm repo add` matters for interactive searching and for repositories that need credentials. ## Referencing a locally added repository: @name `repository: "@platform"` (equivalently `alias:platform`) means "the repository this machine knows locally as `platform`". This is the form to use when the repository needs a username, password or a private CA, because those settings live with the locally added repository rather than in the chart. The trade-off is that the chart is no longer self-contained: anyone resolving it — including a CI runner — must have added a repository under exactly that name first, or resolution fails with nothing to look in. ## An OCI registry: oci:// `repository: oci://registry.example.com/charts` names a **registry path, not the chart**. Helm appends `name` to it and treats the chart version as the tag, so the entry above with `name: session-store` and version `3.8.1` resolves to `registry.example.com/charts/session-store` at tag `3.8.1`. Writing the chart name into the path — `oci://registry.example.com/charts/session-store` — is the classic mistake and produces a doubled path. There is no `index.yaml` in a registry, so range resolution works by listing the tags the registry exposes; if a range must be resolved, both listing permission and sane tag hygiene matter, and pinning an exact version sidesteps the issue entirely. OCI chart support has been generally available since Helm 3.8, and the old `HELM_EXPERIMENTAL_OCI` environment variable has not been needed since — writing it in 2026 dates your answer badly. ## A chart in the same source tree: file:// `repository: "file://../reranker-common"` points at a chart directory relative to the parent chart's own directory. This is how a monorepo shares an internally developed chart without publishing it anywhere. Resolution copies the local chart into `charts/`, so once the parent is packaged the archive is self-contained; but nothing checks that a `file://` dependency exists for someone who cloned only part of the tree, and a published chart that still expects a sibling directory is a broken chart. ## Empty or omitted An empty `repository` means the chart is expected to be present already under the parent's `charts/` directory — typically because someone committed the archive there deliberately. Helm makes no attempt to fetch it. This form is honest for a truly vendored subchart and confusing everywhere else, because the entry looks like a dependency that nobody can obtain. ## Choosing between them For charts you consume from outside, an `https://` base URL keeps the chart self-contained and reproducible on any machine. Use `@name` only when credentials force you to, and document which repository name must exist. Use `oci://` when your organisation has standardised on a registry for charts as well as images, remembering the path is the namespace and not the chart. Use `file://` for charts that genuinely live and version together in one tree, and reach for an empty `repository` only when you mean "this is vendored and stays vendored". ## What interviewers listen for The distinction between a repository *location* and a locally added repository *name*; that an https entry needs no `helm repo add`; and that an `oci://` reference stops one path segment short of the chart. Those three points tell an interviewer you have actually wired dependencies rather than copied an example.

  • Does a dependency on an https chart repository require helm repo add first?
    No. The entry carries the repository location, so Helm fetches that repository's `index.yaml` directly and resolution works on a clean machine with no repositories configured. `helm repo add` is needed for interactive search, and for repositories requiring credentials or a private CA — which is precisely when you switch the entry to the `@name` form so the credentials live locally instead of in the chart.
  • A dependency sets name: session-store and repository: oci://registry.example.com/charts/session-store. What goes wrong?
    Helm appends the chart name to the repository path, so it looks for `registry.example.com/charts/session-store/session-store` and finds nothing. For OCI, `repository` is the namespace that *contains* the chart, one segment short of it. The fix is to drop the trailing chart name from the path and leave `name` to supply it.
  • Why can a file:// dependency be fine in a monorepo but broken for a consumer?
    `file://` is resolved relative to the parent chart's directory, so it only works for someone holding both directories. Once the parent is packaged the subchart travels inside the archive, so consumers of the package are fine — but anyone resolving dependencies from the source tree alone, such as a CI job that checked out a sparse subset, has nothing to copy from.

saying these in an interview costs you the question

  • Pointing repository at a .tgz file instead of the repo root
  • Claiming every dependency needs helm repo add first
  • Including the chart name in an oci:// repository path
  • Saying oci:// is experimental or needs HELM_EXPERIMENTAL_OCI
  • Assuming an empty repository makes Helm search all repos
  • Treating file:// paths as relative to the working directory

context