In Apr 2019 we modularized the chart component used by Kiali to render inbound/outbound and runtime metrics in a library called k-charted.
This library has two parts: backend and frontend.
Backend performs queries to k8s and prometheus, and frontend provides the dashboard charts used for the metric detail tabs.
In code, it creates two dependencies that need to be updated on new changes both in backend and frontend.
There are a lot of pros/cons of this pattern but today Nov 2020 perhaps it makes sense to re-consider to move the code into the kiali repo to simplify some aspects.
This is a list of reasons for this proposal:
- Reduce the dependencies and the bump of versions for minor changes (in UI mostly, the backend looks quite stable).
- Put all communication from Kiali to backend in a single location to share caching, and other potential techniques for optimization and re-use queries).
- Both kiali and k-charted uses the same dependencies on k8s and p8s clients, when upgraded, needs to be updated in both.
- UI tends to need minor maintenance (CSS, z-index issues, etc).
In general, I guess that k-charted is very tight to kiali in terms of business and team would benefit to have the code located in a single place.
Another reason, in the context of the multi-cluster effort is clear that Kiali would need to query more than one single endpoint for k8s/p8s/tracing, so having this logic located in a single point would help in general (if not, k-charted would need also to adopt same design used by kiali when multiple cluster are defined).
This is not a refactoring, logic and components should be untouched/unchanged and we don't want to miss the very good storybook that k-charted implements, it's more just to move the code to a single repo.
Joel and I had some preliminary chat about it and we would like to get more inputs from the team about this proposal.