You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add batch-add command to split large node pool into smaller one (#175)
This update introduces a new command that enables splitting a large node
pool into smaller ones, helping to prevent issues like oversized
manifests and timeouts.
---------
Co-authored-by: Fu Wei <fuweid89@gmail.com>
Copy file name to clipboardExpand all lines: cmd/kperf/commands/virtualcluster/nodepool.go
+113-1Lines changed: 113 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ import (
15
15
"helm.sh/helm/v3/pkg/release"
16
16
17
17
"github.com/urfave/cli"
18
+
"k8s.io/klog/v2"
18
19
)
19
20
20
21
varnodepoolCommand= cli.Command{
@@ -29,11 +30,15 @@ var nodepoolCommand = cli.Command{
29
30
},
30
31
Subcommands: []cli.Command{
31
32
nodepoolAddCommand,
33
+
nodepoolBatchAddCommand,
32
34
nodepoolDelCommand,
33
35
nodepoolListCommand,
34
36
},
35
37
}
36
38
39
+
// maxNodesPerPool is the maximum number of nodes suggested for a single node pool.
40
+
constmaxNodesPerPool=300
41
+
37
42
varnodepoolAddCommand= cli.Command{
38
43
Name: "add",
39
44
Usage: "Add a virtual node pool",
@@ -99,12 +104,17 @@ var nodepoolAddCommand = cli.Command{
99
104
returnfmt.Errorf("failed to parse node-labels: %w", err)
100
105
}
101
106
107
+
nodes:=cliCtx.Int("nodes")
108
+
ifnodes>maxNodesPerPool {
109
+
klog.Warningf("Creating a node pool with a large number of nodes may cause performance issues. Consider using batch-add command for large node pools.")
0 commit comments