-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add CPU Manager related configs #756
Conversation
2dfd038
to
3645ce8
Compare
3645ce8
to
5edb13a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brandboat! I have a few questions/comments, just to make sure I understand everything :-)
-
We're setting
system-reserved
andkube-reserved
to the same value. AIUI these are cumulative, so in the case of (for example) a 2 core system, this would reserve 60 + 10 + 400 == 470 for each of those values, meaning a total of 940 mcpu reserved for system + kubernetes usage? -
Those two config files (
/etc/rancher/rke2/config.yaml.d/99-z00-harvester-reserved-resources.yaml
and/etc/rancher/rke2/config.yaml.d/99-z01-harvester-cpu-manager.yaml
) will be embedded in/oem/90_custom.yaml
, which means they'll be rewritten on every system boot, i.e. each host will always start withsystem-reserved
andkube-reserved
set as they were during initial installation, andcpu-manager-policy=none
. I know we need to later setcpu-manager-policy=static
to use CPU pinning, but how do we persist that over a reboot? -
I assume we'll also need a separate PR for harvester to handle the upgrade case, to add those two config files for existing systems?
Thanks for the review !
Yes you are right, like you mentioned under a two core system, harvester reserved almost one core.
Good catch, I will remove
Yep we do have another PR handle the upgrade path, see https://github.com/harvester/harvester/pull/6190/files#diff-43150fc991c91f07946cd41d2d0311c58a9f5deb4c061e1cf3ed11b9cd3dde3b |
5edb13a
to
d9b22f5
Compare
I also have some question about that, just check with below case: Seems most common configuration is reserved almost 1 core for the amount of system/kube service (ratio, 1:1). Maybe we could adjust the system: kube service ratio to 2:3?
And who will handle the config
|
Thanks for the comment @Vicente-Cheng !
Fair enough. I'll make systmReserved = kubeReserved * (2/3). c.c. @bk201, @ibrokethecloud, @tserong
Yes, cpu manager controller will submit job to write cpu manager policy config to |
d620ffc
to
24ce709
Compare
24ce709
to
0d8f7a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, for the ratio between system/kubernetes, we could keep the 1:1 at this moment.
Sorry, I noticed you already changed the ratio.
Now, the system will have 2/3 kube reserved, but the kube reserved did not gain the extra 1/3 from the system.
Could you recheck it?
Yeah, that's my reading too. Working through a previous example, we started with a system:kube ratio of 1:1: 2 cores -> 470 for system/kubernetes -> total 940 With the most recent change it looks like this gives us a system:kube ration of ~1:1.5, but the overall total is lower than before: 2 cores -> 470 * 2/3 = 313 system + 470 kube -> total 783 I really don't know what the best value or ratio is here... :-/ |
Add new config file: - rke2-99-z00-harvester-reserved-resources.yaml: which includes system-reserved and kube-reserved CPU resources, kube-reserved follow the GKE CPU reservation formula for calculating reserved CPU resources, and system-reserved is 2/3 kube-reserved cpu resource. Signed-off-by: Cooper Tseng <[email protected]>
Signed-off-by: Cooper Tseng <[email protected]>
0d8f7a3
to
9207ac2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our supported CPU requirement is 16 for production and 8 for testing. I guess reserving ~1 core for kube/system is OK and we can fine-tune the value if needed.
@Mergifyio backport v1.4 |
✅ Backports have been created
|
Problem:
This is a prerequisite pr for implementing CPU Pinning. We need to add the cpu manager configs first.
system-reserved
,kube-reserved
,cpu-manager-policy
.Solution:
Introduced two configs files:
rke2-99-z00-harvester-reserved-resources.yaml
system-reserved
andkube-reserved
, both of which follow GKE CPU reservation formula for calculating reserved CPU resources.rke2-99-z01-harvester-cpu-manager.yaml
Note
Here I add these files instead of adding configs in 90-harvester-server.yaml or 90-harvester-worker.yaml since we will have 99-max-pods.yaml (after upgrade to a newer harvester version) which overrides kubelet args to "max-pods=200".
https://github.com/harvester/harvester/blob/226f72aa58532071232ad548e27970c1cec55733/package/upgrade/upgrade_node.sh#L490-L495
Related Issue:
related to harvester/harvester#2305
HEP: harvester/harvester#5803
Test Plan:
Setup harvester with one node which has 8 CPUs and check if the two config files exist under
/etc/rancher/rke2/config.yaml.d/
and have correct settings.in
99-z00-harvester-reserved-resources.yaml
. The content should bein
99-z01-harvester-cpu-manager.yaml
. The content should be