From 48b2acc34065ed0ed89d30c99fdec88bc2043c05 Mon Sep 17 00:00:00 2001 From: hancheng wang Date: Thu, 11 Apr 2024 16:04:48 +0800 Subject: [PATCH] solve the label issue of singlenode through affinity Signed-off-by: hancheng wang solve the label issue of singlenode through affinity Signed-off-by: hancheng wang --- scripts/cloudlab/start_onenode_vhive_cluster.go | 4 ++++ scripts/cluster/create_one_node_cluster.go | 5 ----- scripts/setup.go | 13 +++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/cloudlab/start_onenode_vhive_cluster.go b/scripts/cloudlab/start_onenode_vhive_cluster.go index 1384b8c8c..807a356ca 100644 --- a/scripts/cloudlab/start_onenode_vhive_cluster.go +++ b/scripts/cloudlab/start_onenode_vhive_cluster.go @@ -122,6 +122,10 @@ func StartOnenodeVhiveCluster(sandbox string) error { return err } + if err = cluster.SetupMasterNode(sandbox); err != nil { + return err + } + utils.InfoPrintf("All logs are stored in %s", ctrdLogDir) return nil } diff --git a/scripts/cluster/create_one_node_cluster.go b/scripts/cluster/create_one_node_cluster.go index 887be2ebe..087bda29a 100644 --- a/scripts/cluster/create_one_node_cluster.go +++ b/scripts/cluster/create_one_node_cluster.go @@ -70,11 +70,6 @@ func CreateOneNodeCluster(stockContainerd string) error { return err } - err = SetupMasterNode(stockContainerd) - if err != nil { - return err - } - return nil } diff --git a/scripts/setup.go b/scripts/setup.go index 366f58fb2..b598cb314 100644 --- a/scripts/setup.go +++ b/scripts/setup.go @@ -79,6 +79,7 @@ func main() { availableCmds := []string{ "create_multinode_cluster", "create_one_node_cluster", + "prepare_one_node_cluster", "setup_master_node", "setup_worker_kubelet", "setup_node", @@ -157,6 +158,18 @@ func main() { } utils.InfoPrintf("Create one-node Cluster\n") err = cluster.CreateOneNodeCluster(setupFlags.Args()[1]) + if err == nil { + utils.InfoPrintf("Set up master node\n") + err = cluster.SetupMasterNode(setupFlags.Args()[1]) + } + case "prepare_one_node_cluster": + if setupFlags.NArg() < 2 { + utils.FatalPrintf("Missing parameters: %s \n", subCmd) + utils.CleanEnvironment() + os.Exit(1) + } + utils.InfoPrintf("Create one-node Cluster\n") + err = cluster.CreateOneNodeCluster(setupFlags.Args()[1]) case "setup_master_node": if setupFlags.NArg() < 2 { utils.FatalPrintf("Missing parameters: %s \n", subCmd)