Skip to content

feat(chart): add hostAliases value - #6588

Open
jetersen wants to merge 2 commits into
kubernetes-sigs:masterfrom
jetersen:feat/chart-host-aliases
Open

feat(chart): add hostAliases value#6588
jetersen wants to merge 2 commits into
kubernetes-sigs:masterfrom
jetersen:feat/chart-host-aliases

Conversation

@jetersen

Copy link
Copy Markdown

What does it do ?

Exposes the Pod's hostAliases field as a chart value, rendered into the Deployment alongside the existing dnsPolicy and dnsConfig. Defaults to [], so the rendered Pod is unchanged unless the value is set.

Motivation

external-dns sometimes has to reach a provider or webhook by a hostname that cluster DNS cannot resolve.

The case I hit: a UniFi controller whose API serves a publicly-trusted certificate issued for its hostname, with no IP SAN — and no public CA will issue one for an RFC1918 address. That leaves two bad options. Addressing it by IP means disabling certificate verification and sending an API key over an unverified connection. Addressing it by hostname means depending on the very DNS records external-dns is responsible for publishing, which deadlocks on a fresh cluster.

hostAliases resolves this cleanly: the hostname is pinned in the pod's /etc/hosts, consulted before any resolver, so TLS verifies against the real certificate with no DNS dependency. The same applies to any on-premises provider or webhook reachable only via a hostname that isn't in cluster DNS.

The chart renders a fixed allowlist of pod fields, so there is currently no way to set this — dnsConfig cannot map a name to an address, and a post-renderer is the only workaround.

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

values.schema.json and README.md were regenerated with scripts/helm-tools.sh --schema and --docs. helm unittest passes (83 tests, including two new cases covering the default and configured behaviour).

Expose the `Pod`'s `hostAliases` field so entries can be injected into
`/etc/hosts`. This is useful when external-dns must reach a provider or
webhook by a hostname that cannot be resolved by cluster DNS -- for example
an on-premises provider whose TLS certificate is issued for a hostname with
no IP SAN, where addressing it by IP would forgo certificate verification
and addressing it by name would depend on the very records external-dns is
responsible for publishing.

The chart renders a fixed set of pod fields and already exposes the
neighbouring `dnsPolicy` and `dnsConfig`, so this follows the same pattern.
Defaults to an empty list, leaving the rendered `Pod` unchanged.

Signed-off-by: Joseph Petersen <jop@moviestarplanet.com>
Copilot AI review requested due to automatic review settings July 27, 2026 23:34
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stevehipwell for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested a review from vflaux July 27, 2026 23:34
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 27, 2026
@kubernetes-prow

Copy link
Copy Markdown

Welcome @jetersen!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 27, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @jetersen. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 27, 2026
Signed-off-by: Joseph Petersen <jop@moviestarplanet.com>

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mloiseleur

Copy link
Copy Markdown
Collaborator

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 28, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 30314581549

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 81.131%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 21273
Covered Lines: 17259
Line Coverage: 81.13%
Coverage Strength: 732.35 hits per line

💛 - Coveralls

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

Labels

chart cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants