Comments (11)
oh and another reason exclude
did not work is that not all kinds from a group is implemented so excluding by group will also remove the Kinds I actually want to load :( Would be nice if exclusion can be done by Kind as well
from kdash.
Ah, if you need to do it more granularly than by group then you're not saving api requests anyway so you may as well do the filtering you are already doing in that case.
from kdash.
btw CORE_GROUP
is just a shorthand to refer to the apiVersion: v1 resources (which doesn't have a group)
so CORE_GROUP is ""
from kdash.
A Generic view would be nice - based on CRDs e.g.
- prometheus-operator: Prometheus,ServiceMonitor,PodMonitor, PrometheusRule, alertmanager,alertmanagerConfig
- logging-operator: ClusterFlow,Flow,ClusterOutput,Output
- fluxcd: GitRepository,HelmRepostory, Kustomize, HelmRelease
- cert-manager: ClusterIssuer, Issuer, CertificateRequest, Request, Challanges
- traefik: Middleware, IngressRoute
- many more
from kdash.
@genofire Yes would be nice but the initial infra for that probably would need some refactoring of the current codebase and unfortunately, I don't have enough time for that. If you or someone else wanna take a shot, I'll welcome it.
from kdash.
@clux do you think it is feasible to get all the resources on the cluster using api-resources
and then iterate through them and build kube::core::DynamicObject
using the Api::all_with
method and GroupVersionKind
or something similar at runtime? I tried to play around with that but my Rust foo is not good enough it seems and got stuck at type mismatch and complex trait definitions
from kdash.
..should is possible for you to display arbitrary dynamic resources, yep. have enough on my plate atm, but can offer some points:
KubeResource
impls like this should be easy enough to replace in, probably something like:
struct DynamicObjectWrapper(DynamicObject)
impl KubeResource<Value> for DynamicObjectWrapper {
fn get_k8s_obj(&self) -> &Value {
&self.0.data
}
}
-
you'd have to keep around discovery information for the types you wanted to show (or fully constructed
Api
objects), because you have these generic helpers to fetch that relies onDynamicType: Default
inLines 364 to 423 in fee3d4b
DynamicType
). These are usually kept in examples asar
. See https://github.com/kube-rs/kube/blob/main/examples/dynamic_api.rs . Might be easiest to keep around fully constructedApi
objects from discovery and look those up at runtime instead. -
you won't have a sensible thing to use to display columns easily in the ui. you'd have to cross reference with the crd schema and look at printer columns if you wanted to do this, which means you'd have to cache crds in the app, but that's probably not a big deal
-
kube::discovery
can be configured to exclude the common types you've already implemented. meaning you shouldn't need to run into duplicates from discovery with your catch-all dynamic, and you'd speed up the process a bit -
discovery takes a little bit of time (the api requires a lot of iteration). caching the discovery result would be better for a snappy CLI. there's an open issue for this in kube, but no one has really volunteered for it.
from kdash.
@clux Thanks for the info 🙏 . Its really helpful. I'll try to cook something up based on this and see how far I get
from kdash.
@clux I built something based on your suggestion fb4b4c4
It only shows name, namespace and age in columns for now. Maybe in the future I can cross ref with CRDs to find other columns to show
from kdash.
Hey, nice. That was quick! Code wise looks very sensible to me from a quick scan.
Minor point; you might be able to make the discovery exclusion a little less hard codey by doing https://docs.rs/kube/latest/kube/discovery/struct.Discovery.html#method.exclude then giving it the CORE_GROUP
, plus the main other other groups that you definitely specialise (authorization, apps, etc). Then you won't even ask the api to discover these, plus you'll have a clearer delineation boundary.
from kdash.
Thanks for taking a look @clux appreciate that. I did try the exclude but wasn't working for the core group. What exactly is the key for that?
from kdash.
Related Issues (20)
- kdash doesn't respect HTTPS_PROXY environment variable HOT 8
- Chocolatey Package for 0.4.3 is not available HOT 1
- kdash reacts to key-down and key-up events and jumps two records at the time HOT 4
- Packaging for openSUSE: test app::pods::tests::test_pod_from_api fails HOT 2
- Key presses detected multiple times
- MacOS not loading from ~/.kube/config HOT 13
- Welcome to Code Autopilot
- Implement a --debug flag to allow users to debug issues easily HOT 1
- Look into mac ports distribution HOT 1
- Error "Failed to get dynamic resources. SerdeError(Error("invalid value: string \"v1alpha3\", expected v1", line: 3, column: 25))"
- Colors are all messed up in macOS default terminal app
- Colors are all messed up in Windows powershell
- Context can take minutes to change
- Namespace quick text filter HOT 1
- Pods list slow to update when namespace selected
- Logs view only tails - it could be helpful to view existing logs
- Enter wrong pod when using "global filtering by resource name" HOT 2
- Show/Hide info bar <i> should auto unhide when Toggling filter <f> HOT 2
- Configure CLI Info
- [Feature] Search/filter resources kinds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kdash.