ShiningRush commented on issue #861:
URL: 
https://github.com/apache/apisix-dashboard/issues/861#issuecomment-742205449


   > GET /apisix/admin/labels?label=key&label=key:value&...
   
   This is too simple to use, If we add label for resource, we should  also 
implement `label selector` as described in 
[here](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
   
   > Based on previous discussions, we need two apis in manager-api, a API to 
get label list, and a API to search routes by labels filter.
   
   Here is no need to add api to control `group` resource?
   And I think label should be a common feature for all resource not just route
   
   
   > I will replace @liuxuran to implement the related functions of the 
`manager-api`. I have two ideas for the function implementation:
   > 
   > 1. At present, the simplest implementation method is to obtain all the 
`route`, `service` and other `objects` containing labels and traverse them to 
match the `label` implementation related functions. However, with the growth of 
business volume, this may not be the best implementation method.
   > 2. The second method is to refer to the similar implementation method of 
`indexer` of `kubernetes` to implement a method: `label-indexer`, which uses 
the method of `key (label): values (obj-tag)` to manage the relevant data in 
memory, and refresh the data through the etcd's watch mechanism. This method is 
very complex to implement, but I think it's OK for both the user's data volume 
becoming larger and the subsequent related functions It will be better.
   > 
   > This is my current idea for function implementation. Please see if you 
have any better suggestions.
   > 
   > thks!
   
   IMO, the first one is not a option, because we do not need to walk all 
resource, label selector is used for a single resource type and not across 
resources type.
   Then the second one is fine and easy to implement base on current 
architecture, because we already watch resources to memory cache like k8s, 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to