Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 ipam: add Ready condition failure reasons #10660

Merged

Conversation

schrej
Copy link
Member

@schrej schrej commented May 22, 2024

What this PR does / why we need it:
This adds three failure reasons for the Ready condition of IPAddressClaims that should be used by IPAM providers when reconciling claims. The goal is to offer some consistency between providers when observing conditions for e.g. alerting.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Related to #8424

/area ipam

@k8s-ci-robot k8s-ci-robot added area/ipam Issues or PRs related to ipam cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 22, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 22, 2024
// AllocationFailedReason is the reason used when allocating an IP address for a claim fails. More details should be
// provided in the condition's message.
// When the IP pool is full, [PoolExhaustedReason] should be used for better visibility instead.
AllocationFailedReason = "AllocationFailed"
Copy link
Member Author

Choose a reason for hiding this comment

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

Question here is whether it makes sense to have more specific reasons depending on provider, and whether this one is therefore superfluous. In general it probably doesn't matter why the allocation failed exactly, and details can still be provided in the condition message.
The only exception is the pool being full, which can be remediated, which is why the second reason below exists.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine to add this reason. It should be good enough for most cases and if someone wants to have a more specific infra-provider reason they can still use it

Copy link
Member

Choose a reason for hiding this comment

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

The only exception is the pool being full, which can be remediated, which is why the second reason below exists.

This makes me think if AllocationFailed should be a condition on its own and PoolNotReady a reason. But you're more familiar than me so feel free to disregard.

Copy link
Member Author

@schrej schrej May 28, 2024

Choose a reason for hiding this comment

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

Yeah, I thought about that as well. Since there is only one thing that happens - you either get an address or you don't - I don't really think it makes sense to have multiple conditions.

Or is the intention to differentiate between no reconciliation yet and a failed reconciliation?

@schrej schrej force-pushed the ipam/claim-condition-reasons branch from a502359 to 4fa60b1 Compare May 22, 2024 16:10

// These reasons are intended to be used with failed Ready conditions on an [IPAddressClaim].
const (
// AllocationFailedReason is the reason used when allocating an IP address for a claim fails. More details should be
Copy link
Member

Choose a reason for hiding this comment

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

Is there any hint we can give in the comment about user action for this reason, e.g. how permanent / transient this failure might be?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that heavily depends on the provider. More details should be provided in the message. I can expand the comment regarding that though.

The only generic issues I can think of atm. are the ones we already have specific reasons for: a full pool or a not-ready pool (e.g. because the system backing the pool can't be reached).

@enxebre
Copy link
Member

enxebre commented May 29, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2c7d10035f08648476f81b4b5444ff2fc313015b

@schrej schrej force-pushed the ipam/claim-condition-reasons branch from 4fa60b1 to b339567 Compare June 6, 2024 15:04
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2024
@k8s-ci-robot k8s-ci-robot requested a review from enxebre June 6, 2024 15:04
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 6, 2024
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

docs nit, lgtm as of that

@schrej schrej force-pushed the ipam/claim-condition-reasons branch from b339567 to ee0a832 Compare June 6, 2024 15:13
@schrej schrej force-pushed the ipam/claim-condition-reasons branch from ee0a832 to 8d86eda Compare June 6, 2024 16:03
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ac8d8c3243391706e338cf9ae395f0f3ee7e2d82

@sbueringer
Copy link
Member

/lgtm

/assign @enxebre

@enxebre
Copy link
Member

enxebre commented Jun 11, 2024

PR desc mentions 2 reasons but the code implement 3 now. Can you please update the PR desc to reflect latest changes? Feel free to cancel the hold afterwards.
/approve
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2024
@schrej
Copy link
Member Author

schrej commented Jun 11, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2024
@k8s-ci-robot k8s-ci-robot merged commit 8500666 into kubernetes-sigs:main Jun 11, 2024
28 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Jun 11, 2024
@schrej schrej deleted the ipam/claim-condition-reasons branch June 13, 2024 10:48
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. area/ipam Issues or PRs related to ipam cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants