You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "frankkoornstra (via GitHub)" <gi...@apache.org> on 2023/06/28 09:17:09 UTC
[GitHub] [apisix-ingress-controller] frankkoornstra opened a new issue, #1881: Be able to set route id in Kubernetes resource
frankkoornstra opened a new issue, #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881
### Description
When a route gets created from the [Kubernetes resource](https://apisix.apache.org/docs/ingress-controller/references/apisix_route_v2beta3/) there's no way to create the id deterministically (by providing a route_id for example) or to even get the id from the status of the resource; only when I log in to the dashboard, I can get the route id.
I need the route id to be able to programmatically create consumers that I want to restrict to a route with consumer-restrict through the Admin API . Also I need it to analyze my reported traffic in a completely different service.
I would be very happy if we could determine the id beforehand with an optional route_id in the spec. If that's not possible, could the id be returned in the status of the k8s resource?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Be able to set route id in Kubernetes resource [apisix-ingress-controller]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-3182353078
If there is still a problem, please open it again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1637398326
This will be a break change. Is anyone willing to submit a PR to implement it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] frankkoornstra commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "frankkoornstra (via GitHub)" <gi...@apache.org>.
frankkoornstra commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1621707649
For clarity: I'm not suggesting using the actual `metadata.name` of the k8s resource for its id, but instead introduce a (nullable) field in the spec, maybe `spec.route_id` that could be set to an arbitrary (but predetermined) value. The maker of the `ApisixRoute` k8s resource would be responsible for making the id unique. If the spec field would be empty, we could fall back to the current id creation mechanism.
@shreemaan-abhishek I don't have the faintest idea how to write Go so sorry to say that I can't raise a PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] frankkoornstra commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "frankkoornstra (via GitHub)" <gi...@apache.org>.
frankkoornstra commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1611586967
Being able to determine the ID beforehand - let's say `user-management` - would save us a lot of trouble because we can rely on a naming convention and we'd now we'd have the right route.
Re 1: I don't think I understand what you mean. The Admin API already exposes the possibility of determining the ID beforehand as far as I can see, it's just that the Ingress Controller does not make use of it.
Re 2: I agree so that's why I want to make the ID mean something, say `user-management`, something I'd like to control from the k8s resource :smiley:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] frankkoornstra commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "frankkoornstra (via GitHub)" <gi...@apache.org>.
frankkoornstra commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1649343930
I wish I could but am not capable in Go
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1611479819
Here are a few clarifications:
1. Do not mix declarative configuration and admin API
2. It is not a good idea to rely on ids that have no clear meaning
But if you want to get the route id, it's a good idea to go back to status.
You can also check out the current build logic, it's fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Be able to set route id in Kubernetes resource [apisix-ingress-controller]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-3182351747
Hi @frankkoornstra, in the latest version, the last generated route_id is predictable.
1. Route Name: {namespace}_{ApisixRoute_name}_{rule_name}
2. Route ID: Calculate the hexadecimal representation of the CRC32 hash value of the Route Name
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Be able to set route id in Kubernetes resource [apisix-ingress-controller]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #1881: Be able to set route id in Kubernetes resource
URL: https://github.com/apache/apisix-ingress-controller/issues/1881
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1612315894
Because in a Kubernetes environment (through declarative configuration), its name is obviously more intuitive. However, we also need to consider isolation based on namespaces. Users may deploy the same content in multiple namespaces, so we cannot directly use its name as an ID. Therefore, we regenerate its ID.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] shreemaan-abhishek commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1611734916
@frankkoornstra are you planning to raise a PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] Gallardot commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "Gallardot (via GitHub)" <gi...@apache.org>.
Gallardot commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1627644205
After the APISIX Route is submitted as a k8s resource, the name of the generated apisix route is named using the following rule. How about using the same rule for the ID?
https://github.com/apache/apisix-ingress-controller/blob/e809cfbaaad6f6c3cbd23f5ec8e93bc1d87f543d/pkg/providers/apisix/translation/apisix_route.go#L157-L159
https://github.com/apache/apisix-ingress-controller/blob/master/pkg/types/apisix/v1/types.go#L619
https://github.com/apache/apisix-ingress-controller/blob/e809cfbaaad6f6c3cbd23f5ec8e93bc1d87f543d/pkg/types/apisix/v1/types.go#L619-L632
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] frankkoornstra commented on issue #1881: Be able to set route id in Kubernetes resource
Posted by "frankkoornstra (via GitHub)" <gi...@apache.org>.
frankkoornstra commented on issue #1881:
URL: https://github.com/apache/apisix-ingress-controller/issues/1881#issuecomment-1628473311
That would definitely work :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org