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

k8s-provider: Remove KUBEVIRT_CPU_MANAGER_POLICY #1289

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster-provision/gocli/opts/nodes/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func AddExpectCalls(sshClient *kubevirtcimocks.MockSSHClient) {
cmds := []string{
"source /var/lib/kubevirtci/shared_vars.sh",
`timeout=30; interval=5; while ! hostnamectl | grep Transient; do echo "Waiting for dhclient to set the hostname from dnsmasq"; sleep $interval; timeout=$((timeout - interval)); [ $timeout -le 0 ] && exit 1; done`,
`echo "KUBELET_EXTRA_ARGS=--cgroup-driver=systemd --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice --fail-swap-on=false --feature-gates=NodeSwap=true,CPUManager=true --cpu-manager-policy=static --kube-reserved=cpu=500m --system-reserved=cpu=500m" | tee /etc/sysconfig/kubelet > /dev/null`,
`echo "KUBELET_EXTRA_ARGS=--cgroup-driver=systemd --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice --fail-swap-on=false --feature-gates=NodeSwap=true --cpu-manager-policy=static --kube-reserved=cpu=500m --system-reserved=cpu=500m" | tee /etc/sysconfig/kubelet > /dev/null`,
"systemctl daemon-reload && service kubelet restart",
"swapoff -a",
"until ip address show dev eth0 | grep global | grep inet6; do sleep 1; done",
Expand Down
18 changes: 0 additions & 18 deletions cluster-up/cluster/k8s-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ function wait_for_kwok_ready() {
fi
}

function configure_cpu_manager() {
if [ ${KUBEVIRT_CPU_MANAGER_POLICY} == "static" ]; then
for node in $($kubectl get nodes -l "node-role.kubernetes.io/worker" --no-headers -o custom-columns=":metadata.name" | tr -d '\r'); do
# FIXME Replace with kubelet config drop ins once all providers are using k8s >= 1.28
# https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/#kubelet-conf-d
$kubectl drain ${node}
$ssh ${node} -- sudo systemctl stop kubelet
# FIXME ${ssh} is broken when using HereDocs, fix and replace this mess if possible.
# https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#configuration
$ssh ${node} -- "sudo rm -f /var/lib/kubelet/cpu_manager_state && sudo echo -e 'cpuManagerPolicy: static\nkubeReserved:\n cpu: \"1\"\n memory: \"1Gi\"\ncpuManagerPolicyOptions:\n full-pcpus-only: \"true\"' | sudo tee -a /var/lib/kubelet/config.yaml && sudo sed -i 's/cpuManagerReconcilePeriod\:\ 0s/cpuManagerReconcilePeriod\:\ 5s/g' /var/lib/kubelet/config.yaml"
$ssh ${node} -- sudo systemctl start kubelet
$kubectl label --overwrite node/${node} cpumanager=true
$kubectl uncordon ${node}
done
fi
}

function up() {
params=$(_add_common_params)
if echo "$params" | grep -q ERROR; then
Expand Down Expand Up @@ -90,7 +73,6 @@ function up() {
$kubectl label node -l $label node-role.kubernetes.io/worker=''

configure_prometheus
configure_cpu_manager

deploy_kwok

Expand Down
1 change: 0 additions & 1 deletion cluster-up/cluster/kind/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ function _add_kubeadm_cpu_manager_config_patch() {
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
"feature-gates": "CPUManager=true"
"cpu-manager-policy": "static"
"kube-reserved": "cpu=500m"
"system-reserved": "cpu=500m"
Expand Down
1 change: 0 additions & 1 deletion cluster-up/hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ KUBEVIRT_CUSTOM_CDI_VERSION=${KUBEVIRT_CUSTOM_CDI_VERSION}
KUBEVIRT_SWAP_ON=${KUBEVIRT_SWAP_ON:-false}
KUBEVIRT_KSM_ON=${KUBEVIRT_KSM_ON:-false}
KUBEVIRT_UNLIMITEDSWAP=${KUBEVIRT_UNLIMITEDSWAP:-false}
KUBEVIRT_CPU_MANAGER_POLICY=${KUBEVIRT_CPU_MANAGER_POLICY:-none}
KUBVIRT_WITH_CNAO_SKIP_CONFIG=${KUBVIRT_WITH_CNAO_SKIP_CONFIG:-false}

# If on a developer setup, expose ocp on 8443, so that the openshift web console can be used (the port is important because of auth redirects)
Expand Down