Skip to content

fix(helm): make the cluster DNS domain configurable#2209

Open
shekhargit1912 wants to merge 3 commits into
kagent-dev:mainfrom
shekhargit1912:fix/configurable-cluster-domain
Open

fix(helm): make the cluster DNS domain configurable#2209
shekhargit1912 wants to merge 3 commits into
kagent-dev:mainfrom
shekhargit1912:fix/configurable-cluster-domain

Conversation

@shekhargit1912

Copy link
Copy Markdown

The chart hardcoded cluster.local when building in-cluster service URLs, so installs on clusters configured with a different DNS domain rendered unreachable addresses that had to be patched by hand after every upgrade.

Add a clusterDomain value (default cluster.local) and use it to build the A2A base URL, the nginx controller upstream, and the bundled PostgreSQL connection string. Existing installs are unaffected: when the value is unset the templates render exactly as before.

Fixes #1767

The chart hardcoded `cluster.local` when building in-cluster service URLs,
so installs on clusters configured with a different DNS domain rendered
unreachable addresses that had to be patched by hand after every upgrade.

Add a `clusterDomain` value (default `cluster.local`) and use it to build
the A2A base URL, the nginx controller upstream, and the bundled PostgreSQL
connection string. Existing installs are unaffected: when the value is unset
the templates render exactly as before.

Fixes kagent-dev#1767

Signed-off-by: shekhargit1912 <shekharchaugule302@gmail.com>
Copilot AI review requested due to automatic review settings July 11, 2026 16:40
@shekhargit1912 shekhargit1912 requested a review from a team as a code owner July 11, 2026 16:40
@github-actions github-actions Bot added the bug Something isn't working label Jul 11, 2026

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

Pull request overview

This PR makes the Kubernetes cluster DNS domain configurable in the Helm chart so in-cluster service URLs don’t assume cluster.local, addressing installs on clusters with a custom cluster-domain (Fixes #1767).

Changes:

  • Added a new clusterDomain value (defaulting to cluster.local) in values.yaml.
  • Updated helper templates to build the controller A2A base URL and nginx upstream authority using the configured cluster domain.
  • Updated the bundled PostgreSQL connection string template and added Helm unit tests covering custom clusterDomain.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
helm/kagent/values.yaml Introduces clusterDomain value and updates the documented default for controller.a2aBaseUrl.
helm/kagent/tests/ui-deployment_test.yaml Adds a test asserting UI internal backend URL uses the custom cluster domain.
helm/kagent/tests/controller-deployment_test.yaml Adds tests asserting A2A base URL and bundled Postgres URL incorporate the custom cluster domain.
helm/kagent/templates/controller-deployment.yaml Uses clusterDomain when constructing the bundled Postgres connection string.
helm/kagent/templates/_helpers.tpl Adds kagent.clusterDomain helper and switches URL helpers to use it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helm/kagent/templates/_helpers.tpl Outdated
A fully-qualified domain (`example.net.`) or a value with stray whitespace
rendered an empty DNS label into the service authority, producing URLs like
`...svc.example.net.:8083` that many HTTP clients reject.

Trim whitespace and surrounding dots, falling back to `cluster.local` when
nothing is left.

Signed-off-by: shekhargit1912 <shekharchaugule302@gmail.com>

@EItanya EItanya 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.

Rather than adding this, should we just remove the DNS domain completely. Usually just name.namespace will do the trick

@shekhargit1912

Copy link
Copy Markdown
Author

Rather than adding this, should we just remove the DNS domain completely. Usually just name.namespace will do the trick
@EItanya
Good point - short names resolve in-cluster via the resolv.conf search domains, so dropping the suffix would fix #1767 without any new config. Before I switch the PR over: are any of these three URLs (the A2A base URL, the nginx upstream authority, and the Postgres connection string) ever consumed outside the pod's DNS context, or do they all resolve strictly in-cluster? If they're all in-cluster, I'm happy to drop clusterDomain entirely and just use name.namespace.svc. Want me to rework it that way?

@EItanya

EItanya commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Rather than adding this, should we just remove the DNS domain completely. Usually just name.namespace will do the trick
@EItanya
Good point - short names resolve in-cluster via the resolv.conf search domains, so dropping the suffix would fix #1767 without any new config. Before I switch the PR over: are any of these three URLs (the A2A base URL, the nginx upstream authority, and the Postgres connection string) ever consumed outside the pod's DNS context, or do they all resolve strictly in-cluster? If they're all in-cluster, I'm happy to drop clusterDomain entirely and just use name.namespace.svc. Want me to rework it that way?

AFAIK they're all in cluster, cluster.local marks it that way.

@shekhargit1912

Copy link
Copy Markdown
Author

Rather than adding this, should we just remove the DNS domain completely. Usually just name.namespace will do the trick
@EItanya
Good point - short names resolve in-cluster via the resolv.conf search domains, so dropping the suffix would fix #1767 without any new config. Before I switch the PR over: are any of these three URLs (the A2A base URL, the nginx upstream authority, and the Postgres connection string) ever consumed outside the pod's DNS context, or do they all resolve strictly in-cluster? If they're all in-cluster, I'm happy to drop clusterDomain entirely and just use name.namespace.svc. Want me to rework it that way?

AFAIK they're all in cluster, cluster.local marks it that way.
@EItanya
Thanks for confirming! I'll rework the PR to drop clusterDomain entirely and switch the A2A base URL, nginx upstream, and Postgres host to the name.namespace.svc short form. That fixes the original issue on clusters with custom DNS domains without adding a new value. Will push the update shortl

Per review feedback, drop the configurable clusterDomain value and
instead build in-cluster URLs (A2A base URL, nginx upstream authority,
bundled Postgres connection string) with the `name.namespace.svc` short
form, which resolves correctly regardless of the cluster DNS domain.

Signed-off-by: shekhargit1912 <shekharchaugule302@gmail.com>
@shekhargit1912 shekhargit1912 force-pushed the fix/configurable-cluster-domain branch from aaebe1f to 592a63b Compare July 14, 2026 16:56
@shekhargit1912

Copy link
Copy Markdown
Author

AFAIK they're all in cluster, cluster.local marks it that way.

@EItanya
Thanks for confirming! Reworked as suggested - dropped clusterDomain entirely and switched the A2A base URL, nginx upstream, and bundled Postgres URL to the name.namespace.svc short form, so they resolve on any cluster regardless of its DNS domain. Tests updated accordingly

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Cluster domain assumed to be cluster.local in helmcharts etc

3 participants