Skip to content

feat(agentruntime): enforce disruption budget and network policies (MPR-205) - #295

Merged
kc-splunk merged 2 commits into
ai-agent-runtimefrom
codex/MPR-205-runtime-disruption-network-policy
Nov 27, 2026
Merged

kc-splunk merged 2 commits into
ai-agent-runtimefrom
codex/MPR-205-runtime-disruption-network-policy

Conversation

@kc-splunk

Copy link
Copy Markdown
Collaborator

Description

Implements MPR-205. AgentRuntime gets a PodDisruptionBudget and separate default-deny network policies for runtime and schema pods.

Type of change

  • New feature
  • Upgrade configuration required for existing AgentRuntime deployments
  • Documentation update

Changes made

  • Allow one voluntary runtime disruption at the current Deployment scale. Evicting a singleton can briefly interrupt service. With two Ready replicas, the budget protects the remaining replica until a replacement is Ready.
  • Allow only declared traffic using exact pod selectors, pinned namespaces, and explicit private CIDRs for eligible egress. Schema pods receive DNS and PostgreSQL egress. Invalid or missing allowlists fail validation. The reconciler applies deny-only policies to invalid legacy configurations.
  • Reconcile ownership and policy updates, and carry the allowlist through CRDs, RBAC, Helm, and the k0s installer.

Testing performed

Scope Results
Local cpuOnly and fullfeature 24 non-E2E Go packages with tests passed, including local Kubernetes API tests for admission, policy rendering and updates, ownership, and reconciliation. Focused installer validation and upgrade checks passed, and both profile renders matched their expected manifests.
agentruntime-dev 22 live checks passed. Verified DNS and PostgreSQL schema startup, SLIM and metrics peer access, denied traffic, private CIDR add/remove, and Kubernetes evictions. The singleton recovered, and the budget protected the last Ready replica when scaled to two. Removed the fixture and temporary access rule, restored CRDs and webhooks, and verified shared readiness.
fullfeature-dev 28 live checks passed. The pinned SLIM pod reached AgentRuntime. Runtime reached the existing Ray Serve service, lost access when the rule was removed, and regained it when the rule was restored. Verified metrics, PostgreSQL/schema, private CIDR enforcement, and both eviction cases. Removed the fixture, restored CRDs and webhooks, and verified the shared baseline with all 13 Ray applications running.

The broader installer harness encountered missing-helper and path errors. Installer validation above covers the focused checks. Live runs used disposable workloads to verify operator policy and disruption behavior. The published Git tree matches local candidate a302d95.

Upgrade

Stage both updated CRDs and save the AgentRuntime allowlists on existing AIPlatforms and standalone AIServices before rolling the operator. The k0s installer checks that the allowlists are already saved. See the configuration and upgrade guide.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T06:38:40.118784Z be7043a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Require staged allowlists and updated CRDs before Helm and k0s upgrades. Keep stable managed Ray egress, make metrics explicit, and guard active legacy workloads without adopting user resources.

Copy link
Copy Markdown
Collaborator Author

Addressed both P1s and all five P2s in bcab6c2.

  • Helm and k0s verify the staged CRDs, saved allowlists and resource ownership before rollout. k0s checks before cluster work and expands YAML aliases before rendering.
  • Fullfeature egress follows the stable Ray head Service. The policy stages the verified pending head ahead of a selector switch. Metrics require a scraper peer or explicit opt-out, which removes the owned ServiceMonitor.
  • Active legacy schema Jobs with verified Kubernetes Job UIDs get isolated DNS and PostgreSQL rules. A reserved policy name conflict preserves the existing object and guards the affected workload.

Validation

  • Local passed 332 Go tests and subtests, 41 focused k0s assertions and seven Helm render cases. Both charts linted. Generated policy schemas match across the CRDs, chart and installer. The Helm render matrix used first-party templates and excluded external dependencies.
  • agentruntime-dev passed 29 network, metrics and eviction checks. The original deletion test stopped its own admission listener and timed out. A focused retry with admission available passed, removing the AIService-owned policies, budget and monitor while preserving the checkpoint Secret, PVC and unrelated peer.
  • fullfeature-dev passed all 32 checks. Fresh connections to the real stable Ray head on TCP 8000 succeeded with the policy, failed after the rule was removed and succeeded after restoration. The managed SLIM route, network boundaries, evictions and AIService deletion passed. The shared workload snapshot matched before and after.
  • Both live matrices used disposable fixtures. Upgrade ordering, legacy schema migration, name-collision handling and Ray selector rollover were verified locally. The focused west deletion retry used the final source tree. The only changes after the main live build were in upgrade checks, their tests and Helm rendering.

MPR-205 acceptance

  1. The single-replica eviction was permitted and the workload recovered. With two Ready replicas, one eviction was permitted and the next was rejected while the survivor was the only healthy pod. Both profiles recovered checkpoint access.
  2. The fixtures verified approved SLIM, metrics, DNS-dependent schema and runtime access, PostgreSQL, model access, selector scoping and explicit private CIDR behavior. Public wildcard rules were rejected. Existing TLS and certificate wiring remains covered locally.
  3. Runtime and schema selectors and their separate allowed flows were verified. Runtime probes, SLIM’s route and enabled metrics stayed functional. The flow table documents the permitted policy paths.
  4. Live policy removal and restoration, admission rejection and AIService-owned resource deletion were verified. The upgrade gates reject unstaged policy and ownership conflicts.
  5. Focused tests cover ownership, selectors, the flow rules, both supported profiles and PDB behavior. Product invocation and authorization qualification remain covered by MPR-194 and MPR-200.

I assess all five criteria as met for the operator scope. Story and acceptance criteria

@kc-splunk
kc-splunk merged commit 83d8ae8 into ai-agent-runtime Nov 27, 2026
1 check passed
@kc-splunk
kc-splunk deleted the codex/MPR-205-runtime-disruption-network-policy branch November 27, 2026 07:19
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.

1 participant