Documentation
¶
Index ¶
- Variables
- func BuildClientset(kubeCfgPath string) (*kubernetes.Clientset, error)
- func CreateConfigmaps(ctx context.Context, kubeCfgPath string, cmAmount int, cmSize int, ...) error
- func CreateTempFileWithContent(data []byte) (_name string, _cleanup func() error, retErr error)
- func DeleteConfigmaps(ctx context.Context, kubeCfgPath string, namespace string, ...) error
- func DeployAndRepeatRollingUpdateDeployments(ctx context.Context, kubeCfgPath string, releaseName string, ...) (rollingUpdateFn, cleanupFn func(), retErr error)
- func DeployRunnerGroup(ctx context.Context, kubeCfgPath, runnerImage, rgCfgFile string, ...) (*types.RunnerGroupsReport, error)
- func FetchAPIServerCores(ctx context.Context, kubeCfgPath string) (map[string]int, error)
- func FetchNodeProviderIDByType(ctx context.Context, kubeCfgPath string, instanceType string) (string, error)
- func NSLookup(domainURL string) ([]string, error)
- func NewRunnerGroupSpecFileFromEmbed(target string, tweakFn func(*types.RunnerGroupSpec) error) (_name string, _cleanup func() error, _ error)
- func NewRunnerGroupSpecFromYAML(data []byte, tweakFn func(*types.RunnerGroupSpec) error) (*types.RunnerGroupSpec, error)
- func RepeatJobWithPod(ctx context.Context, kubeCfgPath string, namespace string, target string, ...)
- type KperfRunner
- func (kr *KperfRunner) DeleteNodepool(ctx context.Context, timeout time.Duration, name string) error
- func (kr *KperfRunner) NewNodepool(ctx context.Context, timeout time.Duration, name string, nodes int, ...) error
- func (kr *KperfRunner) RGDelete(ctx context.Context, timeout time.Duration) error
- func (kr *KperfRunner) RGResult(ctx context.Context, timeout time.Duration) (string, error)
- func (kr *KperfRunner) RGRun(ctx context.Context, timeout time.Duration, ...) error
- type KubectlRunner
- func (kr *KubectlRunner) Apply(ctx context.Context, timeout time.Duration, filePath string) error
- func (kr *KubectlRunner) CreateNamespace(ctx context.Context, timeout time.Duration, name string) error
- func (kr *KubectlRunner) Delete(ctx context.Context, timeout time.Duration, filePath string) error
- func (kr *KubectlRunner) DeleteNamespace(ctx context.Context, timeout time.Duration, name string) error
- func (kr *KubectlRunner) DeploymentRestart(ctx context.Context, timeout time.Duration, name string) error
- func (kr *KubectlRunner) DeploymentRolloutStatus(ctx context.Context, timeout time.Duration, name string) error
- func (kr *KubectlRunner) FQDN(ctx context.Context, timeout time.Duration) (string, error)
- func (kr *KubectlRunner) Metrics(ctx context.Context, timeout time.Duration, fqdn, ip string) ([]byte, error)
- func (kr *KubectlRunner) ServerSideApplyWithData(ctx context.Context, timeout time.Duration, data string) error
- func (kr *KubectlRunner) Wait(ctx context.Context, timeout time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( // EKSIdleNodepoolInstanceType is the instance type of idle nodepool. // // NOTE: The EKS cloud provider will delete all the NOT-READY nodes // which aren't managed by it. When kwok-controller fails to update // virtual node's lease, the EKS cloud provider would delete that // virtual node. It's unexpected behavior. In order to avoid this case, // we should create a idle nodepool with one node and use that node's // provider ID for all the virtual nodes so that EKS cloud provider // won't delete our virtual nodes. EKSIdleNodepoolInstanceType = "m4.large" )
Functions ¶
func BuildClientset ¶
func BuildClientset(kubeCfgPath string) (*kubernetes.Clientset, error)
BuildClientset returns kubernetes clientset.
func CreateConfigmaps ¶ added in v0.3.3
func CreateConfigmaps(ctx context.Context, kubeCfgPath string, cmAmount int, cmSize int, cmGroupSize int, namespace string, timeout time.Duration) error
Creates configmaps for benchmark.
func CreateTempFileWithContent ¶
CreateTempFileWithContent creates temporary file with data.
func DeleteConfigmaps ¶ added in v0.3.3
func DeleteConfigmaps(ctx context.Context, kubeCfgPath string, namespace string, timeout time.Duration) error
Delete configmaps for benchmark.
func DeployAndRepeatRollingUpdateDeployments ¶
func DeployAndRepeatRollingUpdateDeployments( ctx context.Context, kubeCfgPath string, releaseName string, total, replica, paddingBytes int, internal time.Duration, ) (rollingUpdateFn, cleanupFn func(), retErr error)
DeployAndRepeatRollingUpdateDeployments deploys and repeats to rolling-update deployments.
func DeployRunnerGroup ¶
func DeployRunnerGroup(ctx context.Context, kubeCfgPath, runnerImage, rgCfgFile string, runnerFlowControl, runnerGroupAffinity string) (*types.RunnerGroupsReport, error)
DeployRunnerGroup deploys runner group for benchmark.
func FetchAPIServerCores ¶
FetchAPIServerCores fetchs core number for each kube-apiserver.
func FetchNodeProviderIDByType ¶
func FetchNodeProviderIDByType(ctx context.Context, kubeCfgPath string, instanceType string) (string, error)
FetchNodeProviderIDByType is used to get one node's provider id with a given instance type.
func NewRunnerGroupSpecFileFromEmbed ¶
func NewRunnerGroupSpecFileFromEmbed(target string, tweakFn func(*types.RunnerGroupSpec) error) (_name string, _cleanup func() error, _ error)
NewRunnerGroupSpecFileFromEmbed reads load profile (RunnerGroupSpec) from embed memory and marshals it into temporary file. Use it when invoking kperf binary instead of package.
func NewRunnerGroupSpecFromYAML ¶
func NewRunnerGroupSpecFromYAML(data []byte, tweakFn func(*types.RunnerGroupSpec) error) (*types.RunnerGroupSpec, error)
NewRunnerGroupSpecFromYAML returns RunnerGroupSpec instance from yaml data.
Types ¶
type KperfRunner ¶
type KperfRunner struct {
// contains filtered or unexported fields
}
KperfRunner is the wrapper of exec.Command to execute kperf command.
func NewKperfRunner ¶
func NewKperfRunner(kubeCfgPath string, runnerImage string) *KperfRunner
func (*KperfRunner) DeleteNodepool ¶
func (kr *KperfRunner) DeleteNodepool(ctx context.Context, timeout time.Duration, name string) error
DeleteNodepool deletes a virtual nodepool by a given name.
func (*KperfRunner) NewNodepool ¶
func (kr *KperfRunner) NewNodepool( ctx context.Context, timeout time.Duration, name string, nodes int, cpu, memory, maxPods int, affinity string, sharedProviderID string, ) error
NewNodepool creates new virtual nodepool.
type KubectlRunner ¶
type KubectlRunner struct {
// contains filtered or unexported fields
}
KubectlRunner is the wrapper of exec.Command to execute kubectl command.
func NewKubectlRunner ¶
func NewKubectlRunner(kubeCfgPath string, namespace string) *KubectlRunner
func (*KubectlRunner) CreateNamespace ¶
func (kr *KubectlRunner) CreateNamespace(ctx context.Context, timeout time.Duration, name string) error
CreateNamespace creates a new namespace.
func (*KubectlRunner) DeleteNamespace ¶
func (kr *KubectlRunner) DeleteNamespace(ctx context.Context, timeout time.Duration, name string) error
DeleteNamespace delete a namespace.
func (*KubectlRunner) DeploymentRestart ¶
func (kr *KubectlRunner) DeploymentRestart(ctx context.Context, timeout time.Duration, name string) error
DeploymentRestart restats a deployment.
func (*KubectlRunner) DeploymentRolloutStatus ¶
func (kr *KubectlRunner) DeploymentRolloutStatus(ctx context.Context, timeout time.Duration, name string) error
DeploymentRolloutStatus watches the rollout status of a deployment.
func (*KubectlRunner) Metrics ¶
func (kr *KubectlRunner) Metrics(ctx context.Context, timeout time.Duration, fqdn, ip string) ([]byte, error)
Metrics returns the metrics for a specific kube-apiserver.
func (*KubectlRunner) ServerSideApplyWithData ¶
func (kr *KubectlRunner) ServerSideApplyWithData(ctx context.Context, timeout time.Duration, data string) error
ServerSideApplyWithData runs kubectl apply with --server-side=true, with input data piped through stdin.