Skip to content
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

feat(resource-recommend): add resource recommend controller #483

Merged

Conversation

ZhangsongLee
Copy link
Collaborator

What type of PR is this?

Features

What this PR does / why we need it:

this pr is a new feature that enhances Kubernetes resource utilization by providing the ability to recommend resource specifications for workloads. The new controller analyzes historical resource usage, recommend configuration values for cpu and mem.

The controller consists of three main modules

  • DataSourceProvider:for obtaining usage Metrics data, Currently supports reading historical usage data from Prometheus
  • DataProcessor:Use algorithms to process data (query historical usage data for DataSourceProvider and build histograms)
  • Recommender:Combined with the user configuration, the recommended value is calculated from the data processed by the DataProcessor

whiteboard_exported_image

UML
whiteboard_exported_image (1)

Which issue(s) this PR fixes:

Support for recommending resource specifications for workloads

Special notes for your reviewer:

@CLAassistant
Copy link

CLAassistant commented Feb 21, 2024

CLA assistant check
All committers have signed the CLA.

@ZhangsongLee ZhangsongLee force-pushed the feat/lzs-resource-recommend branch 10 times, most recently from 015fe23 to ca0cb72 Compare February 24, 2024 14:00
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 66.15628% with 641 lines in your changes are missing coverage. Please review.

Project coverage is 55.42%. Comparing base (fbb326a) to head (06f7916).
Report is 9 commits behind head on main.

Files Patch % Lines
...commend/controller/resourcerecommend_controller.go 13.04% 98 Missing and 2 partials ⚠️
...roller/resource-recommend/controller/controller.go 14.95% 90 Missing and 1 partial ⚠️
.../controller/resource-recommend/oom/oom_recorder.go 56.69% 52 Missing and 3 partials ⚠️
...nd/datasource/prometheus/mock_prometheus_client.go 4.76% 40 Missing ⚠️
...commend/datasource/prometheus/prometheus_client.go 0.00% 37 Missing ⚠️
...ce-recommend/controller/oom_recorder_controller.go 15.78% 32 Missing ⚠️
...ource-recommend/processor/percentile/process_gc.go 58.33% 23 Missing and 7 partials ⚠️
...lyst-controller/app/options/resourcerecommender.go 45.83% 26 Missing ⚠️
...mmend/datasource/prometheus/prometheus_provider.go 72.72% 21 Missing and 3 partials ⚠️
pkg/util/resource-recommend/types/error/process.go 33.33% 24 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #483      +/-   ##
==========================================
+ Coverage   55.02%   55.42%   +0.40%     
==========================================
  Files         513      552      +39     
  Lines       56727    58881    +2154     
==========================================
+ Hits        31212    32635    +1423     
- Misses      22183    22863     +680     
- Partials     3332     3383      +51     
Flag Coverage Δ
unittest 55.42% <66.15%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZhangsongLee ZhangsongLee force-pushed the feat/lzs-resource-recommend branch 9 times, most recently from f4fbe6c to b544755 Compare February 26, 2024 09:25
@ZhangsongLee ZhangsongLee changed the title [WIP]feat(resource-recommend): add resource recommend controller feat(resource-recommend): add resource recommend controller Feb 26, 2024
go.mod Show resolved Hide resolved
@ZhangsongLee ZhangsongLee force-pushed the feat/lzs-resource-recommend branch 3 times, most recently from b7791f0 to 50e0c00 Compare February 29, 2024 02:21
@ZhangsongLee ZhangsongLee force-pushed the feat/lzs-resource-recommend branch 2 times, most recently from 11a7a33 to 0c74aec Compare March 7, 2024 12:26
caohe
caohe previously approved these changes Mar 7, 2024
caohe
caohe previously approved these changes Mar 14, 2024
@waynepeking348 waynepeking348 merged commit 94c95e4 into kubewharf:main Mar 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants