Skip to content

refactor(kubernetes): remove NetworkPolicies - #150

Merged
InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/vnode-owns-status
Nov 21, 2026
Merged

InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/vnode-owns-status

Conversation

@kerthcet

@kerthcet kerthcet commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Removes namespace isolation from the kubernetes provider: Nebula no longer writes NetworkPolicies or ClusterNetworkPolicies.

Change

  • Removed: netpol.go, its fence in Provision, the dynamic client it used, the host-wide default deny (config/kubernetes-provider/cluster-network-policy.yaml), and the RBAC for both in remote-rbac.yaml.
  • The cluster table loses cidrs and host, and the sample clusters.yaml drops host: true.
  • The webhook keeps its two related rules, with their real reasons rather than isolation:
    • hostNetwork: true is refused: no provider runs it as written (Modal, RunPod and AWS drop the field, and the kubernetes provider's copy would put the real pod on its target node's network).
    • A placed Pod can't drop the opt-in label: teardown keys on it (reapTerminalPod skips unlabeled Pods), so a placed Pod that dropped it and timed out would keep its NodeClaim and instance.
  • docs/multi-cluster.md now says Nebula writes no NetworkPolicies, so a real pod's traffic is whatever each cluster's network allows. It also replaces a Hiverge-looking sample cluster name.

Testing

  • The webhook's tests are unchanged from main, since its logic is unchanged; only their comments now give the new reasons.
  • make test and make lint pass, and config/kubernetes-provider and config/default still render with kustomize.

🤖 Generated with Claude Code

The kubernetes provider no longer writes NetworkPolicies or ClusterNetworkPolicies:
netpol.go and its fence in Provision, the dynamic client it used, the host-wide
default deny (config/kubernetes-provider/cluster-network-policy.yaml) and the RBAC
for both are gone. A real pod's traffic is whatever each cluster's network allows.

The cluster table loses `cidrs` and `host`. It is parsed strictly, so a table that
still sets them fails to load with an "unknown field" error naming the line to
delete, rather than loading as if the fence were still there.

The webhook rules that existed only for isolation are removed too: opted-in Pods
with hostNetwork are admitted again, and a placed Pod may drop the opt-in label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 16:10

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 19, 2026
@kerthcet
kerthcet force-pushed the feat/vnode-owns-status branch from efacd8c to e160a73 Compare November 19, 2026 17:02
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:02

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@kerthcet kerthcet changed the title fix(vnode): Nebula writes Pod status itself; remove namespace isolation refactor(kubernetes): remove NetworkPolicies Nov 19, 2026
@kerthcet kerthcet closed this Nov 19, 2026
@kerthcet kerthcet reopened this Nov 21, 2026
@kerthcet
kerthcet requested a balanced review from Copilot November 21, 2026 08:52

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.

🟡 Changes recommended

Unresolved issues allow host-network Pods to run with incorrect networking and opted-out Pods to leak resources, while legacy isolation policies need documented cleanup to avoid blocking namespaces.

3 open issues

Review effort: Balanced

Comment thread internal/webhook/v1/pod_webhook.go Resolved
Comment thread internal/webhook/v1/pod_webhook_test.go Resolved
Comment thread docs/multi-cluster.md Resolved
Both were removed with namespace isolation as if they existed only for it. They do not:

- A host-network Pod runs as written on no provider: Modal, RunPod and AWS drop the
  field, and the kubernetes provider's copy would put the real pod on its target
  node's own network. The validator already refuses what providers drop silently.
- Teardown keys on the opt-in label. reapTerminalPod skips a Pod without it, and the
  readiness timeout only fails the Pod, relying on that reap, so a placed Pod that
  dropped the label and timed out kept its NodeClaim and its instance, still billing.

The rules are restored as on main, with these reasons instead of isolation's.

docs/multi-cluster.md also gains how to delete the policies isolation wrote, which
removing the code leaves behind: a leftover host-wide deny would cut off the targets
for namespaces Nebula places into from now on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 09:06

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.

🔵 Needs a closer look

Removing namespace isolation changes the tenant security boundary, requiring operator validation of cross-namespace reachability, any replacement policies, and existing-policy cleanup before rollout.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

There is nothing to migrate from: drop the cleanup section and the troubleshooting
row for a table still setting cidrs or host, and the test that pinned that error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 09:09

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.

🟡 Changes recommended

The upgrade documentation lacks explicit administrator cleanup of legacy isolation policies, which survive redeployment and can block traffic to newly placed namespaces.

1 open issue

Review effort: Balanced

Comment thread docs/multi-cluster.md Resolved
@kerthcet

Copy link
Copy Markdown
Member Author

/lgtm
/kind cleanup

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Nov 21, 2026

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent
InftyAI-Agent merged commit 34fb9c1 into InftyAI:main Nov 21, 2026
25 of 26 checks passed
@kerthcet
kerthcet deleted the feat/vnode-owns-status branch November 21, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants