Web-based client for Kubernetes
Problem to solve
In order to interact with the Kubernetes API from the frontend (via KAS), we need a client of some sorts. Unfortunately, the official javascript client, kubernetes-client/javascript
, does not support web browsers yet.
Proposal
-
Create a project for the client under gitlab-org <-- @hfyngvason -
Generate the client using the javascript generator <-- @hfyngvason -
Publish the client in npm <-- @anna_vovchenko - [-] Include it in
package.json
<-- @anna_vovchenko (will be done within the first frontend MR)
Evaluated options
A few options:
- Port
kubernetes-client/javascript
to the browser. Start with a fork and then contribute the work upstream when we're happy with our results. -
Chosen option: Wait for upstream to solve the problem. In the meantime, use an OpenAPI scaffold generated in a similar way to the Kubernetes client, i.e. using the
typescript-fetch
generator (docs), or maybe even just thejavascript
generator but without a dependency onnode-fetch
. - Wait for upstream to solve the problem. In the meantime, wrap the REST API calls we need on a case-by-case basis.
In the long run, I think (1) is the best solution, but starting with (2) or (3) would get us results faster.
References
I've prepared a PoC project for approach (2). This makes it possible to start building a real interactive web UI for Kubernetes without waiting for the KAS part to be finished.
Edited by Anna Vovchenko