From c38cf5dd5c5cc2a3ef68473a5b8d0e556cbd13dc Mon Sep 17 00:00:00 2001
From: Xingjian Zhang <44231913+THUzxj@users.noreply.github.com>
Date: Wed, 12 Apr 2023 07:40:31 +0800
Subject: [PATCH] Fix confusing instance sizing (etcd, kube_master) in
 Vagrantfile (#9966)

---
 Vagrantfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index 0d507674e..a3cf28d49 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -61,9 +61,9 @@ $multi_networking ||= "False"
 $download_run_once ||= "True"
 $download_force_cache ||= "False"
 # The first three nodes are etcd servers
-$etcd_instances ||= $num_instances
+$etcd_instances ||= [$num_instances, 3].min
 # The first two nodes are kube masters
-$kube_master_instances ||= $num_instances == 1 ? $num_instances : ($num_instances - 1)
+$kube_master_instances ||= [$num_instances, 2].min
 # All nodes are kube nodes
 $kube_node_instances ||= $num_instances
 # The following only works when using the libvirt provider
-- 
GitLab