Repository navigation
Document adoption, teardown and CRD upgrades for operators - #14
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
IvanHunters
left a comment
There was a problem hiding this comment.
Review: document adoption, teardown and CRD upgrades
Most of the document checks out against the code: the API group and kinds, the IPAddress example fields and the fromClass source, the pre-binding acceptance rule and PreBindingRefused event, the finalizer names, the teardown order, and the v1alpha1-without-conversion CRD-upgrade notes are all accurate.
[MEDIUM] The pin-protection claim describes a policy that is not shipped here
docs/operating.md:34-35: "The hand-written pin stays on the Service. Under the driver's admission policy, removing it later takes an allowlisted principal." That policy is real but it is the metallb-iad admission policy from cozystack/metallb-iad#6, which is not merged, is opt-in, and is off by default. As written the sentence reads as a standing guarantee; on a cluster without that optional policy enabled, removing a hand-written pin is ungated and the only backstop is the driver's after-the-fact Conflict detection. Please qualify it: the protection applies only where the optional metallb-iad admission policy is enabled.
[MINOR] The adoption step order invites a race
The guide creates the IPAddressClaim first (step 1) and the pre-bound IPAddress second (step 2). If the claim reconciles before the admin creates the pre-bound address, the driver allocates a different address for the pending claim, and the admin's hand-written IPAddress is then refused with PreBindingRefused while the ledger holds an address other than the one pinned on the Service. Creating the pre-bound IPAddress first (or together) avoids it.
Note
Worth adding a teardown caveat: under reclaim Retain, a class accumulates Released/Available addresses that the class-deletion finalizer (#10) holds on, and releaseDelay (#11) returns addresses to Available rather than deleting them, so deleting a used class requires deleting its addresses first. Documenting this keeps a held class deletion from looking stuck.
Request changes for the pin-protection statement; the rest are notes.
73b8bce to
4a7c96e
Compare
4a7c96e to
fdef03e
Compare
docs/operating.md covers bringing an address a Service already holds under the ledger, the order in which to remove claims, addresses, classes and controllers so finalizers do not hang, and the schema changes each release makes to the v1alpha1 CRDs. Assisted-By: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Assisted-By: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
fdef03e to
ad9398f
Compare
Adoption now creates the claim with spec.addressName, so the driver does not provision a different address before the pre-bound IPAddress exists; creating the IPAddress first would have it reclaimed as orphaned. The pin protection is stated as depending on metallb-iad's optional admission policy. New sections cover why a used class waits on its Released and Available addresses, and that the held annotation pauses the return to the pool but not the delay. Assisted-By: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
|
Thanks for the review. Addressed in 6c809fc; per point: [MEDIUM] Pin protection. Qualified. The guide now says removing the hand-written pin takes an allowlisted principal only where metallb-iad's optional admission policy is enabled. Without that policy, removing it is ungated, and only the driver's conflict detection reports the address going to another Service. [MINOR] Adoption race. Fixed, but not by creating the
The guide also notes that setting Note: teardown. Added under Deleting a class. A class that has served claims keeps Also from the #11 review: a new Quarantining an address section says |
IvanHunters
left a comment
There was a problem hiding this comment.
Lifting my request-changes; this is now an approve. All three points are addressed, and I checked the new content against the code rather than only re-reading it.
- The MEDIUM pin claim is qualified correctly:
operating.mdnow says removing a hand-written pin takes an allowlisted principal only where metallb-iad's optional admission policy is enabled, and that without it the removal is ungated and only conflict detection reports it. - The adoption race is closed, and more robustly than I suggested: the claim names the address in
spec.addressNameso it waitsPendingfor exactly that address instead of grabbing another, and the doc warns that creating theIPAddressfirst gets it reclaimed. I confirmed both against the code:bindAvailableAddresswithaddressNameset and the address absent binds nothing, andipaddress_controllerreclaims a pre-bound address whose claim does not exist yet (boundClaimis nil, socase claim == nilreclaims), while a pre-binding whose claim exists waits. - Teardown and the held-address lifecycle are documented, including that under
Retaina class keepsReleased/Availableaddresses that hold its deletion andreleaseDelayreturns them toAvailablerather than deleting them. The finalizer-clear commands are group-qualified (ipaddressclaims.local.sdn.cozystack.io, etc.), with thenetworking.k8s.ioambiguity called out, and the teardown order keeps the controllers running while objects are deleted.
LGTM.
Adds
docs/operating.md, linked from the README, covering operator procedures that a review of cozystack/cozystack#3382 found undocumented.Adopting an address a Service already holds.
spec.addressNamenaming the address. The MetalLB driver then does not provision a different one.IPAddresspre-bound to the claim. It notes the class and family check that Auto-claim addresses for LoadBalancer Services that name no claim #7 applies to pre-bindings.It explains why creating the
IPAddressfirst fails: an address whose claim is missing is reclaimed as orphaned. It also says the hand-written pin is protected only where metallb-iad's optional admission policy is enabled.Removing the controllers. The teardown order: claim annotations, claims, leftover addresses, classes, then the driver and the core. It also gives the commands to clear finalizers when the controllers are already gone, with the API group spelled out, because
ipaddressesalone resolves tonetworking.k8s.io.Deleting a class. A class that has served claims keeps
ReleasedandAvailableaddresses, which hold it under the class-deletion guard (Hold a deleted IPAddressClass until its addresses are gone #10);releaseDelay(Return Released addresses to the pool after a class's releaseDelay #11) returns them to the pool rather than deleting them. So its addresses have to be deleted first, and the class reportsClassInUseuntil then.Quarantining an address. The
heldannotation pauses the return to the pool, not the delay. Lifting it from an addressReleasedfor longer thanreleaseDelayreturns the address at once.Upgrading the CRDs. The API is
v1alpha1with no conversion, so a removed or renamed field invalidates stored objects. A table records each release's schema changes. Unreleased so far:IPAddressClass.spec.releaseDelayand the core-setBoundcondition onIPAddress.Docs only.