feat(ipam): implement IPClass — policy layer for claiming IP space#72
Draft
scotwells wants to merge 2 commits into
Draft
feat(ipam): implement IPClass — policy layer for claiming IP space#72scotwells wants to merge 2 commits into
scotwells wants to merge 2 commits into
Conversation
Introduces IPClass, a cluster-scoped, platform-owned policy resource that names a kind of address space and the rules for handing it out (provisioner, ip family, allocation strategy, allowed/default prefix lengths, reclaim policy, visibility). Pools advertise the classes they back via spec.classNames; claims select a class via spec.className. An IPClaim naming a class (or falling through to the default class) resolves the class, folds its policy into the claim, and picks a backing pool across the caller's project and platform scopes, returning the CIDR synchronously. The allocation records its class for provenance. Existing poolRef/poolSelector paths are unchanged; poolSelector on the claim is deprecated in favor of the class. Adds the class dimension to allocation metrics, a milo-ipam 'class' command surface and 'prefix claim --class', IAM protected-resource + role verbs, examples, chainsaw e2e suites, and a k6 class-claim perf script. Cross-project claiming via projectRef and per-project class distribution via the service catalog are deferred to follow-ups.
…sk, and store race-regression tests - test/e2e/ip-class-platform-scope: a consumer project claiming a platform-owned IPClass by spec.className binds to the platform pool across the caller+platform scope, with IPAllocation provenance and no use-grant required (validates the class resolution scoping decision). - Taskfile: test/load:class-throughput target for the class-based claim k6 script. - Race-regression tests over the store GetList decode->convert->encode and watch paths, plus the apiserver codec, all clean under -race — guarding the shared serving path IPClass conversion runs through.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Implements
IPClass— the cluster-scoped, platform-owned allocation-policy resource proposed in the IPClass enhancement (docs/enhancements/ip-class.md). It's the direct analog of a KubernetesStorageClass: a class names a kind of address space and the rules for handing it out (provisioner, IP family, allocation strategy, allowed/default prefix lengths, reclaim policy, visibility). Pools advertise the classes they back viaspec.classNames; claims select a class viaspec.className.A claim naming a class (or falling through to the default class) resolves the class, folds its policy into the claim, and picks a backing pool across the caller's project and the platform scope — returning the CIDR synchronously. The allocation records its class for provenance. Existing
poolRef/poolSelectorpaths are unchanged;poolSelectoron the claim is deprecated in favor of the class.Consumers stop needing to know pool names or label vocabulary — they claim by class name, and the same manifest is portable across environments.
Included
IPClass,IPPoolSpec.ClassNames,IPClaimSpec.ClassName,IPAllocationSpec.ClassName).ipclassregistry, apiserver wiring, validation, defaulting, single-default-class enforcement.classNamesindex, provenance, a low-cardinalityclassmetric label.milo-ipamclass list/class show+prefix claim --class.examples/ipclass/.Validation (live kind deployment)
tracingsuite (needs the optional observability stack; unrelated).read-latencysuccess-rate threshold is blocked only by a pre-existing, arch-independent apiserver stability bug (Apiserver heap corruption under high-concurrency LIST load (~7–9k req/s) — pre-existing, arch-independent #71), not by this change.Scope
Fully backward compatible and additive. Claiming by class name is the standard path;
poolSelectoron claims is deprecated;poolRefremains as an advanced escape hatch. Cross-project claiming and catalog-driven per-project class distribution are separate follow-ups.Known issue (decoupled)
The perf
read-success-rategap is a pre-existing, architecture-independent apiserver heap-corruption crash under sustained high-concurrency LISTs (documented onmainvia theMaxConns=10mitigation; zero IPAM frames; our read/store/convert/watch paths proven race-free by the-raceregression tests here). Tracked in #71. Not introduced by this PR.Status
Draft. Depends conceptually on the enhancement proposal (#70).