kubernetes

package
v0.0.0-...-d5bad45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClientConfig

func BuildClientConfig(masterURL string, kubeConfigPath string, timeout time.Duration) (*restClient.Config, error)

BuildClientConfig is used in cmd package

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client manages calls to Kubernetes API

func NewClient

func NewClient(loadTestClient loadTestV1.LoadTestInterface, kubeClient kubernetes.Interface, logger *zap.Logger) *Client

NewClient creates new Kubernetes client

func (*Client) CountExistingLoadtests

func (c *Client) CountExistingLoadtests() (map[apisLoadTestV1.LoadTestPhase]int64, map[apisLoadTestV1.LoadTestType]int64, error)

CountExistingLoadtests used in metrics to report running loadtests

func (*Client) CreateLoadTest

func (c *Client) CreateLoadTest(ctx context.Context, loadTest *apisLoadTestV1.LoadTest) (string, error)

CreateLoadTest creates new load test from given request data

func (*Client) DeleteLoadTest

func (c *Client) DeleteLoadTest(ctx context.Context, loadTest string) error

DeleteLoadTest deletes load test CR

func (*Client) GetLoadTest

func (c *Client) GetLoadTest(ctx context.Context, loadTest string) (*apisLoadTestV1.LoadTest, error)

GetLoadTest returns load test information

func (*Client) GetLoadTestsByLabel

func (c *Client) GetLoadTestsByLabel(ctx context.Context, loadTest *apisLoadTestV1.LoadTest) (*apisLoadTestV1.LoadTestList, error)

GetLoadTestsByLabel lists the load test from given load test labels

func (*Client) GetMasterPodRequest

func (c *Client) GetMasterPodRequest(ctx context.Context, namespace string) (*restClient.Request, error)

GetMasterPodRequest is making an assumptions that we only care about the logs from the most recently created pod. It gets the pods associated with the master job and returns the request that is used for getting the logs

func (*Client) GetWorkerPodRequest

func (c *Client) GetWorkerPodRequest(ctx context.Context, namespace, workerPodNr string) (*restClient.Request, error)

GetWorkerPodRequest is used for getting the logs from worker pod

func (*Client) ListLoadTest

func (c *Client) ListLoadTest(ctx context.Context, opt ListOptions) (*apisLoadTestV1.LoadTestList, error)

ListLoadTest returns list of load tests.

type ListOptions

type ListOptions struct {
	// List of tags.
	Tags map[string]string
	// Phase of loadTest
	Phase apisLoadTestV1.LoadTestPhase
	// Limit.
	Limit int64
	// Continue.
	Continue string
}

ListOptions is options to find load tests.

type Toleration

type Toleration struct {
	Key      string
	Value    string
	Operator string
	Effect   string
}

Toleration is a representation of the Kubernetes toleration

func ParseToleration

func ParseToleration(toleration string) (Toleration, error)

ParseToleration parses a pattern of key:value:Operation:Effect to Toleration

func (Toleration) Validate

func (t Toleration) Validate() error

Validate validates the Toleration properties to be compatible with Kubernetes Tolerations

type Tolerations

type Tolerations []Toleration

Tolerations is an alias to Toleration slice

func ParseTolerations

func ParseTolerations(tolerations []string) (Tolerations, error)

ParseTolerations parses a csv pattern of key:value:Operation:Effect to Tolerations

func (Tolerations) KubeToleration

func (tolerations Tolerations) KubeToleration() []kubeCoreV1.Toleration

KubeToleration maps Tolerations to Kubenetes Tolerations

Directories

Path Synopsis
apis
loadtest/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
generated
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/loadtest/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/loadtest/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL