kurator-dev / kurator

Unified resource orchestration, unified scheduling, unified traffic management and unified telemetry for distributed cloud
https://kurator.dev
Apache License 2.0
242 stars 39 forks source link

Investigating support GraphQL #29

Open hzxuzhonghu opened 2 years ago

hzxuzhonghu commented 2 years ago

What would you like to be added:

FYI https://graphql.org/

GraphQL is a query language for your API, and a server-side runtime for executing queries using a type system you define for your data.

The benifit is Get many resources in a single request

As how to support GraphQL, i donot have a clear thought right now. Any comments are welcomed.

Why is this needed:

Currently, if we want to check a workload and its correslated resources, we must do many queries. With graphQL supported, this can be largely saved.

zirain commented 2 years ago

do you means something like ELK api?

prodanlabs commented 2 years ago

In what way to query and output the log? add command kurator logs

hzxuzhonghu commented 2 years ago

After searching more, i found https://github.com/onelittlenightmusic/kubernetes-graphql does exactly what I want.

Read https://scientya.com/search-kubernetes-world-with-graphql-1c57888c2f22 for more details.

unfortunately, I did not install it successfully according to the guide.

prodanlabs commented 2 years ago

hi @hzxuzhonghu , what do you think of this. https://github.com/hasura/graphql-engine

prodanlabs commented 2 years ago

unfortunately, I did not install it successfully according to the guide.

I successfully installed using helm. FYI

helm repo add graphql-mesh https://onelittlenightmusic.github.io/graphql-mesh-docker/helm-chart
helm repo up
helm install my-graphql-mesh graphql-mesh/graphql-mesh

http://8.210.127.57:31713/

hzxuzhonghu commented 2 years ago

Does it support open API convert?

prodanlabs commented 2 years ago

Does it support open API convert?

looks supported. https://hasura.io/blog/turn-your-go-rest-api-to-graphql-using-hasura-actions/

hzxuzhonghu commented 2 years ago

We need automatically do this, can make use of kubernetes' swagger.json

prodanlabs commented 2 years ago

@hzxuzhonghu I think this is good, what do you think. https://docs.cloudgraph.dev/querying-kubernetes-data

hzxuzhonghu commented 2 years ago

It seems this https://github.com/cloudgraphdev/cloudgraph-provider-kubernetes#supported-services is not automatically converted, while https://github.com/onelittlenightmusic/kubernetes-graphql make use of graphqlMesh, which can convert from a swagger.json

hzxuzhonghu commented 2 years ago

FYI how graphql-mesh handles openapi https://www.graphql-mesh.com/docs/handlers/handlers-introduction