@@ -344,21 +344,91 @@ and https://github.com/openshift/enhancements/blob/master/enhancements/agent-ins
344
344
345
345
# ## API Extensions
346
346
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
+ ```
349
386
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
354
392
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 ` json:"entries"`
410
+ }
411
+
412
+ type IPPoolStatus struct {
413
+ Conditions []Condition
414
+ AssociatedNADs []NADInfo
415
+ }
416
+
417
+ type NADInfo struct {
418
+ Name string ` json:"name"`
419
+ }
420
+ ```
421
+
422
+ The ` IPPool ` CRD will have at least the following conditions:
423
+ - DuplicateMACAddresses: will indicate to the admin that a MAC address appears
424
+ multiple times in the ` Entries ` list
425
+ - DuplicateIPAddresses: will indicate to the admin that an IP address appears
426
+ multiple times associated to different MAC addresses in the ` Entries ` list
427
+ - Success: the data present in the spec is valid (no duplicate MACs or IPs)
359
428
360
- Fill in the operational impact of these API Extensions in the "Operational Aspects
361
- of API Extensions" section.
429
+ We plan on reporting in the ` IPPool ` the name of the NADs which are holding the
430
+ configuration for the network which this pool stores the MAC <=> IPs
431
+ associations.
362
432
363
433
### Topology Considerations
364
434
0 commit comments