kubernetes-sigs / kui

A hybrid command-line/UI development experience for cloud-native development
Apache License 2.0
2.84k stars 183 forks source link

How to deploy kui hosted client-server in a k8s server ? #9331

Closed gberche-orange closed 8 months ago

gberche-orange commented 1 year ago

Thanks for sharing kui with the community !

Expected

As a newcomer, In order to deploy kui into a k8s cluster I need some support with pre-built client-server binaries with associated K8S deployment automation (K8S resources spec files, or helm chart)

Observed

starpit commented 1 year ago

hello there! thanks for the questions.

Build image kuishell/kui

This will build a docker image kuishell/kui that includes the kui proxy and the kui client, and an nginx that will serve up both. It is also possible to build a "serverless" version that runs kui as a static single page web app.

npx kui-build-docker-with-proxy

Test run it

npx kui-run-cproxy

then visit http://localhost:9080

If that works, then you are well on your way. For kube deployments, there is a sample yaml here.

From there, you can customize things, e.g. the favicon, app name, etc. Perhaps the best way to do this is to make your own kui client repo (you can start with the template: https://github.com/kui-shell/KuiClientTemplate).

from there, you can choose which kui plugins to include (see the package.json in the template). you can also configure icons and names in plugin-client-default/config.d/{icons,name}.json. The same build scripts above would work from the client template repo.

it is also possible to work off a fork of this main repo. but then, you wouldn't have the opportunity to be selective about which kui plugins to include in your service. nor would you be able to use npm semver to track base kui functionality. but both ways can work!

starpit commented 1 year ago

Some words of warning: the stock kui builds do not include an authentication scheme. So if you want to expose a full proxy-backed kui within a browser, this is something you will need to roll your own on.

gberche-orange commented 1 year ago

Many thanks @starpit for your prompt response !

In order to share the effort of building the container images, and speed up a sample kui k8s deployment, would it make sense to have the kui github workflow ci run the npx kui-build-docker-with-proxy command and publish the associated container image (e.g. in dockerhub or in the ghcr associated with this repo) ?

Should this github workflow and container images also or instead be located into the https://github.com/kui-shell/KuiClientTemplate repo ?

This may also help people forking this repo either publicly or privately.

From there, it might make sense to extract the sample k8s yaml into a helm chart and see ways the UX customizations could be injected into the main image without requiring change to the kui-proxy and standard upstream kui-client container image, such as:

Some words of warning: the stock kui builds do not include an authentication scheme. So if you want to expose a full proxy-backed kui within a browser, this is something you will need to roll your own on.

Maybe the helm chart could also ease deployment of an authN/authZ proxy, such as https://artifacthub.io/packages/helm/bitnami/oauth2-proxy

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 9 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 8 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/kui/issues/9331#issuecomment-1950844240): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.