From fe6fbe043a0580015be001a287ad07d0325f3c80 Mon Sep 17 00:00:00 2001 From: Or Mergi Date: Tue, 17 Nov 2020 10:09:27 +0200 Subject: [PATCH] sriov provider, run etcd in memory Currently we encounter bad performance of etcd on sriov provider cluster on DinD setup. We get 'etcdserver: timeout errors' that causes jobs to fail often. In such cases it is recommanded [1] to use in-memory etcd Running etcd in memory should improve performance and will make sriov provider more stabilized. [1] https://github.com/kubernetes-sigs/kind/issues/1922 Signed-off-by: Or Mergi --- cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh | 3 +++ cluster-up/cluster/kind/common.sh | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh b/cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh index 22d49f0b35..9ca083d62d 100755 --- a/cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh +++ b/cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh @@ -19,6 +19,9 @@ function up() { cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml + export ETCD_DATA_DIR="/mnt/etcd" + ensure_memory_dir_for_etcd_data + kind_up ${KUBEVIRTCI_PATH}/cluster/$KUBEVIRT_PROVIDER/config_sriov.sh diff --git a/cluster-up/cluster/kind/common.sh b/cluster-up/cluster/kind/common.sh index 85a7277daf..d5ef7629b8 100755 --- a/cluster-up/cluster/kind/common.sh +++ b/cluster-up/cluster/kind/common.sh @@ -259,7 +259,19 @@ EOF done } +function _add_control_plane_extra_mounts() { + if [[ "$KUBEVIRT_PROVIDER" =~ sriov.* ]]; then + # adding mounts to control plane, need them for sriov + cat <> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml + extraMounts: + - containerPath: /var/lib/etcd + hostPath: $ETCD_DATA_DIR +EOF + fi +} + function _prepare_kind_config() { + _add_control_plane_extra_mounts _add_workers echo "Final KIND config:"