kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.55k stars 326 forks source link

Decentralize API Server #5073

Open jakubdyszkiewicz opened 1 year ago

jakubdyszkiewicz commented 1 year ago

Description

pkg/api-server tries to gather all the endpoints in one package. The result is that API Server takes a lot of dependencies and is very bloated.

func NewApiServer(
    resManager manager.ResourceManager,
    meshContextBuilder xds_context.MeshContextBuilder,
    wsManager customization.APIInstaller,
    defs []model.ResourceTypeDescriptor,
    cfg *kuma_cp.Config,
    enableGUI bool,
    metrics metrics.Metrics,
    getInstanceId func() string, getClusterId func() string,
    authenticator authn.Authenticator,
    access runtime.Access,
    envoyAdminClient admin.EnvoyAdminClient,
) (*ApiServer, error) {

What we should do instead is what we've done with pkg/dp-server package. Which is to provide the backbone of api-server, but define and register the endpoints in a corresponding packages. For example:

As we are ramping up GUI work, I expect new APIs, which will make this problem worse. Testing is also much easier this way, because you don't need to build the whole API Server that now has dependency on MeshContextBuilder just to test /config.

github-actions[bot] commented 1 year ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 1 year ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 11 months ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 8 months ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] commented 5 months ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.