Skip to content

Commit 8d86eda

Browse files
committed
ipam: add Ready condition failure reasons
1 parent ad80008 commit 8d86eda

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

docs/proposals/20220125-ipam-integration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ Both **IPAddressClaims** and **IPAddresses** should be part of Cluster API, whil
152152

153153
An **IPAddressClaim** is used by infrastructure providers to request an IP Address. The claim contains a reference to an IP Pool. Because the pool is provider specific, the IPAM controllers can decide whether to handle a claim by inspecting the group and kind of the pool reference.
154154

155-
If a IPAM controller detects a Claim that references a Pool it controls, it allocates an IP address from that pool and creates an **IPAddress** to fulfil the claim. It also updates the status of the `IPAddressClaim` with a reference to the created Address.
155+
If a IPAM controller detects a Claim that references a Pool it controls, it allocates an IP address from that pool and creates an **IPAddress** to fulfil the claim. It also updates the status of the `IPAddressClaim` with a reference to the created Address.
156+
When allocation fails, the `Ready` condition of the claim should be set to false. Where applicable, the reasons specified in the IPAM api package should be used.
156157

157158

158159
### Pools & IPAM Providers
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright 2024 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
18+
19+
// These reasons are intended to be used with failed Ready conditions on an [IPAddressClaim].
20+
const (
21+
// AllocationFailedReason is the reason used when allocating an IP address for a claim fails. More details should be
22+
// provided in the condition's message.
23+
// When the IP pool is full, [PoolExhaustedReason] should be used for better visibility instead.
24+
AllocationFailedReason = "AllocationFailed"
25+
26+
// PoolNotReadyReason is the reason used when the referenced IP pool is not ready.
27+
PoolNotReadyReason = "PoolNotReady"
28+
29+
// PoolExhaustedReason is the reason used when an IP pool referenced by an [IPAddressClaim] is full and no address
30+
// can be allocated for the claim.
31+
PoolExhaustedReason = "PoolExhausted"
32+
)

0 commit comments

Comments
 (0)