-
Notifications
You must be signed in to change notification settings - Fork 229
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
Generate Forms from Kubernetes Schema to Create and Edit Resources #2087
Comments
Yeah. This is a very interesting feature we have wanted for a long time. |
Hi, so I would like to contribute the part I've already developed in my plugin (Headlamp-plugin) directly to Headlamp. This includes the addition of the "+" button and the pop-up that shows a form to create a new CR based on the schema provided in the CRD. Would it be ok, to introduce a new dependence : react-jsonschema-form (@rjsf-core) ? Should I create a new component for the "+" button in For now, I have separated the pop-up form into three components:
Should I use the same organization for my contribution ? |
Objective:
The objective is to have a simple way to create CR/Kubernetes resources without using YAML.
Solution:
My solution is to generate a form from the Custom Resource Definition (CRD) schema using an existing library that can generate forms from a JSON schema. On CRD, json schema are defined in the base definition. CRD schema doc
This could be extended to other Kubernetes resources to simplify resource creation and make it more accessible since we can retrieve kubernetes resources schemas from the Kubernetes API.
What I Have Done So Far:
I have developed an initial version of this feature, only for CRD, in our plugin, which is available at Headlamp-plugin. All elements used to dynamically create the form are located under Headlamp-plugin/src/Components/Form/.
To create this version, I've used react-jsonschema-form (@rjsf-core) to generate the forms. Currently, I couldn't use the Material 5 theme, but it is available with react-Jsonschema-form, as mentioned here: RJSF/Themes.
I've added a simple "plus" button on the CRD details page that, when pressed, makes a popup with the form appear.
Here is what it looks like on a simple example CRD, with a basic name and description string:
I think this would be an interesting feature for base Headlamp that would make the creation of CR and Kubernetes resources more user-friendly.
I've just remembered this related issue : #1220
The text was updated successfully, but these errors were encountered: