Revolyssup commented on PR #2550:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2550#issuecomment-3284537023

   > > I don't think it should be a standalone server, rather than a part of 
the ingress controller API.
   > 
   > **Suggestion: Move the debug API into the unified Ingress Server**
   > 
   > In the current implementation, the debug HTTP server is started directly 
inside the `provider`. While this works, it introduces several issues:
   > 
   > * **Tight coupling of responsibilities**: The provider’s job is to 
synchronize resources, not to start its own HTTP server.
   > * **Lack of configurability**: Port, paths, authentication, etc. are 
“black-boxed” inside the provider and cannot be configured or extended 
externally.
   > * **Harder to extend**: If other components later need to expose debug 
endpoints, you will end up with multiple scattered servers.
   > 
   > A cleaner approach is to:
   > 
   > * Start a unified api server at the Ingress Server layer, e.g.:
   > 
   > ```go
   >   srv := NewServer(":9090")
   >   srv.Register(&addcDebugAPI{})
   >   srv.Register(&systemAPI{})
   >   mgr.Add(srv)
   > ```
   > 
   > * Let each component (including the provider) only implement a 
RegisterHandlers/DebugProvider interface to attach its handlers, without 
starting its own server.
   > * This way, port, authentication, middleware, etc. can be configured in 
one place, and the server lifecycle follows the manager.
   
   done


-- 
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-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to