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

unknown field "spec.excludedAddresses" #213

Closed
simonfelding opened this issue Dec 6, 2023 · 6 comments
Closed

unknown field "spec.excludedAddresses" #213

simonfelding opened this issue Dec 6, 2023 · 6 comments
Assignees

Comments

@simonfelding
Copy link

simonfelding commented Dec 6, 2023

Hi. Awesome sig!
There seems to be a bug in ipam.cluster.x-k8s.io/v1alpha2 that is poorly documented.
It is no longer spec.exclude, now it's apparently spec.excludedAddresses that defines the excluded addresses.

However, neither of them work now.
I'm using the following configuration.

apiVersion: ipam.cluster.x-k8s.io/v1alpha2
kind: InClusterIPPool
metadata:
  name: ${CLUSTER_CLASS_NAME}
  namespace: ${NAMESPACE}
spec:
  prefix: 25
  addresses:
    - 10.1.157.0/25
  excludedAddresses:
    - 10.1.157.1-10.1.157.20
  gateway: 10.1.157.1

The full error:

Error from server (BadRequest): error when creating "STDIN": InClusterIPPool in version "v1alpha2" cannot be handled as a InClusterIPPool: strict decoding error: unknown field "spec.excludedAddresses"
@schrej
Copy link
Member

schrej commented Dec 7, 2023

It's not a bug in the API, it's rather a bug in the documentation. Seems I used the wrong field name when I wrote that.

@schrej
Copy link
Member

schrej commented Dec 7, 2023

/assign

@simonfelding
Copy link
Author

I see. Thank you!

By the way, as a user it's not entirely clear if spec.prefix is optional or not when spec.adresses is a CIDR like in my case. According to the docs, there's some logic that derives the prefix from the CIDR, but only if the first address is a CIDR. Yet it also sounds like spec.prefix is a required field. 🙂

@schrej
Copy link
Member

schrej commented Dec 7, 2023

Prefix is required. The important thing is that all addresses (doesn't matter whether it's individual addresses, ranges or CIDRs) need to fit into one prefix. The prefix is created from the first address that is part of the pool and the specified prefix. All other addresses must be within that prefix.

@schrej
Copy link
Member

schrej commented Dec 7, 2023

I've fixed the "excludedAddresses" mistake with a naughty direct commit.
/close

@k8s-ci-robot
Copy link
Contributor

@schrej: Closing this issue.

In response to this:

I've fixed the "excludedAddresses" mistake with a naughty direct commit.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

No branches or pull requests

3 participants