Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Design a restful style backend services to handle cluster operations #54

Closed
1 of 2 tasks
Jeffwan opened this issue Oct 3, 2021 · 3 comments
Closed
1 of 2 tasks
Labels
apiserver enhancement New feature or request

Comments

@Jeffwan
Copy link
Collaborator

Jeffwan commented Oct 3, 2021

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

A follow up issue of #53.

web service is one of the convenient way to interact with user. this doesn't require user to have any domain knowledge. At the same time, RESTful API doesn't need any dependency. Curl + json payload is every thing user need.

This backend service underneath should leverage generate clients to interact with RayCluster custom resources(depend on #29). So the chain of component call would be

client -> backend service (using client to create CR) -> apiserver 

Use case

User who don't have kubectl knowledge or permission can use REST API to create/delete Ray Cluster on Kubernetes.

Related issues

#53
#29

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@Jeffwan Jeffwan added the enhancement New feature or request label Oct 3, 2021
@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Oct 3, 2021

Grpc

The GRPC protocol provides an extremely efficient way of cross-service communication for distributed applications. The public toolkit includes instruments to generate client and server code-bases for many languages allowing the developer to use the most optimal language for the task.

Protocol Buffers are a language-neutral, platform-neutral extensible mechanism for serializing structured data. Protoc also provides different community plugins to meet different needs.

Since we may have different clients to interactive with our services, we will generate gateway RESTful APIs and OpenAPI Spec at the same time.

Backend service

The service will implement gPRC server as following graph shows.

  • A ResourceManager will be used to abstract the implementation of CRUD operators.
  • ClientManager manages kubernetes clients which can operate Kubernetes native resource and custom resources like RayCluster.
  • RayClusterClient comes from code generator of CRD

uml-good

@chaomengyuan
Copy link
Contributor

chaomengyuan commented Oct 7, 2021

Just two comments:

  1. maybe change the name "ClientManager" to "KubernetesClientManager" to make it more clear?
  2. Do we need to provide a "ClientAPI" to wrap those rpc calls to those backend servers?

@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Oct 8, 2021

  1. maybe change the name "ClientManager" to "KubernetesClientManager" to make it more clear?

We may need to involve DB later. ClientManager is to manage clients for all resources (kubernetes, db, external deps)

  1. Do we need to provide a "ClientAPI" to wrap those rpc calls to those backend servers?

Both openapi and grpc will be generated. It's not included in PR. Let's review the proto definition in #53 and then I will check them in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apiserver enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants