cyclops-ui / cyclops

Developer Friendly Kubernetes 👁️
https://cyclops-ui.com
Apache License 2.0
2.48k stars 779 forks source link

UI representation for `ClusterRoles` #509

Open petar-cvit opened 2 months ago

petar-cvit commented 2 months ago

Some K8s components are supported to have a custom UI component, and those can be found here. The scope of this issue is to support ClusterRoles. The new ClusterRole component should be similar to other components we already have, so feel free to check the existing ones out.

The visual representation should look something like this: image

You can fetch the data about a cluster role by calling the backend on

/api/resources?group=rbac.authorization.k8s.io&version=v1&kind=ClusterRole&name=&namespace=

You can test this using the k6-operator default template.

Refer to this PR on adding new UI components https://github.com/cyclops-ui/cyclops/pull/330

Issue similar to https://github.com/cyclops-ui/cyclops/issues/499

sarthakladhwe commented 2 months ago

Hi @petar-cvit, I’m encountering an issue where the API is returning null for my request. I’ve used the correct information from the resources listed at http://localhost:3000/api/modules/k6-operator/resources and formed the request URL as follows:

http://localhost:3000/api/resources?group=rbac.authorization.k8s.io&version=v1&kind=ClusterRole&name=k6-operator-manager-role&namespace=

Despite this, the response is still null. Could you help me troubleshoot this issue?

petar-cvit commented 2 months ago

Hey @sarthakladhwe, my bad. I mixed up which resources were supported on the backend. ClusterRoles are yet to be supported so this issue will have to wait until then

sarthakladhwe commented 2 months ago

No worries! Just let me know when it's supported, I'd be eager to tackle it. There’s a workaround by parsing manifest YAML into a JS object, but I believe our resources APIs are better suited for that.