feat(helm): support dnsConfig on the forwarder deployment#2124
feat(helm): support dnsConfig on the forwarder deployment#2124DrFaust92 wants to merge 2 commits into
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA reusable Helm helper now renders validated DNS settings with a ChangesHelm DNS configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
helm/robusta/templates/_helpers.tplhelm/robusta/templates/forwarder.yamlhelm/robusta/templates/runner.yamlhelm/robusta/values.yaml
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>
What
The runner Deployment already supports a configurable
dnsPolicy/dnsConfig(runner.dnsConfig.*), but the forwarder (kubewatch) does not — it's stuck on the implicitClusterFirstpolicy.This PR extracts the runner's inline dnsConfig logic into a shared
robusta.dnsConfighelper and uses it from both the runner and the forwarder, and adds a matchingkubewatch.dnsConfigblock tovalues.yaml.Why
Users who need custom DNS (e.g.
dnsPolicy: Nonewith explicit nameservers/searches, or customndotsoptions) can already configure it for the runner but had no way to do the same for the forwarder pod.Details
robusta.dnsConfighelper in_helpers.tpl— centralizes thednsPolicy, the optionaldnsConfigblock, the "Nonerequires at least one of nameservers/searches/options" guard, and theClusterFirstfallback.runner.yamlnow calls the helper (removes ~26 lines of inline logic).forwarder.yamlcalls the same helper beforecontainers:.values.yamlgains akubewatch.dnsConfigblock mirroringrunner.dnsConfig.Backwards compatibility
Defaults are unchanged (
dnsConfig.enabled: false), so both deployments still renderdnsPolicy: ClusterFirst. The runner's rendered output is byte-for-byte identical.Verified with
helm template:dnsPolicy: ClusterFirston both deploymentsenabled: true+policy: None+ nameservers → correctdnsConfignestingpolicy: Nonewith no config → still hard-fails via the guard🤖 Generated with Claude Code