Skip to content

fix: Updated route name length το 3 times the default, to cope with Ingress Controller problems #11822

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csotiriou
Copy link
Contributor

Description

Fixes #11821

What it does.

It makes the route name accept a name length that is 3 times the default one. That is because in the Ingress Controller, the route name is actually automatically given by concatenating the namespace name + other factors, therefore.

Question:

  • Is this better to be a static number (like 600, without depending on the default rule)?

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Dec 11, 2024
@csotiriou csotiriou changed the title Updated route name length το 3 times the default, to cope with Ingress Controller problems fix: Updated route name length το 3 times the default, to cope with Ingress Controller problems Jan 28, 2025
@bzp2010
Copy link
Contributor

bzp2010 commented Feb 22, 2025

I don't think it's a good idea to just do dirty patches like this on the route spec. If it is ok to extend the limit values, then the same thing should be done for all resources.

It's arguable that such a restriction might only be done due to some “inertia” on the part of the API creators to follow what they've done before, which might not really be necessary or justified.

The length of the value is meaningless in terms of functionality, and may only affect the speed of etcd synchronization and the amount of memory used by APISIX when large strings are used.

Perhaps you could start a discussion to expand the value on all resources.

Or perhaps the limit could be moved to a configuration file and allow the user to define it at runtime without modifying the code.

What do others think?

@csotiriou
Copy link
Contributor Author

csotiriou commented Feb 24, 2025

I agree, on changing the route spec, but I found that this is a central space where all of this is gathered. This value is then picked up by multiple places inside the code.

It's also important to separate the meaning of the route specification and the Kubernetes resources. My main problem is that although it's implied that the route spec character limit of 100 is also what you can give to your Kubernetes route, this is not correct in the end, leading to obscure infrastructural errors in production.

I believe the ideal solution would be

  • separate route spec and kubernetes name spec
  • have different validation rules for each one
  • Allow configuration of this value during installation time via Helm configuration for Kubernetes or env variables

However, I believe this will take much time and effort, and I don't know if that is in the scope of the rest of the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingress Controller ApisixRoutes: Reaching limit with less than 100 Characters
2 participants