Skip to content

[system] Fix monitoring-agents FQDN resolution for tenant workload clusters - #2075

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/monitoring-agents-fqdn-cluster-domain
Feb 20, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/monitoring-agents-fqdn-cluster-domain

Conversation

@IvanHunters

@IvanHunters IvanHunters commented Feb 19, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

Monitoring agents (vmagent, fluent-bit) in tenant workload clusters failed to deliver metrics and logs because service addresses used short DNS names (e.g. vminsert-longterm.tenant-root.svc) without the cluster domain suffix. Tenant CoreDNS could not resolve these names across cluster boundaries.

This PR appends the configured cluster domain from _cluster.cluster-domain to all vmagent remoteWrite URLs and fluent-bit output hosts, with a fallback to cluster.local when not set.

Release note

[system] Fix monitoring-agents endpoints to use FQDN with configured cluster domain, resolving metrics and logs delivery failures in tenant workload clusters.

Summary by CodeRabbit

  • Chores
    • Enhanced monitoring configuration to support customizable cluster-domain values with automatic fallback to cluster.local default.

…logs endpoints

Monitoring agents in tenant workload clusters failed to deliver metrics
and logs because service addresses used short DNS names without the
cluster domain suffix. Tenant CoreDNS could not resolve these names
across cluster boundaries.

Append the configured cluster domain from _cluster.cluster-domain to
all vmagent remoteWrite URLs and fluent-bit output hosts, falling back
to cluster.local when not set.

Signed-off-by: IvanHunters <[email protected]>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello IvanHunters, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves critical issues with monitoring agents in tenant workload clusters failing to deliver metrics and logs. By modifying the configuration to include the full cluster domain in service addresses, it ensures proper DNS resolution across cluster boundaries, thereby restoring the functionality of vmagent and fluent-bit for data collection.

Highlights

  • FQDN Resolution Fix: Monitoring agents (vmagent, fluent-bit) in tenant workload clusters now correctly resolve service addresses by appending the configured cluster domain or falling back to 'cluster.local'. This addresses previous failures where agents could not deliver metrics and logs due to incomplete DNS names.
  • Configuration Update: The values.yaml file for monitoring agents has been updated to include the cluster domain suffix in vmagent remoteWrite URLs and fluent-bit output hosts, ensuring full qualified domain names are used for inter-cluster communication.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/system/monitoring-agents/values.yaml
    • Updated vmagent remoteWrite URLs to include the cluster domain suffix for FQDN resolution.
    • Modified fluent-bit output hosts for kube.*, events.*, and audit.* matches to append the cluster domain suffix.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Configuration updated to dynamically append cluster-domain suffixes to monitoring service endpoints and hostnames using Helm template expressions with "cluster.local" as the default fallback value.

Changes

Cohort / File(s) Summary
Monitoring Configuration
packages/system/monitoring-agents/values.yaml
Updated vmagent remoteWrite URLs for shortterm and longterm endpoints, plus three fluent-bit HTTP output hostnames, to include dynamic cluster-domain suffix via Helm template expression.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Through Helm's template magic, domains bloom and grow,
Cluster suffixes whisper where the data flows,
From shortterm to longterm, endpoints aligned with care,
A cluster.local chorus echoing everywhere! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/monitoring-agents-fqdn-cluster-domain

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request correctly addresses the FQDN resolution issue for monitoring agents in tenant workload clusters by appending the cluster domain to service hostnames. The changes are consistent across vmagent and fluent-bit configurations, resolving potential DNS issues in multi-cluster environments. I have one suggestion to improve maintainability by reducing code duplication.

Comment on lines +283 to +284
- http://vminsert-shortterm.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}:8480/insert/0/prometheus
- http://vminsert-longterm.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}:8480/insert/0/prometheus

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.

medium

The logic to determine the cluster domain, {{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}, is repeated in four places in this file (here and for fluent-bit outputs). This violates the DRY (Don't Repeat Yourself) principle and makes future changes more difficult and error-prone.

To improve maintainability, I recommend defining a common helper template in your Helm chart, for example in a _helpers.tpl file:

{{/*
Cluster domain suffix
*/}}
{{- define "monitoring-agents.clusterDomain" -}}
{{- (index .Values._cluster "cluster-domain") | default "cluster.local" -}}
{{- end -}}

Then you could use {{ include "monitoring-agents.clusterDomain" . }} in all places where the cluster domain is needed. This would centralize the logic.

I am not providing a direct code suggestion as it would require creating or modifying a helper file which is outside the scope of the current changes.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Feb 20, 2026
@kvaps
Andrei Kvapil (kvaps) marked this pull request as ready for review February 20, 2026 19:41
@kvaps
Andrei Kvapil (kvaps) merged commit 4c3766a into main Feb 20, 2026
8 checks passed
@dosubot dosubot Bot added the size/S This PR changes 10-29 lines, ignoring generated files label Feb 20, 2026
@kvaps
Andrei Kvapil (kvaps) deleted the fix/monitoring-agents-fqdn-cluster-domain branch February 20, 2026 19:41
@dosubot dosubot Bot added the kind/bug Categorizes issue or PR as related to a bug label Feb 20, 2026
Andrei Kvapil (kvaps) added a commit that referenced this pull request Feb 23, 2026
PR #2075 introduced _cluster.cluster-domain references in
monitoring-agents values.yaml for FQDN resolution. This broke
fluent-bit because it's a subchart and _cluster values are not
accessible from the subchart context (only global values are shared
with subcharts).

Replace _cluster references with global.clusterDomain variable:
- Empty by default (management cluster uses short DNS names)
- Set to the management cluster domain for tenant clusters, enabling
  FQDN resolution for cross-cluster service discovery

Closes #2084

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
Andrei Kvapil (kvaps) added a commit that referenced this pull request Feb 23, 2026
…n tenant HelmRelease

PR #2075 added _cluster.cluster-domain references to monitoring-agents
values.yaml for FQDN resolution. This broke fluent-bit because it is
a subchart where _cluster values are not accessible (only global
values are shared with subcharts), causing "index of untyped nil".

Revert values.yaml to short DNS names (.svc) for the management
cluster where they resolve locally, and add FQDN with cluster-domain
suffix in the tenant kubernetes HelmRelease where _cluster values are
available and cross-cluster DNS resolution is needed.

Closes #2084

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
Andrei Kvapil (kvaps) added a commit that referenced this pull request Feb 23, 2026
…2086)

## What this PR does

PR #2075 introduced `_cluster.cluster-domain` references in
monitoring-agents `values.yaml` for FQDN resolution in tenant clusters.
This broke the fluent-bit subchart because `_cluster` values are not
accessible from the Helm subchart context — only `global` values are
shared with subcharts.

This PR replaces `_cluster` references with a new `global.clusterDomain`
variable:
- Empty by default (management cluster uses short DNS names like
`service.namespace.svc`)
- Set to the management cluster domain (e.g. `cozy.local`) for tenant
clusters, enabling FQDN resolution for cross-cluster service discovery

Fixes #2084

### Release note

```release-note
[system] Fix monitoring-agents installation failure caused by inaccessible _cluster values in fluent-bit subchart context. Introduce global.clusterDomain for proper FQDN resolution in tenant workload clusters.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Monitoring agent configuration updated to support configurable cluster
domain names for greater flexibility.
* Remote write and log-forwarding endpoints adjusted to align with
cluster domain handling, improving compatibility when deploying across
different cluster DNS setups.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug lgtm This PR has been approved by a maintainer size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants