From cc2cf464ac950a76b2316d504366a798acbe8c9e 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/kind-k8s-sriov-1.17.0/provider.sh | 3 +++ cluster-up/cluster/kind/common.sh | 13 +++++++++++++ 2 files changed, 16 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 b38d5e4fea..c7cbd7729b 100755 --- a/cluster-up/cluster/kind/common.sh +++ b/cluster-up/cluster/kind/common.sh @@ -270,7 +270,20 @@ EOF done } +function _add_control_plane_extra_mounts() { + if [[ "$KUBEVIRT_PROVIDER" =~ sriov.* ]]; then + if [ "$ETCD_IN_MEMORY" != none ]; then + cat <> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml + extraMounts: + - containerPath: /var/lib/etcd + hostPath: $ETCD_DATA_DIR +EOF + fi + fi +} + function _prepare_kind_config() { + _add_control_plane_extra_mounts _add_workers echo "Final KIND config:"