k8sgpt
k8sgpt copied to clipboard
[Feature]: Enhance Caching Functionality
Checklist
- [X] I've searched for similar issues and couldn't find anything matching
- [X] I've discussed this feature request in the K8sGPT Slack and got positive feedback
Is this feature request related to a problem?
None
Problem Description
Consistency is key for K8sGPT, as it ensures ease of use and speed. Therefore, it would be beneficial to implement Cmd logging functionality for cache similar to what is done for auth, integration, and filter commands.
While the current implementation of adding caching functionality is commendable, there are some necessary improvements that can be made:
Issues with the current caching setup include:
- Lack of visibility into which cache provider stores the data.
- Ability to add the same cache provider multiple times.
- Ability to remove the same cache provider multiple times without adding.
Solution Description
- Implement a list command for caching that functions similarly to other commands.
- Introduce a command to retrieve all cache data along with the cache provider's name.
- Prevent the addition and removal of the same cache provider multiple times.
1) List command:
Update a list command for caching that functions similarly to auth, filter, and integration list commands.
k8sgpt cache list
Default:
> local
Active:
> local
Unused:
> s3
> azure
> gcs
2) Data command:
Introduce a command that retrieves all cache data along with the name of the used cache provider.
k8sgpt cache data
File Based Cache
+------------------------------------------------------------------+--------------------------------+
| NAME | UPDATEDAT |
+------------------------------------------------------------------+--------------------------------+
| 08145659bd5319a43e3a1c156ea8577f748406b58f8f5bc8bf8140a635a18b88 | 2024-01-28 11:15:46.237219005 |
| | +0530 IST |
| 1154421dd90eb4b87accb40fc87547c2a101bd8c1f757ba4972746c161227a56 | 2024-02-07 14:30:50.632951629 |
| | +0530 IST |
+------------------------------------------------------------------+--------------------------------+
3) Add & Remove command: Prevent the addition and removal of the same cache provider multiple times.
Benefits
Improved visibility: Users will have better insight into which cache provider stores the data, enhancing transparency.
Prevents redundancy: By disallowing the addition of the same cache provider multiple times, we can avoid redundancy in caching, leading to better resource utilization.
Enhanced user experience: Implementing these improvements will streamline the caching process, resulting in a smoother user experience and improved performance.
Potential Drawbacks
No response
Additional Information
Feel free to provide any further context or insights related to this caching enhancement request. Your feedback and suggestions are highly valued as we work towards improving our project's caching functionality for the benefit of all users.
Can you help us understand what the actual use case might be for this?
Yeah, sure,
-
I encountered some difficulties while using the cache provider :
- When using the
auth
,filter
, andintegration
commands, I usually used thelist
command to view all available options and view active and deactivate status. However, with caching, it returns all cached data. - If I forget which cache provider I integrated last time, there is no way to check it, and I have to re-add the cache provider.
- When using the
By incorporating the features mentioned above, we can achieve the same behaviour as in other auth, filter, and integration commands. This approach would lessen the need to memorize various details for cache functionality, as the same behaviour would be consistent across all commands.
So updating the list
command to display both active and unused states, and implementing additional commands like data
(or perhaps something else) for return all cached data would be highly beneficial in this situation.
I believe I understand the enhancement you want to make, I would be supportive of this work.