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

Addresses can be specified as hyphenated ranges and CIDRs #95

Merged
merged 5 commits into from
Mar 23, 2023

Conversation

tylerschultz
Copy link
Contributor

This PR makes it possible to declare an InClusterIPPool like the following example:

apiVersion: ipam.cluster.x-k8s.io/v1alpha1
kind: InClusterIPPool
metadata:
  name: inclusterippool-sample
spec:
  addresses:
    - 10.0.0.10
    - 10.0.0.24-10.0.0.32
    - 10.0.0.128/28
  prefix: 24
  gateway: 10.0.0.1

This PR also adds the addresses printcolumn to the InClusterIPPool resource, like this example:

$ kubectl get inclusterippool
NAME                     SUBNET   FIRST   LAST   ADDRESSES
inclusterippool-sample                           ["10.0.0.10-10.0.0.11","10.0.0.30/30","10.0.0.22"] 

This PR does not address the missing subnet nor First and Last columns.

This PR adds a test to ensure the controller allocates the lowest available IP in a given IP Pool.

This PR works towards some of the topics in Issue #71

Aidan Obley and others added 4 commits March 21, 2023 17:02
Example:
```yaml

Co-authored-by: Tyler Schultz <[email protected]>
---
apiVersion: ipam.cluster.x-k8s.io/v1alpha1
kind: InClusterIPPool
metadata:
  name: inclusterippool-sample
spec:
  addresses:
    - 10.0.0.10-10.0.0.15
    - 10.0.0.24/30
    - 10.0.0.32
  prefix: 24
  gateway: 10.0.0.1
```

Addresses that are ranges are validated to ensure they are contained by
the prefix.

Co-authored-by: Tyler Schultz <[email protected]>
Co-authored-by: Aidan Obley <[email protected]>
Co-authored-by: Tyler Schultz <[email protected]>
no matter the order of the ip pool `spec.Addresses`

Co-authored-by: Christian Ang <[email protected]>
@tylerschultz tylerschultz requested a review from schrej as a code owner March 21, 2023 18:45
Copy link
Member

@schrej schrej left a comment

Choose a reason for hiding this comment

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

lgtm!

@schrej schrej merged commit 6040345 into kubernetes-sigs:main Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants