Skip to content

feat(helm): support dnsConfig on the forwarder deployment - #2124

Merged
arikalon1 merged 4 commits into
robusta-dev:masterfrom
DrFaust92:dnsconfig-forwarder
Oct 20, 2026
Merged

arikalon1 merged 4 commits into
robusta-dev:masterfrom
DrFaust92:dnsconfig-forwarder

Conversation

@DrFaust92

Copy link
Copy Markdown
Contributor

What

The runner Deployment already supports a configurable dnsPolicy / dnsConfig (runner.dnsConfig.*), but the forwarder (kubewatch) does not — it's stuck on the implicit ClusterFirst policy.

This PR extracts the runner's inline dnsConfig logic into a shared robusta.dnsConfig helper and uses it from both the runner and the forwarder, and adds a matching kubewatch.dnsConfig block to values.yaml.

Why

Users who need custom DNS (e.g. dnsPolicy: None with explicit nameservers/searches, or custom ndots options) can already configure it for the runner but had no way to do the same for the forwarder pod.

Details

  • New robusta.dnsConfig helper in _helpers.tpl — centralizes the dnsPolicy, the optional dnsConfig block, the "None requires at least one of nameservers/searches/options" guard, and the ClusterFirst fallback.
  • runner.yaml now calls the helper (removes ~26 lines of inline logic).
  • forwarder.yaml calls the same helper before containers:.
  • values.yaml gains a kubewatch.dnsConfig block mirroring runner.dnsConfig.

Backwards compatibility

Defaults are unchanged (dnsConfig.enabled: false), so both deployments still render dnsPolicy: ClusterFirst. The runner's rendered output is byte-for-byte identical.

Verified with helm template:

  • default → dnsPolicy: ClusterFirst on both deployments
  • enabled: true + policy: None + nameservers → correct dnsConfig nesting
  • policy: None with no config → still hard-fails via the guard

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ca2fc0f-c087-40e6-8b0c-bff15c275ad3
📥 Commits

Reviewing files that changed from the base of the PR and between 2973d7d and 7433478.

📒 Files selected for processing: 4
  • helm/robusta/templates/_helpers.tpl
  • helm/robusta/templates/forwarder.yaml
  • helm/robusta/templates/runner.yaml
  • helm/robusta/values.yaml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

A shared Helm helper now renders validated DNS settings. The runner and forwarder use the helper. Kubewatch receives disabled DNS defaults with ClusterFirst policy.

Changes

Helm DNS configuration

Layer / File(s) Summary
DNS helper validation and rendering
helm/robusta/templates/_helpers.tpl
Adds robusta.dnsConfig, validates dnsPolicy: None, renders optional DNS fields, and defaults to ClusterFirst.
Deployment wiring and defaults
helm/robusta/templates/runner.yaml, helm/robusta/templates/forwarder.yaml, helm/robusta/values.yaml
The runner and forwarder use the shared helper. Kubewatch receives disabled DNS defaults.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: andrewgkew, avi-robusta

Merge Risk: ⚪ Minimal · up to 74334

No actionable DNS configuration issue remains; the change is ready to merge after normal checks.

Architecture risk: 🔵 Low · up to 74334

The change affects 1 system.

Changed systems: helm

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — helm (service) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in helm/robusta/templates/_helpers.tpl: Added the robusta.dnsConfig template, which emits ClusterFirst by default, applies an enabled custom policy, renders configured DNS fields, and fails for dnsPolicy: None without nameservers.
  • observed — Modified behavior in helm/robusta/templates/forwarder.yaml: Adds DNS configuration rendering to the forwarder pod specification from .Values.kubewatch.dnsConfig.
  • observed — Modified behavior in helm/robusta/templates/runner.yaml: Replaced the runner’s inline DNS policy/configuration rendering and None-policy validation with delegation to the robusta.dnsConfig helper using .Values.runner.dnsConfig.
  • observed — Modified behavior in helm/robusta/values.yaml: Added kubewatch.dnsConfig settings: DNS configuration is disabled by default, uses the ClusterFirst policy, and accepts empty nameserver, search-domain, and resolver-option lists.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: adding dnsConfig support to the forwarder Helm deployment.
Description check Passed The description accurately explains the shared DNS helper, forwarder support, runner refactoring, configuration defaults, validation, and verification steps.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/robusta/templates/_helpers.tpl`:
- Around line 21-26: Update the dnsConfig validation around .enabled to tolerate
a null or missing configuration object and use the established default for
.policy when it is absent. For an effective policy of None, require .nameservers
to exist and be non-empty; do not accept only .searches or .options. Render
dnsPolicy using the resolved fallback policy so the template never emits an
empty value or panics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 835affbb-f52f-4a67-b9f7-6d7b1939b35b

📥 Commits

Reviewing files that changed from the base of the PR and between eb350a4 and dd2c56b.

📒 Files selected for processing (4)
  • helm/robusta/templates/_helpers.tpl
  • helm/robusta/templates/forwarder.yaml
  • helm/robusta/templates/runner.yaml
  • helm/robusta/values.yaml

Comment thread helm/robusta/templates/_helpers.tpl Outdated
@DrFaust92
DrFaust92 force-pushed the dnsconfig-forwarder branch from 04e30f0 to 3a990f5 Compare August 1, 2026 12:50
@DrFaust92

Copy link
Copy Markdown
Contributor Author

@arikalon1 ping

@DrFaust92
DrFaust92 force-pushed the dnsconfig-forwarder branch from 3a990f5 to 9a69b8b Compare August 9, 2026 00:24
DrFaust92 and others added 2 commits September 5, 2026 00:06
The runner Deployment already supported a configurable dnsPolicy /
dnsConfig, but the forwarder (kubewatch) did not and was stuck on the
implicit ClusterFirst policy.

Extract the runner's inline dnsConfig logic into a shared
`robusta.dnsConfig` helper (including the "None requires config" guard
and the ClusterFirst fallback) and use it from both the runner and the
forwarder. Add a matching `kubewatch.dnsConfig` block to values.yaml.

Defaults are unchanged: dnsConfig.enabled is false, so both deployments
still render `dnsPolicy: ClusterFirst`. The runner's rendered output is
byte-for-byte identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address CodeRabbit feedback on the dnsConfig helper:

- When dnsPolicy is "None", Kubernetes requires at least one nameserver
  (searches/options alone are rejected by the API server). Tighten the
  guard to require .nameservers specifically instead of any config field.
- Tolerate a null/missing dnsConfig object (`and . .enabled`) and default
  .policy to "ClusterFirst" when unset, so the template never panics or
  emits an empty `dnsPolicy: ""`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@arikalon1
arikalon1 merged commit a254278 into robusta-dev:master Oct 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants