From af58d58e5ad7f9c9bd383fcde6d07b925c03b24f Mon Sep 17 00:00:00 2001 From: kubevirt-bot Date: Sun, 19 Dec 2021 12:01:55 +0000 Subject: [PATCH] Bump kubevirtci [d2edfe6 KinD providers: Mount audit logs as read-only](https://github.com/kubevirt/kubevirtci/pull/724) [a307ad0 KinD providers: Mount /var/log/audit to cluster nodes](https://github.com/kubevirt/kubevirtci/pull/716) [85dc9d9 CI-cluster swap support](https://github.com/kubevirt/kubevirtci/pull/723) [aa8c20b k8s-1.22-ipv6, Create single stack ipv6 k8s-1.22 provider](https://github.com/kubevirt/kubevirtci/pull/721) ```release-note NONE ``` Signed-off-by: kubevirt-bot --- cluster-up-sha.txt | 2 +- cluster-up/cluster/k8s-1.22-ipv6/provider.sh | 9 +++++ cluster-up/cluster/k8s-provider-common.sh | 38 ++++++++++++++++++-- cluster-up/cluster/kind/common.sh | 8 ++++- cluster-up/hack/common.sh | 4 ++- cluster-up/version.txt | 2 +- hack/config-default.sh | 2 +- 7 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 cluster-up/cluster/k8s-1.22-ipv6/provider.sh diff --git a/cluster-up-sha.txt b/cluster-up-sha.txt index 29e099c32d4b..c4671571db92 100644 --- a/cluster-up-sha.txt +++ b/cluster-up-sha.txt @@ -1 +1 @@ -dd3d9c70579eeb7bf0d5348018e17e9423e00d03 +5884cbdd8505ba5d3e0dbfd43871ed7858f1db75 diff --git a/cluster-up/cluster/k8s-1.22-ipv6/provider.sh b/cluster-up/cluster/k8s-1.22-ipv6/provider.sh new file mode 100644 index 000000000000..e2bf40cda083 --- /dev/null +++ b/cluster-up/cluster/k8s-1.22-ipv6/provider.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +if [ "${KUBEVIRT_CGROUPV2}" == "true" ]; then + export KUBEVIRT_PROVIDER_EXTRA_ARGS="${KUBEVIRT_PROVIDER_EXTRA_ARGS} --kernel-args='systemd.unified_cgroup_hierarchy=1'" +fi + +# shellcheck disable=SC1090 +source "${KUBEVIRTCI_PATH}/cluster/k8s-provider-common.sh" diff --git a/cluster-up/cluster/k8s-provider-common.sh b/cluster-up/cluster/k8s-provider-common.sh index e99567d0986c..84ee491aa09f 100644 --- a/cluster-up/cluster/k8s-provider-common.sh +++ b/cluster-up/cluster/k8s-provider-common.sh @@ -5,6 +5,38 @@ set -e # shellcheck source=cluster-up/cluster/ephemeral-provider-common.sh source "${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh" + +#if UNLIMITEDSWAP is set to true - Kubernetes workloads can use as much swap memory as they request, up to the system limit. +#otherwise Kubernetes workloads can use as much swap memory as they request, up to the system limit by default +function configure_swap_memory () { + if [ "$KUBEVIRT_SWAP_ON" == "true" ] && [[ ($KUBEVIRT_PROVIDER =~ k8s-1\.1.*) || ($KUBEVIRT_PROVIDER =~ k8s-1.20) || ($KUBEVIRT_PROVIDER =~ k8s-1.21) ]]; then + echo "ERROR: swap is not supported on kubevirtci version < 1.22" + exit 1 + + elif [ "$KUBEVIRT_SWAP_ON" == "true" ] ;then + + for nodeNum in $(seq -f "%02g" 1 $KUBEVIRT_NUM_NODES); do + if [ ! -z $KUBEVIRT_SWAP_SIZE_IN_GB ]; then + $ssh node${nodeNum} -- sudo dd if=/dev/zero of=/swapfile count=$KUBEVIRT_SWAP_SIZE_IN_GB bs=1G + $ssh node${nodeNum} -- sudo mkswap /swapfile + fi + + $ssh node${nodeNum} -- sudo swapon -a + + if [ ! -z $KUBEVIRT_SWAPPINESS ]; then + $ssh node${nodeNum} -- "sudo /bin/su -c \"echo vm.swappiness = $KUBEVIRT_SWAPPINESS >> /etc/sysctl.conf\"" + $ssh node${nodeNum} -- sudo sysctl vm.swappiness=$KUBEVIRT_SWAPPINESS + fi + + if [ $KUBEVIRT_UNLIMITEDSWAP == "true" ]; then + $ssh node${nodeNum} -- "sudo sed -i ':a;N;\$!ba;s/memorySwap: {}/memorySwap:\n swapBehavior: UnlimitedSwap/g' /var/lib/kubelet/config.yaml" + $ssh node${nodeNum} -- sudo systemctl restart kubelet + fi + done +fi + +} + function deploy_cnao() { if [ "$KUBEVIRT_WITH_CNAO" == "true" ] || [ "$KUBVIRT_WITH_CNAO_SKIP_CONFIG" == "true" ]; then $kubectl create -f /opt/cnao/namespace.yaml @@ -101,8 +133,8 @@ function up() { # Make sure that local config is correct prepare_config - - kubectl="${_cli} --prefix $provider_prefix ssh node01 -- sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf" + ssh="${_cli} --prefix $provider_prefix ssh" + kubectl="$ssh node01 -- sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf" # For multinode cluster Label all the non control-plane nodes as workers, # for one node cluster label control-plane with 'control-plane,worker' roles @@ -113,6 +145,8 @@ function up() { fi $kubectl label node -l $label node-role.kubernetes.io/worker='' + configure_swap_memory + deploy_cnao deploy_istio deploy_cdi diff --git a/cluster-up/cluster/kind/common.sh b/cluster-up/cluster/kind/common.sh index dd7879bf0519..566937a09513 100755 --- a/cluster-up/cluster/kind/common.sh +++ b/cluster-up/cluster/kind/common.sh @@ -224,9 +224,15 @@ function setup_kind() { } function _add_worker_extra_mounts() { + cat <> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml + extraMounts: + - containerPath: /var/log/audit + hostPath: /var/log/audit + readOnly: true +EOF + if [[ "$KUBEVIRT_PROVIDER" =~ sriov.* || "$KUBEVIRT_PROVIDER" =~ vgpu.* ]]; then cat <> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml - extraMounts: - containerPath: /dev/vfio/ hostPath: /dev/vfio/ EOF diff --git a/cluster-up/hack/common.sh b/cluster-up/hack/common.sh index d6e48a3b2493..1f03fb9f9898 100644 --- a/cluster-up/hack/common.sh +++ b/cluster-up/hack/common.sh @@ -27,6 +27,8 @@ KUBEVIRT_DEPLOY_PROMETHEUS_ALERTMANAGER=${KUBEVIRT_DEPLOY_PROMETHEUS_ALERTMANAGE KUBEVIRT_DEPLOY_GRAFANA=${KUBEVIRT_DEPLOY_GRAFANA:-false} KUBEVIRT_CGROUPV2=${KUBEVIRT_CGROUPV2:-false} KUBEVIRT_DEPLOY_CDI=${KUBEVIRT_DEPLOY_CDI:-false} +KUBEVIRT_SWAP_ON=${KUBEVIRT_SWAP_ON:-false} +KUBEVIRT_UNLIMITEDSWAP=${KUBEVIRT_UNLIMITEDSWAP:-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) # http and https ports are accessed by testing framework and should not be randomized @@ -40,4 +42,4 @@ provider_prefix=${JOB_NAME:-${KUBEVIRT_PROVIDER}}${EXECUTOR_NUMBER} job_prefix=${JOB_NAME:-kubevirt}${EXECUTOR_NUMBER} mkdir -p $KUBEVIRTCI_CONFIG_PATH/$KUBEVIRT_PROVIDER -KUBEVIRTCI_TAG=2112141646-d737b1b +KUBEVIRTCI_TAG=2112161230-d2edfe6 diff --git a/cluster-up/version.txt b/cluster-up/version.txt index 3103ee29e147..8f2a3b45f56b 100644 --- a/cluster-up/version.txt +++ b/cluster-up/version.txt @@ -1 +1 @@ -2112141646-d737b1b +2112161230-d2edfe6 diff --git a/hack/config-default.sh b/hack/config-default.sh index 1e318664250f..f5b2f27f3bc3 100644 --- a/hack/config-default.sh +++ b/hack/config-default.sh @@ -11,7 +11,7 @@ cdi_namespace=cdi image_pull_policy=${IMAGE_PULL_POLICY:-IfNotPresent} verbosity=${VERBOSITY:-2} package_name=${PACKAGE_NAME:-kubevirt-dev} -kubevirtci_git_hash="2112141646-d737b1b" +kubevirtci_git_hash="2112161230-d2edfe6" conn_check_ipv4_address=${CONN_CHECK_IPV4_ADDRESS:-""} conn_check_ipv6_address=${CONN_CHECK_IPV6_ADDRESS:-""} conn_check_dns=${CONN_CHECK_DNS:-""}