Skip to content

Commit 067607d

Browse files
committed
PUDN, static ips: fill out the API section
Indicate the changes to the `IPAMClaim` CRD, as well as the definition of the proposed new `IPPool` CRD. Signed-off-by: Miguel Duarte Barroso <[email protected]>
1 parent 3d33be7 commit 067607d

File tree

1 file changed

+73
-12
lines changed

1 file changed

+73
-12
lines changed

enhancements/network/routed-ingress-primary-udn-static-ips.md

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -344,21 +344,82 @@ and https://github.com/openshift/enhancements/blob/master/enhancements/agent-ins
344344

345345
### API Extensions
346346

347-
API Extensions are CRDs, admission and conversion webhooks, aggregated API servers,
348-
and finalizers, i.e. those mechanisms that change the OCP API surface and behaviour.
347+
#### IPAMClaim CRD
348+
349+
The IPAMClaim CRD status sub-resource will need to be updated, adding
350+
conditions.
351+
352+
For traceability, we also suggest adding to the `IPAMClaim` spec an attribute
353+
to indicate which pod is holding the claim at any given time. On a VM live
354+
migration, the OVN-Kubernetes control plane would update the `OwnerPod` after
355+
the claim has been consumed by a different pod. Same for VM start/stop
356+
scenarios.
357+
358+
If we choose the [de-centralized IP management](#de-centralized-ip-management)
359+
alternative, we will also need to change the IPAMClaim CRD spec, adding it an
360+
attribute to request specific IPs for the workload which will consume the
361+
claim.
362+
363+
Below you'll see the changes requested:
364+
```go
365+
type IPAMClaimSpec struct {
366+
// The network name for which this persistent allocation was created
367+
Network string `json:"network"`
368+
// The pod interface name for which this allocation was created
369+
Interface string `json:"interface"`
370+
+ // The IPs requested by the user
371+
+ // +optional
372+
+ IPRequests []CIDR `json:"ipRequests,omitempty"`
373+
}
374+
375+
// IPAMClaimStatus contains the observed status of the IPAMClaim.
376+
type IPAMClaimStatus struct {
377+
// The list of IP addresses (v4, v6) that were allocated for the pod interface
378+
- IPs []string `json:"ips"`
379+
+ IPs []CIDR `json:"ips"`
380+
+ // The name of the pod holding the IPAMClaim
381+
+ OwnerPod string `json:"ownerPod"`
382+
+ // Conditions contains details for one aspect of the current state of this API Resource
383+
+ Conditions []metav1.Condition `json:"conditions,omitempty"`
384+
}
385+
```
349386

350-
- Name the API extensions this enhancement adds or modifies.
351-
- Does this enhancement modify the behaviour of existing resources, especially those owned
352-
by other parties than the authoring team (including upstream resources), and, if yes, how?
353-
Please add those other parties as reviewers to the enhancement.
387+
The `IPAMClaim` status will have (at least) the following conditions:
388+
- SuccessfulAllocation: reports the IP address was successfully allocated for
389+
the workload
390+
- AllocationConflict: reports the requested allocation was not successful - i.e.
391+
the requested IP address is already present in the network
354392

355-
Examples:
356-
- Adds a finalizer to namespaces. Namespace cannot be deleted without our controller running.
357-
- Restricts the label format for objects to X.
358-
- Defaults field Y on object kind Z.
393+
#### New IPPool CRD
394+
395+
The IPPool CRD will operate as a place to store the MAC to IP addresses
396+
association for a logical network.
397+
398+
```go
399+
type IPPool struct {
400+
metav1.TypeMeta `json:",inline"`
401+
metav1.ObjectMeta `json:"metadata,omitempty"`
402+
403+
Spec IPPoolSpec `json:"spec,omitempty"`
404+
Status IPPoolStatus `json:"status,omitempty"`
405+
}
406+
407+
type IPPoolSpec struct {
408+
NetworkName string `json:"network-name"`
409+
Entries map[net.HardwareAddr][]net.IP
410+
}
411+
412+
type IPPoolStatus struct {
413+
Conditions []Condition
414+
}
415+
```
359416

360-
Fill in the operational impact of these API Extensions in the "Operational Aspects
361-
of API Extensions" section.
417+
The `IPPool` CRD will have at least the following conditions:
418+
- DuplicateMACAddresses: will indicate to the admin that a MAC address appears
419+
multiple times in the `Entries` list
420+
- DuplicateIPAddresses: will indicate to the admin that an IP address appears
421+
multiple times associated to different MAC addresses in the `Entries` list
422+
- Success: the data present in the spec is valid (no duplicate MACs or IPs)
362423

363424
### Topology Considerations
364425

0 commit comments

Comments
 (0)