Repository navigation
fix(helm): exclude kb-index Job from agent NetworkPolicy - #605
Conversation
The #601 kb-index CronJob carried the agent selectorLabels, so it was covered by the agent NetworkPolicy. That policy's anti-SSRF egress (default-deny private ranges via a publicHttps `except` list) blocks the Job from cloning the git host on a private/mesh range, and an extraEgress allow does not reliably override the `except` on all CNIs (observed: the covered pod times out connecting to the git host even with an explicit /32:443 allow rule present). Fix: relabel the index Job pod (app.kubernetes.io/name "<name>-kb-index", component "kb-index") so it is NOT selected by the agent policy, and add a dedicated NetworkPolicy that restricts the Job to exactly DNS + tcp/443 (forgejo private clone + embedding API public) — no `except`, no other ports. The Job runs a fixed trusted pipeline (git clone + kb index), not untrusted tool/LLM calls, so it does not need the agent's full lockdown, but it stays scoped rather than fully unrestricted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe KB index CronJob pod template labels are changed from the shared agent ChangesKB Index NetworkPolicy Isolation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…etpol) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Problem
The KB index CronJob (#601) carried the agent
selectorLabels, so the agentNetworkPolicy(anti-SSRF default-deny on private ranges) blocked it from cloning the in-cluster git host. Live testing confirmed anextraEgressallow — and even a dedicated NetworkPolicy with0.0.0.0/0:443— does not fix it: the CNI does not honoripBlockegress to in-cluster / node-mesh IPs (public 443 worked; the private/node IP timed out).Fix
app.kubernetes.io/name: <name>-kb-index,component: kb-index) so it is excluded from the agent NetworkPolicy.git clone+kb index) with no untrusted tool/LLM execution, so it doesn't need the agent's SSRF egress lockdown.Tests
tests/deploy: the index-Job test asserts it does not match the agent netpol podSelector.helm lintclean; 44 deploy tests pass.🤖 Generated with Claude Code