Skip to content

Commit

Permalink
kind, vgpu: Bump vgpu kind to k8s-1.25 (#979)
Browse files Browse the repository at this point in the history
* kind: Bump vgpu kind to k8s-1.25

Do not config cpu manager for vgpu,
because kind 1.24+ has this bug for cpu manager:
kubernetes-sigs/kind#2999

Since we don't use cpu manager on vgpu lane we can bump to k8s-1.25
and remove cpu manager.

Rename lane.

Signed-off-by: Or Shoval <[email protected]>

* kind: Rename functions

The functions can add extra mounts / cpu manager to non worker nodes,
it depends where it is called.
If it is called before the worker snippet in the manifest
it will configure it for the control-plane, otherwise
for the worker node.

Rename it to reflect it.

Signed-off-by: Or Shoval <[email protected]>

---------

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval authored Mar 9, 2023
1 parent 7e486e5 commit 3e52bb0
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions cluster-up/cluster/kind-1.23-sriov/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function up() {
echo ""

cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
export CONFIG_WORKER_CPU_MANAGER=true
kind_up

configure_registry_proxy
Expand Down
5 changes: 3 additions & 2 deletions cluster-up/cluster/kind-1.23/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ function configure_registry_proxy() {

function up() {
cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
_add_worker_kubeadm_config_patch
_add_worker_extra_mounts
_add_kubeadm_cpu_manager_config_patch
_add_extra_mounts
export CONFIG_CPU_MANAGER=true
kind_up

configure_registry_proxy
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ else
fi

function set_kind_params() {
export KIND_VERSION="${KIND_VERSION:-0.11.1}"
export KIND_NODE_IMAGE="${KIND_NODE_IMAGE:-quay.io/kubevirtci/kindest_node:v1.23.3@sha256:0df8215895129c0d3221cda19847d1296c4f29ec93487339149333bd9d899e5a}"
export KIND_VERSION="${KIND_VERSION:-0.17.0}"
export KIND_NODE_IMAGE="${KIND_NODE_IMAGE:-quay.io/kubevirtci/kindest-node:v1.25.2@sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace}"
export KUBECTL_PATH="${KUBECTL_PATH:-/bin/kubectl}"
}

Expand All @@ -41,8 +41,7 @@ function up() {
echo ""

cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
_add_worker_kubeadm_config_patch
_add_worker_extra_mounts
_add_extra_mounts
kind_up

configure_registry_proxy
Expand Down
11 changes: 7 additions & 4 deletions cluster-up/cluster/kind/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function detect_cri() {
}

export CRI_BIN=${CRI_BIN:-$(detect_cri)}
CONFIG_WORKER_CPU_MANAGER=${CONFIG_WORKER_CPU_MANAGER:-false}

# check CPU arch
PLATFORM=$(uname -m)
Expand Down Expand Up @@ -226,7 +227,7 @@ function setup_kind() {
prepare_config
}

function _add_worker_extra_mounts() {
function _add_extra_mounts() {
cat <<EOF >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
extraMounts:
- containerPath: /var/log/audit
Expand All @@ -242,7 +243,7 @@ EOF
fi
}

function _add_worker_kubeadm_config_patch() {
function _add_kubeadm_cpu_manager_config_patch() {
cat << EOF >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
kubeadmConfigPatches:
- |-
Expand All @@ -262,8 +263,10 @@ function _add_workers() {
cat << EOF >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
- role: worker
EOF
_add_worker_kubeadm_config_patch
_add_worker_extra_mounts
if [ $CONFIG_WORKER_CPU_MANAGER == true ]; then
_add_kubeadm_cpu_manager_config_patch
fi
_add_extra_mounts
done
}

Expand Down

0 comments on commit 3e52bb0

Please sign in to comment.