-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
don't set default cgroup option if reserved-cpus provided via kubelet… #1405
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
72f4f5a
don't set default cgroup option if reserved-cpus provided via kubelet…
raghs-aws 6495e99
rserved cpu option for containerd
d0737fa
reserved cpu option for containerd
9183de6
Update files/bootstrap.sh
raghs-aws 9589d8b
Update test/cases/reserved-cpus-kubelet-arg.sh
raghs-aws 189847a
resolved review comments
3bcd64b
resolved review comments
9eebfd8
updated bootstrap.sh
raghs-aws f934bb2
updated bootstrap.sh
raghs-aws 26c0136
removed duplicate test case
raghs-aws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
echo "-> Should not set systemReservedCgroup and kubeReservedCgroup when --reserved-cpus is set with containerd" | ||
exit_code=0 | ||
export KUBELET_VERSION=v1.24.15-eks-ba74326 | ||
runtime="containerd" | ||
/etc/eks/bootstrap.sh \ | ||
--b64-cluster-ca dGVzdA== \ | ||
--apiserver-endpoint http://my-api-endpoint \ | ||
--kubelet-extra-args '--node-labels=cnf=cnf1 --reserved-cpus=0-3 --cpu-manager-policy=static' \ | ||
test || exit_code=$? | ||
|
||
if [[ ${exit_code} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected a non-zero exit code but got '${exit_code}'" | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q systemReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -eq 0 ]]; then | ||
raghs-aws marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "❌ Test Failed: expected systemReservedCgroup to be absent from /etc/kubernetes/kubelet/kubelet-config.json. expected: 1 Received: ${retCode}" | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q kubeReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -eq 0 ]]; then | ||
echo "❌ Test Failed: expected kubeReservedCgroup to be absent from /etc/kubernetes/kubelet/kubelet-config.json. expected: 1 Received: ${retCode}" | ||
exit 1 | ||
fi | ||
|
||
echo "-> Should set systemReservedCgroup and kubeReservedCgroup when --reserved-cpus is not set with containerd" | ||
exit_code=0 | ||
export KUBELET_VERSION=v1.24.15-eks-ba74326 | ||
runtime="containerd" | ||
/etc/eks/bootstrap.sh \ | ||
--b64-cluster-ca dGVzdA== \ | ||
--apiserver-endpoint http://my-api-endpoint \ | ||
test || exit_code=$? | ||
|
||
if [[ ${exit_code} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected a non-zero exit code but got '${exit_code}'" | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q systemReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected systemReservedCgroup to be retCode in /etc/kubernetes/kubelet/kubelet-config.json. expected: /system Received: $(grep -q systemReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json) " | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q kubeReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected kubeReservedCgroup to be absent from /etc/kubernetes/kubelet/kubelet-config.json. expected: /runtime Received: $(grep -q kubeReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json) " | ||
exit 1 | ||
fi | ||
|
||
echo "-> Should set systemReservedCgroup and kubeReservedCgroup when --reserved-cpus is set with dockerd" | ||
exit_code=0 | ||
export KUBELET_VERSION=v1.23.15-eks-ba74326 | ||
/etc/eks/bootstrap.sh \ | ||
--b64-cluster-ca dGVzdA== \ | ||
--apiserver-endpoint http://my-api-endpoint \ | ||
test || exit_code=$? | ||
|
||
if [[ ${exit_code} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected a non-zero exit code but got '${exit_code}'" | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q systemReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected systemReservedCgroup to be retCode in /etc/kubernetes/kubelet/kubelet-config.json. expected: /system Received: $(grep -q systemReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json) " | ||
exit 1 | ||
fi | ||
|
||
retCode=$( | ||
grep -q kubeReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json | ||
echo $? | ||
) | ||
if [[ ${retCode} -ne 0 ]]; then | ||
echo "❌ Test Failed: expected kubeReservedCgroup to be absent from /etc/kubernetes/kubelet/kubelet-config.json. expected: /runtime Received: $(grep -q kubeReservedCgroup /etc/kubernetes/kubelet/kubelet-config.json) " | ||
exit 1 | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we should invert the semantics of this variable, to disable the cgroup settings (e.g.
USE_RESERVED_CGROUPS
) instead of enabling reserved CPU's. Other than that, this PR LGTM.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.
makes sense, this way if we have some other usecases which needs disabling of cgroup, then we can reuse the same variable. let me push the changes,