From 37be7d4f1af6b9e80eb60e7284515ab7650293cb Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Mon, 7 Oct 2024 09:42:27 +0100 Subject: [PATCH] k8s-provider: Remove KUBEVIRT_CPU_MANAGER_POLICY Signed-off-by: Lee Yarwood --- cluster-up/cluster/k8s-provider-common.sh | 18 ------------------ cluster-up/hack/common.sh | 1 - 2 files changed, 19 deletions(-) diff --git a/cluster-up/cluster/k8s-provider-common.sh b/cluster-up/cluster/k8s-provider-common.sh index c0fcf02d64..ea752575a8 100644 --- a/cluster-up/cluster/k8s-provider-common.sh +++ b/cluster-up/cluster/k8s-provider-common.sh @@ -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 @@ -90,7 +73,6 @@ function up() { $kubectl label node -l $label node-role.kubernetes.io/worker='' configure_prometheus - configure_cpu_manager deploy_kwok diff --git a/cluster-up/hack/common.sh b/cluster-up/hack/common.sh index 7802dbc289..e86169a1a7 100644 --- a/cluster-up/hack/common.sh +++ b/cluster-up/hack/common.sh @@ -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)