Skip to content

status: add DelegatedPrefixes for DHCPv6 prefix-delegation persistence#12

Open
dkelson wants to merge 1 commit into
k8snetworkplumbingwg:mainfrom
dkelson:dhcpv6-pd-delegated-prefixes
Open

status: add DelegatedPrefixes for DHCPv6 prefix-delegation persistence#12
dkelson wants to merge 1 commit into
k8snetworkplumbingwg:mainfrom
dkelson:dhcpv6-pd-delegated-prefixes

Conversation

@dkelson

@dkelson dkelson commented Jun 27, 2026

Copy link
Copy Markdown

What

Add an optional Status.DelegatedPrefixes []string field to the IPAMClaim CRD,
holding the IPv6 prefix(es) (CIDR) delegated to a pod interface via DHCPv6 Prefix
Delegation.

// The list of IPv6 prefixes (CIDR) delegated to the pod interface via DHCPv6
// Prefix Delegation, persisted so the same prefix is reproduced across pod
// churn (e.g. KubeVirt live migration)
DelegatedPrefixes []string `json:"delegatedPrefixes,omitempty"`

Why

IPAMClaim.Status already persists the interface's IA_NA addresses in IPs so an
IPAM consumer can reproduce them on a new pod for the same workload (the KubeVirt
live-migration case). DHCPv6 Prefix Delegation gives a workload an additional,
separately-allocated routed IPv6 prefix. That prefix has the same 1:1 lifecycle
as the interface address and the same migration-stability requirement: the consumer
must hand the migration-target pod the same prefix, or a guest holding the prefix on
an infinite DHCPv6 lease is stranded. No field persists it today.

The first consumer is OVN-Kubernetes' DHCPv6-PD feature (OKEP "Migration-stable DHCPv6
Prefix Delegation"), which allocates the prefix, persists it here, and re-asserts the
route and DHCP option on the migration target from this field.

Compatibility

  • Additive and optional (omitempty). Existing producers/consumers are unaffected; a
    cluster running the old CRD never sets the field. No API break, no conversion.

Generated artifacts

Regenerated alongside the type change and included in this commit:

  • artifacts/k8s.cni.cncf.io_ipamclaims.yaml (CRD)
  • pkg/crd/ipamclaims/v1alpha1/zz_generated.deepcopy.go

(Re-run make generate before pushing if your toolchain version differs, to confirm a
clean diff.)


Reviewer note (mirrors the existing IPs field)

The field intentionally parallels Status.IPs in shape (a []string of CIDRs) and in
its comment, so the persistence semantics are obvious by analogy.

Summary by CodeRabbit

  • New Features

    • Added a new status field to retain delegated IPv6 prefix information for IPAM claims.
    • This helps preserve prefix details across pod restarts or migration events.
  • Bug Fixes

    • Improved persistence of prefix data so it is correctly stored and restored when objects are duplicated or updated.

Persist the IPv6 prefix delegated to a pod interface via DHCPv6 Prefix
Delegation, mirroring how Status.IPs persists IA_NA addresses, so the same
prefix is reproduced on a new pod for the same workload (KubeVirt live
migration).

Signed-off-by: Dax Kelson <daxkelson@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds delegatedPrefixes to IPAMClaimStatus, deep-copies the slice, and exposes the field in the ipamclaims.k8s.cni.cncf.io CRD schema.

Changes

IPAMClaim delegated prefixes

Layer / File(s) Summary
Status contract and support
pkg/crd/ipamclaims/v1alpha1/types.go, pkg/crd/ipamclaims/v1alpha1/zz_generated.deepcopy.go, artifacts/k8s.cni.cncf.io_ipamclaims.yaml
IPAMClaimStatus adds delegatedPrefixes, the deepcopy path copies the slice, and the CRD schema publishes the new status array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding DelegatedPrefixes to status for DHCPv6 prefix-delegation persistence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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