-
Notifications
You must be signed in to change notification settings - Fork 265
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
Run dashboard as a client application #1388
Comments
This approach would be in addition to the existing deployed service option, right? How do you propose it handles lack of permissions? For example, if I only have read access to PipelineRuns. |
Yes this would be in addition to the current model. We already have a read-only mode for the deployed service, so I would expect it to behave in the same way by disabling any items the user does not have permission to use, e.g. Import Resources, Create PipelineRun, etc. The permissions handling needs to be more fine grained than what we have today, maybe using SubjectAccessReview / SelfSubjectAccessReview or similar, and ideally would apply to both models. There's some related work in progress in #1018 to limit dashboard access to a single namespace. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-lifecycle rotten |
@AlanGreene: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We've made some changes to the Dashboard backend APIs and how the frontend code interacts with them since this was last updated so we'll need to revisit this but I suspect it should still largely work as originally demonstrated. Either way we (realistically 'I'...) should document the approach fully (in dev docs?) and add tests to ensure future changes remain compatible with this design. One of the changes I suspect may cause some trouble is the CSRF token flow, so we should consider how best to disable or modify that when running in this mode. |
Some more musings on the CSRF token flow for the Anyway, first step is to test with the current codebase as described above and see what gaps need to be addressed. |
CSRF protection updated to be compatible so that's no longer a concern, and #1907 sets fallback values for properties such as 'ReadOnly' when we detect we're in client mode so that more of the UI is available by default. If the user doesn't have the required permissions to perform a given action we'll surface the error to them. The next steps would be to improve:
|
Can this be added to tekton cli? It would be good to tell developers to only install one tool and then they can access the dashboard and automatically uses their kubeconfig |
It could be added as an optional plugin and that should work today with the way both pieces are currently set up (add a symlink from |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen |
We should be able to revisit this once #1842 and #2103 are complete as we'll be using a new approach for the websocket connections that's directly compatible with that needed when using For distribution we should consider similar approaches to the Tekton CLI, although we may not provide all of the same options. At a minimum we should provide a tarball, Homebrew support (see the |
Hoping to revisit this in the near future, likely as alpha/experimental for a while to get broader testing and feedback before including as an official install option. This would also help drive the changes described in #2287 as we'd be far more likely to encounter non-default (from Dashboard's point of view) RBAC. I'll update the demo Homebrew formula with a new build while doing the Dashboard v0.33 release in the next couple of weeks so we have something more current to play with and can get a better picture of the work required. It would be useful to run the browser E2E tests (or a subset at least) against the Dashboard in this mode. Once it's in a slightly more polished state we can work on including it in our existing release process and document it properly. |
/area roadmap |
Published an updated bundle for v0.43.1: https://github.com/alangreene/homebrew-tektoncd |
Expected behavior
I would like to have a dashboard experience running as a client app without requiring a new service running in my cluster. This should also ensure the application is only running with the permissions that I have in the cluster.
Actual behavior
The Dashboard currently requires a service running in the cluster, and provides the same level of access to all users, i.e. all users can act with the same permissions granted to the dashboard service account.
Additional Info
There appear to be 3 main categories of kubernetes UI:
Octant(deprecated)Since the Tekton Dashboard is mostly just using the kubernetes APIs directly with very few of its own custom APIs, it should be possible to provide something similar to 2.
In fact, the current Dashboard front end code can be used unmodified as a frontend for
kubectl proxy
with much of the basic read-only functionality working.Demoed on the working group call 2020/05/18
Steps:
npm run build
(puts static frontend resources in<path_to_dashboard_project>/dist/
)kubectl proxy --port 9876 --www="<path_to_dashboard_project>/dist" --www-prefix=/ --api-prefix=/proxy
http://localhost:9876
Limitations with unmodified code:
kubectl proxy
directly with some changes to the Dashboard frontend code, it may be possible to detect this and automatically switch approaches but would need further investigationWith some minor modifications to the code we get much closer to the full dashboard experience:
There are also some minor differences in behaviour between our proxied APIs and using
kubectl proxy
, for example in Create PipelineRun our API returns a 200 response with a body containing the created PipelineRun. The API viakubectl proxy
returns a 201 with a body. We don't expect a body with a 201 response so only return the headers, meaning the create dialog doesn't get closed automatically. This should be simple enough to remedy.Obviously we can't expect users to checkout and build the code themselves just to run the Dashboard app. Since all we need is the output of the frontend build we can distribute this in a number of ways, the simplest (?) being hosting a tarball of the static assets and a simple launch script for users to download and run.
TL;DR
The approach I demoed on the working group used a Homebrew Formula (https://github.com/AlanGreene/homebrew-tektoncd/blob/master/Formula/tektoncd-dashboard.rb)
brew install alangreene/tektoncd/tektoncd-dashboard
tkn-dashboard
(automatically launches browser)We can build additional behaviour into the install / launch scripts as needed, e.g. detect tenant namespace (#1018) and automatically launch the browser with the corresponding URL, customise features (enable Triggers), etc.
/kind feature
The text was updated successfully, but these errors were encountered: