You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/02/07 14:36:18 UTC

[GitHub] [apisix-dashboard] liuyang211 opened a new issue #1456: support etcd pefix as apisix does

liuyang211 opened a new issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456


   # Feature request
   
   ## Please describe your feature
   
   apisix has supported etcd prefix to store different clusters' configuration. Dashboard should also support this.
   This is very useful in some resource limited situation like dev/test environment.
   
   ## Describe the solution you'd like
   
   set multiple prefix in one dashboard, and let the user choose which apisix cluster he want to manage.
   
   ## Describe alternatives you've considered
   
   Not yet.
   
   ## Additional context
   
   Thank you!
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-774813861


   Nice idea, @starsz @nic-chen What's your opinion?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
starsz commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-779585231


   Now, the routes are set in the `api/internal/hander/*.go`
   IMO, we can configure the `prefix` in the `conf.go` and use the `gin.Group` to set the prefix of route.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 edited a comment on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 edited a comment on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780277256


   > @liuyang211
   > 
   > The detailed steps are as follows:
   > 
   > 1. Configure the prefix in yaml:
   >    https://github.com/apache/apisix-dashboard/blob/master/api/conf/conf.yaml#L24-L31
   > 2. Read configuration
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L135-L158
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L222-L234
   > 3. Use configuration
   >    `BasePath: "/apisix/consumers"`, `BasePath: "/apisix/routes"` is the prefix of various resources
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/store/storehub.go#L83-L181
   > 
   > you could have a try : )
   
   Thank you, I've done it. But I modified this, is that OK?
   2. Read configuration
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L66-L71
   
   And use the global variable conf
   ```go
   	err := InitStore(HubKeyConsumer, GenericStoreOption{
   		BasePath: conf.ETCDConfig.Prefix + "/consumers",
   		ObjType:  reflect.TypeOf(entity.Consumer{}),
   		KeyFunc: func(obj interface{}) string {
   			r := obj.(*entity.Consumer)
   			return r.Username
   		},
   	})
   ```
   
   BTW, it seems that one dashboard can only manage one apisix cluster if /web remains the same.
   I think it would be better, if dashboard can manage multiple apisix clusters. The prefix is passed as a parameter to api by web.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-774901048


   > Nice idea, @starsz @nic-chen What's your opinion?
   
   great.
   @liuyang211 would you like to submit a
   PR for this feature? ^_^


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen edited a comment on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen edited a comment on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-775581189


   > Sorry, I didn't program in both go and javascript before. That would be a great challenge to me.
   
   it needs only `go` for this feature. and we could help you finish this pr together, if you are interested.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780650556


   > > And use the global variable conf
   > 
   > It's ok. But we need to make sure that `conf.ETCDConfig.Prefix` has a default value.
   
   I've created a PR, but 3 checks fail. Can you review that code, and what should be fixed?
   Thanks.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz edited a comment on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
starsz edited a comment on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-779585231


   ~~Now, the routes are set in the `api/internal/hander/*.go`
   IMO, we can configure the `prefix` in the `conf.go` and use the `gin.Group` to set the prefix of route.~~
   
   Oh. @liuyang211.You can follow step by @nic-chen.
   And just ignore my steps. My step is to configure the prefix in the route.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] starsz commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
starsz commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-774883757


   Pretty good. I think it's a good idea.
   PRs are welcomed.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-779801616


   @liuyang211 
   
   The detailed steps are as follows:
   
   1. Configure the prefix in yaml:
   https://github.com/apache/apisix-dashboard/blob/master/api/conf/conf.yaml#L24-L31
   
   2. Read configuration
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L135-L158
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L222-L234
   
   3. Use configuration
   `BasePath: "/apisix/consumers"`, `BasePath: "/apisix/routes"` is the prefix of various resources
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/store/storehub.go#L83-L181
   
   
   you could have a try : )
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780584376


   > I think it would be better, if dashboard can manage multiple apisix clusters. The prefix is passed as a parameter to api by web.
   
   It's great feature. But we don't recommend to use an ETCD cluster for multiple APISIX clusters.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-779192789


   > > Sorry, I didn't program in both go and javascript before. That would be a great challenge to me.
   > 
   > it needs only `go` for this feature. and we could help you finish this pr together, if you are interested.
   
   I would like to have a try.
   I've viewed the apisix-dashboard\api\ these days. But I still don't get the point.
   So where should I start?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 edited a comment on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 edited a comment on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780277256


   > @liuyang211
   > 
   > The detailed steps are as follows:
   > 
   > 1. Configure the prefix in yaml:
   >    https://github.com/apache/apisix-dashboard/blob/master/api/conf/conf.yaml#L24-L31
   > 2. Read configuration
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L135-L158
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L222-L234
   > 3. Use configuration
   >    `BasePath: "/apisix/consumers"`, `BasePath: "/apisix/routes"` is the prefix of various resources
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/store/storehub.go#L83-L181
   > 
   > you could have a try : )
   
   Thank you, I've done it. But I modified this, is that OK?
   2. Read configuration
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L66-L71
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L228-L233
   
   And use the global variable conf
   ```go
   	err := InitStore(HubKeyConsumer, GenericStoreOption{
   		BasePath: conf.ETCDConfig.Prefix + "/consumers",
   		ObjType:  reflect.TypeOf(entity.Consumer{}),
   		KeyFunc: func(obj interface{}) string {
   			r := obj.(*entity.Consumer)
   			return r.Username
   		},
   	})
   ```
   
   BTW, it seems that one dashboard can only manage one apisix cluster if /web remains the same.
   I think it would be better, if dashboard can manage multiple apisix clusters. The prefix is passed as a parameter to api by web.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen closed issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-775225849


   > > Nice idea, @starsz @nic-chen What's your opinion?
   > 
   > great.
   > @liuyang211 would you like to submit a
   > PR for this feature? ^_^
   
   Sorry, I didn't program in both go and javascript before. That would be a great challenge to me.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-775581189


   > Sorry, I didn't program in both go and javascript before. That would be a great challenge to me.
   
   it deeds only `go` for this feature. and we could help you finish this pr together, if you are interested.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780581363


   > And use the global variable conf
   
   It's ok. But we need to make sure that `conf.ETCDConfig.Prefix` has a default value.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuyang211 commented on issue #1456: feat: support etcd prefix as apisix does

Posted by GitBox <gi...@apache.org>.
liuyang211 commented on issue #1456:
URL: https://github.com/apache/apisix-dashboard/issues/1456#issuecomment-780277256


   > @liuyang211
   > 
   > The detailed steps are as follows:
   > 
   > 1. Configure the prefix in yaml:
   >    https://github.com/apache/apisix-dashboard/blob/master/api/conf/conf.yaml#L24-L31
   > 2. Read configuration
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L135-L158
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L222-L234
   > 3. Use configuration
   >    `BasePath: "/apisix/consumers"`, `BasePath: "/apisix/routes"` is the prefix of various resources
   >    https://github.com/apache/apisix-dashboard/blob/master/api/internal/core/store/storehub.go#L83-L181
   > 
   > you could have a try : )
   
   Thank you, I've done it. But I modified this, is that OK?
   2. Read configuration
   https://github.com/apache/apisix-dashboard/blob/master/api/internal/conf/conf.go#L66-L71
   
   And use the global variable conf
   `	err := InitStore(HubKeyConsumer, GenericStoreOption{
   		BasePath: conf.ETCDConfig.Prefix + "/consumers",
   		ObjType:  reflect.TypeOf(entity.Consumer{}),
   		KeyFunc: func(obj interface{}) string {
   			r := obj.(*entity.Consumer)
   			return r.Username
   		},
   	})
   `
   
   BTW, it seems that one dashboard can only manage one apisix cluster if /web remains the same.
   I think it would be better, if dashboard can manage multiple apisix clusters. The prefix is passed as a parameter to api by web.
   


----------------------------------------------------------------
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:
users@infra.apache.org