func()

in contrib/utils/kperf_cmd.go [26:52]


func (kr *KperfRunner) NewNodepool(
	ctx context.Context,
	timeout time.Duration,
	name string, nodes int, cpu, memory, maxPods int,
	affinity string,
	sharedProviderID string,
) error {
	args := []string{"vc", "nodepool"}
	if kr.kubeCfgPath != "" {
		args = append(args, fmt.Sprintf("--kubeconfig=%s", kr.kubeCfgPath))
	}
	args = append(args, "add", name,
		fmt.Sprintf("--nodes=%v", nodes),
		fmt.Sprintf("--cpu=%v", cpu),
		fmt.Sprintf("--memory=%v", memory),
		fmt.Sprintf("--max-pods=%v", maxPods),
	)
	if affinity != "" {
		args = append(args, fmt.Sprintf("--affinity=%v", affinity))
	}
	if sharedProviderID != "" {
		args = append(args, fmt.Sprintf("--shared-provider-id=%v", sharedProviderID))
	}

	_, err := runCommand(ctx, timeout, "kperf", args)
	return err
}