kruize / autotune

Autonomous Performance Tuning for Kubernetes!
Apache License 2.0
158 stars 54 forks source link

Multiple Import Metadata actions #1178

Closed shreyabiradar07 closed 3 months ago

shreyabiradar07 commented 5 months ago

This PR has following changes:

Example input_datasource.json (same as that of import dsmetadata request body)

{
    "version":"v1.0",
    "datasource_name":"prometheus-1"
}
shreyabiradar07 commented 4 months ago

@msvinaykumar can you please review the PR

msvinaykumar commented 4 months ago

@shreyabiradar07 can you start MD file describe above functionality

shreyabiradar07 commented 4 months ago

@shreyabiradar07 can you start MD file describe above functionality

Documented delete metadata functionality in KruizeLocalAPI.md as part of PR 1174

msvinaykumar commented 4 months ago

UI Flow --> First get if no data then POST and get if still no data then give up (Display error if any) also Refresh button should be avaible

curl -X post http://${URL}/dsmetadata -d @./input_datasource.json

For above request in backend Check if data available in db if yes delete and fetch again from cluster and save it db if no fetch from cluster and save it db

curl -X post http://${URL}/dsmetadata -d @./input_datasource.json

For above request in backend Check if data available in db if yes fetch from cluster and save it db

curl -X get http://${URL}/dsmetadata?datasource_name="abc" Check if db having data if yes return data if no 404 not found

UserWorflow By default metatdata is prefetched using this URL (This happens as part of kruize pod startup) OR fetch button at UI curl -X post http://${URL}/dsmetadata -d @./input_datasource.json there after user will have get operation curl -X get http://${URL}/dsmetadata?datasource_name="abc" if user wants to refresh then this api is called curl -X post http://${URL}/dsmetadata -d @./input_datasource.json

      when user click on cluster -> trigger 
                          curl -X get http://${URL}/dsmetadata?datasource_name="abc"  by default

No need of refresh flag

msvinaykumar commented 4 months ago

{ "version":"v1.0", "datasource_name":"prometheus-1" } should have option to provide cluster_name , namespace , workload , container_name

msvinaykumar commented 4 months ago

@shreyabiradar07 please set up code walk through session