Skip to content

HIP: Helm support Container Tools configuration (auth.json, registries.conf, etc) for OCI registry access management - #391

Open
gjenkins8 wants to merge 1 commit into
helm:mainfrom
gjenkins8:gjenkins/registries.conf_support
Open

gjenkins8 wants to merge 1 commit into
helm:mainfrom
gjenkins8:gjenkins/registries.conf_support

Conversation

@gjenkins8

Copy link
Copy Markdown
Member

No description provided.

@gjenkins8
gjenkins8 force-pushed the gjenkins/registries.conf_support branch from 99c6d56 to cea4a1d Compare February 27, 2025 15:54

@mtrmac mtrmac left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some drive-by notes.

Comment thread hips/hip-XXXX.md Outdated
Comment on lines +50 to +54
```toml
# registries.conf
[[registry]]
prefix = "oci.example.com"
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In registries.conf, it’s not necessary to add a no-op entry for a registry. (In fact it’s currently somewhat annoying to do, although that would probably be best fixed in the parser package.)

Comment thread hips/hip-XXXX.md
```

```json
# auth.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better or worse, auth.json is intentionally placed into tmpfs filesystems cleared on reboot. (The tools may read other locations in the home directory, but they, without specific instruction otherwise, don’t update them.)

That might be a fairly disruptive change to users of “login”, so it probably should be discussed as such.

Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Outdated

Including support for repository prefixes (allowing different credentials for different prefixes), registry mirrors, and registry "aliasing". Features Helm would like to introduce. But is currenly blocked by a lack of mechanism to store detail

(in particular, the existing registry configuration Helm uses, Docker’s `$HOME/.docker/config.json`, etc do not support registry aliases nor prefixes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is do not support registry aliases nor prefixes the only limitation of Docker’s $HOME/.docker/config.json? I would expect that this proposal could clarify more on the problems and limitations here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FeynmanZhou are there other limitations you want to highlight?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what limitations @FeynmanZhou is referring to, but one limitation this may or may not address is namespaced auth. Like with Harbor, you might have one credential for oci://localhost/production and another for oci://localhost/development and config.json as I recall only supports auth at the domain level.

Comment thread hips/hip-XXXX.md Outdated
## Specification

Helm will utilize the `registries.conf` specification when determinging OCI registry information (authentication credentials, etc):
<https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to reference a versioned link instead of main branch in case the link is broken in the main branch

Comment thread hips/hip-XXXX.md Outdated

## Open issues

- Support for registies.conf in ORAS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use ORAS for this, do we need to get agreement from them before this moves forward?

@FeynmanZhou FeynmanZhou Mar 13, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mattfarina ,

@sabre1041 brought up this proposal to the ORAS community meeting on Mar 5. There is also a GitHub issue tracked in oras-go oras-project/oras-go#918.

As this is a dependency for ORAS from Helm v4, what's the expected timeline to getregisties.conf supported in oras-go?

Comment thread hips/hip-XXXX.md Resolved

@scottrigby scottrigby left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of supporting this in Helm.

We may want to note in this HIP that registry aliases would help with airgapped environments—an important use case for Helm users—where an in-cluster registry would replace external registries defined as the storage for chart dependencies.

There are existing means in Helm to overwrite a registry for container images in airgap—many charts make images/oci registries configurable, but even if they do not, this can be done with a post-renderer. However, there is currently no way to do this with the repository specified by chart dependencies without manually manipulating the Chart.yaml.

@scottrigby

Copy link
Copy Markdown
Member

Note that the Podman tools that standardize registries.conf have been accepted as a CNCF Sandbox project: cncf/sandbox#309

@scottrigby

Copy link
Copy Markdown
Member

Also note this related issue: helm/helm#13615

@gjenkins8
gjenkins8 force-pushed the gjenkins/registries.conf_support branch from 07c67e8 to 1f6c412 Compare November 3, 2025 22:47
@gjenkins8 gjenkins8 changed the title H4HIP: Helm support registries.conf for OCI configuration/auth info Helm support registries.conf for OCI configuration/auth info Nov 3, 2025
@gjenkins8
gjenkins8 force-pushed the gjenkins/registries.conf_support branch from 1f6c412 to 6335ac4 Compare November 3, 2025 22:59
@gjenkins8
gjenkins8 marked this pull request as ready for review November 3, 2025 23:00
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Outdated
- registry mirrors
- registry "aliasing"—features

Helm would like to introduce features depending on these functionalities. Supporting `registries.conf` would enable them without Helm having to create or implement its own mechanisms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Helm would like to introduce features depending on these functionalities. Supporting `registries.conf` would enable them without Helm having to create or implement its own mechanisms.
Helm would like to introduce features leaning upon these functionalities. Supporting `registries.conf` would enable them without Helm having to create or implement its own mechanisms.

Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Outdated

`registries.conf` was picked as being a format intended for consumption beyond the Docker application container ecosystem.

ORAS (the library Helm uses for supporting OCI functionality) has planned support for `registries.conf` client-side OCI registry management.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include reference(s) to the ORAS specific features?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a TODO, need to go grab the link

Comment thread hips/hip-XXXX.md Outdated
Helm will utilize the `registries.conf` specification when determining OCI registry information (authentication credentials, etc.):
<https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md>

`registries.conf` will be preferred either when a `registries.conf` file already exists on the user's system, or when Helm supports and a user utilizes functionality that cannot be supported by Docker's configuration file in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we indicate where we will search for entries?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the file lookup specifications.

TODO: is whether we want to follow the same tmpfs pattern for linux systems as the specification

Comment thread hips/hip-XXXX.md Outdated
}
```

Helm will use ORAS v3 for updating (and reading) `registries.conf` (TODO: link to ORAS v3 `registries.conf` implementation).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call out the fact that ORAS v3 development has yet to begin as of this date

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't characterize it as hasn't begun. An oras-go v2 branch was cut and there are several PRs out for v3. Nothing has merged though.

Comment thread hips/hip-XXXX.md Outdated

To account for existing configuration in Docker’s registry configuration, Helm will prefer `registries.conf` when resolving OCI registries (including credentials), and fall back to the existing storage mechanism if `registries.conf` does not contain an entry for the required OCI registry (including if `registries.conf` does not exist).

Helm must expect (and even encourage) users to utilize other tooling to manage `registries.conf`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or at least provide some form of guidance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite following?

Do you mean guidance on using other tools to manage? (if so, I think this is a detail we can leave for docs)

Comment thread hips/hip-XXXX.md Outdated

1. A corrupt `registries.conf` will cause an error for existing workflows
2. An invalid or incompatible with Helm `registries.conf` entry for the given OCI registry will cause the user's workflow to fail
3. Helm’s preference for `registries.conf` will break users who assume credentials are stored in Docker’s registry configuration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to include an explicit option to opt out of the feature and fall back. That way, we are covered for all scenarios

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added an HELM_EXPERIMENTAL_OCI_CONTAINERS_CONFIG feature flag.

The goal (as written into the HIP) is for this to become default true. The alternative is a permanent feature flag style config (cli flag or environment var). I think we should only introduce such iff we think (from user feedback and implementation) that introducing Container Tools config support can't be done in a non-intrusive/non-backwards compatible manner.

Comment thread hips/hip-XXXX.md
"auth": "Zm9vOmJhcgo="
}
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to mention policy.json around here since that is used for allow/deny?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess along these lines, hopefully certs.d would be supported. That could be out of the scope for this document though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I want to focus this HIP on initial registries.conf/auth.json support (ie. feature parity and switch over from Docker conf).

And leave extending to support future functionality to either:

  1. ORAS improvements
  2. Explicit HIPs for additional Helm behavior changes

Comment thread hips/hip-XXXX.md Outdated
}
```

Helm will use ORAS v3 for updating (and reading) `registries.conf` (TODO: link to ORAS v3 `registries.conf` implementation).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't characterize it as hasn't begun. An oras-go v2 branch was cut and there are several PRs out for v3. Nothing has merged though.

Comment thread hips/hip-XXXX.md
Helm's fallback to Docker's registry configuration ensures the vast majority of existing user workflows remain the same.

However, there are three potential incompatibility scenarios:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is another possibility here where the user doesn't have a registries.conf but has a auth.json My understanding is the registries.conf is not required.

@gjenkins8 gjenkins8 Nov 7, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, when I originally wrote this, I thought registries.conf was always paired with auth.json.

https://github.com/helm/community/pull/391/files#r1978339008 mentions the same

I have (significantly) reworked the language to include auth.json. Strictly, auth.json is all that is needed to replace docker/config.json. But the overall motivation is to be able to utilize features implemented by registries.conf.

Comment thread hips/hip-XXXX.md

`auth.json`:

1. Location specified in environment variable `REGISTRY_AUTH_FILE` if set

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjenkins8 gjenkins8 changed the title Helm support registries.conf for OCI configuration/auth info Helm support Container Tools project (auth.json, registries.conf, etc) for OCI configuration/auth info Nov 12, 2025
@gjenkins8 gjenkins8 changed the title Helm support Container Tools project (auth.json, registries.conf, etc) for OCI configuration/auth info Helm support Container Tools configuration (auth.json, registries.conf, etc) for OCI registry access management Nov 15, 2025
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Outdated
Pertainently including [registries.conf][registries-conf], [auth.json][auth-json], as well as the other specifications in <https://github.com/containers/container-libs/blob/main/image/docs/>.

This HIP focuses on the initial implementation using ORAS to supports Container Tools OCI registry mamagement to supersede `docker/config.json` within Helm.
Today, `auth.json` provides the equivalent functionality to `docker/config.json` for storing OCI registry credentials.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while maintianing backward compatibility since it supports .docker/config.json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean auth.json is a compatible subset of .docker/config.json ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at this point there there are extensions in both formats not understood by the other. But the basic use case of storing per-registry credentials works compatibly.

Comment thread hips/hip-XXXX.md

- ORAS `registries.conf` support: <https://github.com/oras-project/oras-go/issues/918>
- Is the release and backwards compatibility plan good enough?
- ~~Discuss Helm's/ORAS's potential usage of `registries.conf` with `registries.conf` owners~~

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are on board with the idea, but the timeline for release I do not know.

@TerryHowe

Copy link
Copy Markdown

looks good in general, my comments are nits really.

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more final changes. Looking really good

Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md
1. `$HOME/.config/containers/registries.conf` if it exists
2. Otherwise `/etc/containers/registries.conf`

Helm will use ORAS v3 for updating (and reading) `registries.conf` / `auth.json`, working with the ORAS project to build support.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to note that ORAS v3 is a future milestone for that project?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
Comment thread hips/hip-XXXX.md Resolved
@scottrigby scottrigby changed the title Helm support Container Tools configuration (auth.json, registries.conf, etc) for OCI registry access management HIP: Helm support Container Tools configuration (auth.json, registries.conf, etc) for OCI registry access management Feb 12, 2026

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Comment thread hips/hip-XXXX.md
<https://github.com/containers/container-libs/blob/main/image/docs/containers-auth.json.5.md>
<https://github.com/containers/container-libs/blob/main/image/docs/containers-registry.conf.json.5.md>

Helm will write to `auth.json` when performing OCI registry operations that modify client OCI registry configuration (e.g., `helm registry login`). And as long as the operation can be supported by `.docker/config.json`, Helm will dual-write to `.docker/config.json` for compatibility purposes. Dual-write will be removed in a future version of Helm, and Helm will write only to `auth.json`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the write target for helm registry login in a way that looks materially user-visible on Linux. Per containers-auth.json(5), the primary read/write file is ${XDG_RUNTIME_DIR}/containers/auth.json, which is typically session-scoped/tmpfs-backed, while persistent files under $HOME are fallback read-only locations unless the application explicitly overrides them.

Once dual-write is removed, a successful helm registry login may stop surviving reboot or session restart, which is a regression from current Helm behavior with .docker/config.json. I think the HIP needs to call this out explicitly in compatibility/migration terms and either justify it as intended behavior or define a different persistence strategy.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. One alternative might be to have a feature gate to enable the new way and skip the dual write.

Comment thread hips/hip-XXXX.md
Comment on lines +79 to +81
If reading a registry configuration from `registries.conf` or `auth.json` results in a configuration that Helm does not support, Helm must ignore that entry (e.g., a `location` field or non-empty URI path).
As ORAS gains support for additional `registries.conf`, `auth.json`, etc features, Helm will also gain support for these features.
Helm must ensure these features do not break backwards compatibility guarantees.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "ignore that entry" is the right failure mode when Helm finds a matching config entry that expresses behavior Helm does not implement. If a user/admin configured location, mirrors, or another matching registry rule, silently skipping it can cause Helm to fall through to the original upstream registry instead of honoring the intended policy/routing. In air-gapped, compliance, or rate-limit-driven environments, that is worse than failing fast.

Would it make more sense to error on a matching-but-unsupported entry, while continuing to ignore only clearly irrelevant non-matching entries?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the spec said to ignore unknown fields. I brought up some issues it may have been in the spec repo because I wanted to add fields to the spec and I was told I could do whatever I wanted protentially because other parsers should skip unknown fields.

I think we should skip unknown fields, but of course fail for other parse issues

Comment thread hips/hip-XXXX.md

Helm will write to `auth.json` when performing OCI registry operations that modify client OCI registry configuration (e.g., `helm registry login`). And as long as the operation can be supported by `.docker/config.json`, Helm will dual-write to `.docker/config.json` for compatibility purposes. Dual-write will be removed in a future version of Helm, and Helm will write only to `auth.json`.

Helm will use the same filepath ordering when searching for matching OCI entries in `registries.conf` and credentials in `auth.json` as described in the respective specifications.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says Helm will use "the same filepath ordering ... as described in the respective specifications", but the text below only enumerates the primary registries.conf locations. The registries.conf spec family also includes drop-in layering via registries.conf.d, which is commonly how system/vendor overrides are shipped. I think the HIP should either include the full search/load behavior here or narrow this claim, otherwise the compatibility statement is stronger than the specified behavior.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW the registries.conf lookup order / semantics is likely to change soon, podman-container-tools/podman#27657 is the approximate plan.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying oras-go code should and will follow the current approach and it might be nice to also support thisnew approach. I think it would be best if Helm did the same.

@TerryHowe

Copy link
Copy Markdown

DCO

@gjenkins8
gjenkins8 force-pushed the gjenkins/registries.conf_support branch from c1717df to 0e33bbe Compare June 1, 2026 14:39
@joejulian

Copy link
Copy Markdown

@gjenkins8 @sabre1041 this HIP and helm/helm#32065 have moved apart. I'd like to bring them back together so both can land.

This HIP limits itself to auth.json/registries.conf parity. It leaves policy.json, certs.d and signing to "explicit HIPs." #32065 implements all of those: policy.json enforcement, registries.d signature verification, and certs.d. The gate names also differ: here it is HELM_EXPERIMENTAL_OCI_CONTAINERS_CONFIG, in the PR it is HELM_EXPERIMENTAL_CONTAINERS_CONFIG. I see two ways forward:

  1. Extend this HIP to cover the trust features (policy enforcement and signature verification), with their own security and compatibility sections, or
  2. Keep this HIP as it is, and have #32065 implement only what it describes. The trust features then come later with their own HIP.

I lean slightly toward (2) because it keeps each decision small. I am fine with (1) if the trust features are fully described.

Open points from my March review. The current text does not address these yet. I'd like to see them resolved before I approve:

  • Unsupported entries. I think @TerryHowe and I agree, and the text only needs to state the difference. Skip unknown fields, as the spec says. Return an error when a matching entry asks for behavior Helm does not implement (location, mirrors, a path prefix). If Helm skips a matching rule, it silently contacts the registry the admin redirected away from. That conflicts with this HIP's own rejected idea about silent fallback.
  • Login persistence. On Linux, the spec's write target is ${XDG_RUNTIME_DIR}/containers/auth.json, which is tmpfs. Dual-write hides this today. After dual-write is removed, helm registry login no longer survives a reboot. I'd like the Backwards compatibility section to name this and pick an answer: a persistent write path, keep dual-write, or accept the change as intended in v5.
  • Lookup order. The text promises "the same filepath ordering as the specifications," but it does not list registries.conf.d. @mtrmac says the lookup semantics will change ([Design Doc] config file parsing changes for podman 6 podman-container-tools/podman#27657). I suggest that the HIP lists the exact paths Helm reads, and does not promise to follow the spec as it changes.

Smaller items:

  • Change "Potentially requiring Helm v5" for the default flip to "requires Helm v5." The gate can still graduate as opt-in in v4.
  • Name the RHEL/Fedora case in Backwards compatibility. With the gate on, the shipped signedBy rules for registry.redhat.io reject unsigned charts. It is a real example of system config breaking an existing workflow (if the HIP takes the policy.json scope).
  • registries.conf paths on Windows and macOS.
  • Update the Reference implementation section (oras-go v3.0.0, #32065) and Open issues (oras-go#918).
  • The login example uses registry.example.com but writes registry.example.com/theprefix.

Overall, I like this direction. It reuses a CNCF spec and does not invent a Helm format, and Helm reads this config without taking ownership of it. With these points resolved, I'll approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants