diff --git a/cmd/kperf/commands/virtualcluster/nodepool.go b/cmd/kperf/commands/virtualcluster/nodepool.go new file mode 100644 index 0000000..2c64a90 --- /dev/null +++ b/cmd/kperf/commands/virtualcluster/nodepool.go @@ -0,0 +1,67 @@ +package virtualcluster + +import ( + "fmt" + + "github.com/urfave/cli" +) + +var nodepoolCommand = cli.Command{ + Name: "nodepool", + Usage: "Manage virtual node pools", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "kubeconfig", + Usage: "Path to the kubeconfig file", + }, + }, + Subcommands: []cli.Command{ + nodepoolAddCommand, + nodepoolDelCommand, + nodepoolListCommand, + }, +} + +var nodepoolAddCommand = cli.Command{ + Name: "add", + Usage: "Add a virtual node pool", + ArgsUsage: "NAME", + Flags: []cli.Flag{ + cli.IntFlag{ + Name: "nodes", + Usage: "The number of virtual nodes", + Value: 10, + }, + cli.IntFlag{ + Name: "cpu", + Usage: "The allocatable CPU resource per node", + Value: 8, + }, + cli.IntFlag{ + Name: "memory", + Usage: "The allocatable Memory resource per node (GiB)", + Value: 16, + }, + }, + Action: func(cliCtx *cli.Context) error { + return fmt.Errorf("nodepool add - not implemented") + }, +} + +var nodepoolDelCommand = cli.Command{ + Name: "delete", + ShortName: "del", + ArgsUsage: "NAME", + Usage: "Delete a virtual node pool", + Action: func(cliCtx *cli.Context) error { + return fmt.Errorf("nodepool delete - not implemented") + }, +} + +var nodepoolListCommand = cli.Command{ + Name: "list", + Usage: "List virtual node pools", + Action: func(cliCtx *cli.Context) error { + return fmt.Errorf("nodepool list - not implemented") + }, +} diff --git a/cmd/kperf/commands/virtualcluster/vc.go b/cmd/kperf/commands/virtualcluster/vc.go new file mode 100644 index 0000000..f869f82 --- /dev/null +++ b/cmd/kperf/commands/virtualcluster/vc.go @@ -0,0 +1,15 @@ +package virtualcluster + +import "github.com/urfave/cli" + +// const namespace = "kperf-virtualcluster" + +// Command represents virtualcluster subcommand. +var Command = cli.Command{ + Name: "virtualcluster", + ShortName: "vc", + Usage: "Setup virtual cluster and run workload on that", + Subcommands: []cli.Command{ + nodepoolCommand, + }, +} diff --git a/request/client.go b/request/client.go index cab0618..7a6d3ce 100644 --- a/request/client.go +++ b/request/client.go @@ -26,12 +26,10 @@ func NewClients(kubeCfgPath string, ConnsNum int, userAgent string, qps int, con if qps == 0 { qps = math.MaxInt32 } - restCfg.QPS = float32(qps) restCfg.NegotiatedSerializer = scheme.Codecs.WithoutConversion() restCfg.UserAgent = userAgent - if restCfg.UserAgent == "" { restCfg.UserAgent = rest.DefaultKubernetesUserAgent() }