v1alpha1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the apps.redskyops v1alpha1 API group +kubebuilder:object:generate=true +groupName=apps.redskyops.dev

Index

Constants

View Source
const (
	StormForgerAccessTokenSecretName = "stormforger-service-account"
	StormForgerAccessTokenSecretKey  = "accessToken"
)
View Source
const (
	// LabelApplication is the name of the application associated with an object.
	LabelApplication = "redskyops.dev/application"

	// LabelScenario is the application scenario associated with an object.
	LabelScenario = "redskyops.dev/scenario"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.redskyops.dev", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func RegisterDefaults

func RegisterDefaults(s *runtime.Scheme) error

Register the defaulting function for the application root object.

Types

type Application

type Application struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Resources are references to application resources to consider in the generation of the experiment.
	// These strings are the same format as used by Kustomize.
	Resources []string `json:"resources,omitempty"`

	// Parameters specifies additional details about the experiment parameters.
	Parameters *Parameters `json:"parameters,omitempty"`

	// Ingress specifies how to find the entry point to the application.
	Ingress *Ingress `json:"ingress,omitempty"`

	// The list of scenarios to optimize the application for.
	Scenarios []Scenario `json:"scenarios,omitempty"`

	// The list of objectives to optimizat the application for.
	Objectives []Objective `json:"objectives,omitempty"`

	// StormForger allows you to configure StormForger to apply load on your application.
	StormForger *StormForger `json:"stormForger,omitempty"`
	// contains filtered or unexported fields
}

Application represents a description of an application to run experiments on. +kubebuilder:object:root=true

func (*Application) DeepCopy

func (in *Application) DeepCopy() *Application

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application.

func (*Application) DeepCopyInto

func (in *Application) DeepCopyInto(out *Application)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Application) DeepCopyObject

func (in *Application) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Application) Default

func (in *Application) Default()

func (*Application) HasDefaultObjectives

func (in *Application) HasDefaultObjectives() bool

HasDefaultObjectives checks to see if the current number of objectives matches what was present when the application was last defaulted.

type ContainerResources

type ContainerResources struct {
	// Label selector of Kubernetes objects to consider when generating container resources patches.
	LabelSelector string `json:"labelSelector,omitempty"`
}

ContainerResources specifies which resources in the application should have their container resources (CPU and memory) optimized.

func (*ContainerResources) DeepCopy

func (in *ContainerResources) DeepCopy() *ContainerResources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResources.

func (*ContainerResources) DeepCopyInto

func (in *ContainerResources) DeepCopyInto(out *ContainerResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DurationObjective added in v1.9.3

type DurationObjective struct {
	// The duration to optimize. Can be one of the following values: `trial`.
	DurationType
}

DurationObjective is used to optimize the amount of time elapsed in a specific scenario.

func (*DurationObjective) DeepCopy added in v1.9.3

func (in *DurationObjective) DeepCopy() *DurationObjective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DurationObjective.

func (*DurationObjective) DeepCopyInto added in v1.9.3

func (in *DurationObjective) DeepCopyInto(out *DurationObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DurationObjective) UnmarshalJSON added in v1.9.3

func (in *DurationObjective) UnmarshalJSON(data []byte) error

UnmarshalJSON allows a timing objective to be specified as a simple string.

type DurationType added in v1.9.3

type DurationType string

DurationType describes something which occurs over an arbitrary time interval.

const (
	DurationTrial DurationType = "trial"
)

type ErrorRateObjective added in v1.9.3

type ErrorRateObjective struct {
	// The error rate to optimize. Can be one of the following values: `requests`.
	ErrorRateType
}

ErrorRateObjective is used to optimize the error rate of an application in a specific scenario.

func (*ErrorRateObjective) DeepCopy added in v1.9.3

func (in *ErrorRateObjective) DeepCopy() *ErrorRateObjective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorRateObjective.

func (*ErrorRateObjective) DeepCopyInto added in v1.9.3

func (in *ErrorRateObjective) DeepCopyInto(out *ErrorRateObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ErrorRateObjective) UnmarshalJSON added in v1.9.3

func (in *ErrorRateObjective) UnmarshalJSON(data []byte) error

UnmarshalJSON allows an error rate objective to be specified as a simple string.

type ErrorRateType added in v1.9.3

type ErrorRateType string

ErrorRateType describes something which can fail.

const (
	ErrorRateRequests ErrorRateType = "requests"
)

type Ingress

type Ingress struct {
	// The URL used to access the application from outside the cluster.
	URL string `json:"url,omitempty"`
}

Ingress describes the point of ingress to the application.

func (*Ingress) DeepCopy

func (in *Ingress) DeepCopy() *Ingress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ingress.

func (*Ingress) DeepCopyInto

func (in *Ingress) DeepCopyInto(out *Ingress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LatencyObjective

type LatencyObjective struct {
	// The latency to optimize. Can be one of the following values:
	// `minimum` (or `min`), `maximum` (or `max`), `mean` (or `average`, `avg`),
	// `percentile_50` (or `p50`, `median`, `med`), `percentile_95` (or `p95`),
	// `percentile_99` (or `p99`).
	LatencyType
}

LatencyObjective is used to optimize the responsiveness of an application in a specific scenario.

func (*LatencyObjective) DeepCopy

func (in *LatencyObjective) DeepCopy() *LatencyObjective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LatencyObjective.

func (*LatencyObjective) DeepCopyInto

func (in *LatencyObjective) DeepCopyInto(out *LatencyObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LatencyObjective) UnmarshalJSON

func (in *LatencyObjective) UnmarshalJSON(data []byte) error

UnmarshalJSON allows a latency objective to be specified as a simple string.

type LatencyType

type LatencyType string

LatencyType describes a measure of latency.

const (
	LatencyMinimum      LatencyType = "minimum"
	LatencyMaximum      LatencyType = "maximum"
	LatencyMean         LatencyType = "mean"
	LatencyPercentile50 LatencyType = "percentile_50"
	LatencyPercentile95 LatencyType = "percentile_95"
	LatencyPercentile99 LatencyType = "percentile_99"
)

func FixLatency

func FixLatency(in LatencyType) LatencyType

FixLatency returns a constant value from a user entered value.

type LocustScenario

type LocustScenario struct {
	// Path to a Python module file to import.
	Locustfile string `json:"locustfile,omitempty"`
	// Number of concurrent Locust users.
	Users *int `json:"users,omitempty"`
	// The rate per second in which users are spawned.
	SpawnRate *int `json:"spawnRate,omitempty"`
	// Stop after the specified amount of time.
	RunTime *metav1.Duration `json:"runTime,omitempty"`
}

LocustScenario is used to generate load using Locust.

func (*LocustScenario) DeepCopy

func (in *LocustScenario) DeepCopy() *LocustScenario

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocustScenario.

func (*LocustScenario) DeepCopyInto

func (in *LocustScenario) DeepCopyInto(out *LocustScenario)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Objective

type Objective struct {
	// The name of the objective. If no objective specific configuration is supplied, the name is
	// used to derive a configuration. For example, any valid latency (prefixed or suffixed with
	// "latency") will configure a default latency objective.
	Name string `json:"name"`
	// The upper bound for the objective.
	Max *resource.Quantity `json:"max,omitempty"`
	// The lower bound for the objective.
	Min *resource.Quantity `json:"min,omitempty"`
	// Flag indicating that this objective should optimized instead of monitored (default: true).
	Optimize *bool `json:"optimize,omitempty"`

	// Requests is used to optimize the resources consumed by an application.
	Requests *RequestsObjective `json:"requests,omitempty"`
	// Latency is used to optimize the responsiveness of an application.
	Latency *LatencyObjective `json:"latency,omitempty"`
	// ErrorRate is used to optimize the failure rate of an application.
	ErrorRate *ErrorRateObjective `json:"errorRate,omitempty"`
	// Duration is used to optimize the elapsed time of an application performing a fixed amount of work.
	Duration *DurationObjective `json:"duration,omitempty"`

	// Internal use field for marking objectives as having been implemented. For example,
	// it may be impossible to optimize for some objectives based on the current state.
	Implemented bool `json:"-"`
}

Objective describes the goal of the optimization in terms of specific metrics. Note that only one objective configuration can be specified at a time.

func (*Objective) DeepCopy

func (in *Objective) DeepCopy() *Objective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Objective.

func (*Objective) DeepCopyInto

func (in *Objective) DeepCopyInto(out *Objective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Objective) Default

func (in *Objective) Default()

type Parameters

type Parameters struct {
	// Information related to the discovery of container resources parameters like CPU and memory.
	ContainerResources *ContainerResources `json:"containerResources,omitempty"`
	// Information related to the discovery of replica parameters.
	Replicas *Replicas `json:"replicas,omitempty"`
}

Parameters describes the strategy for tuning the application.

func (*Parameters) DeepCopy

func (in *Parameters) DeepCopy() *Parameters

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameters.

func (*Parameters) DeepCopyInto

func (in *Parameters) DeepCopyInto(out *Parameters)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Replicas

type Replicas struct {
	// Label selector of Kubernetes objects to consider when generating replica patches.
	LabelSelector string `json:"labelSelector,omitempty"`
}

Replicas specifies which resources in the application should have their replica count optimized.

func (*Replicas) DeepCopy

func (in *Replicas) DeepCopy() *Replicas

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Replicas.

func (*Replicas) DeepCopyInto

func (in *Replicas) DeepCopyInto(out *Replicas)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RequestsObjective

type RequestsObjective struct {
	// Labels of the pods which should be considered when collecting cost information.
	MetricSelector string `json:"metricSelector,omitempty"`
	// Weights are used to determine which container resources should be optimized.
	Weights corev1.ResourceList `json:"weights,omitempty"`
}

RequestsObjective is used to optimize the resource requests of an application in a specific scenario.

func (*RequestsObjective) DeepCopy

func (in *RequestsObjective) DeepCopy() *RequestsObjective

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestsObjective.

func (*RequestsObjective) DeepCopyInto

func (in *RequestsObjective) DeepCopyInto(out *RequestsObjective)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Scenario

type Scenario struct {
	// The name of scenario.
	Name string `json:"name"`
	// StormForger configuration for the scenario.
	StormForger *StormForgerScenario `json:"stormforger,omitempty"`
	// Locust configuration for the scenario.
	Locust *LocustScenario `json:"locust,omitempty"`
}

Scenario describes a specific pattern of load to optimize the application for.

func (*Scenario) DeepCopy

func (in *Scenario) DeepCopy() *Scenario

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scenario.

func (*Scenario) DeepCopyInto

func (in *Scenario) DeepCopyInto(out *Scenario)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Scenario) Default

func (in *Scenario) Default()

type StormForger

type StormForger struct {
	// The name of the StormForger organization.
	Organization string `json:"org,omitempty"`
	// Configuration for the StormForger service account.
	AccessToken *StormForgerAccessToken `json:"accessToken,omitempty"`
}

StormForger describes global configuration related to StormForger.

func (*StormForger) DeepCopy

func (in *StormForger) DeepCopy() *StormForger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StormForger.

func (*StormForger) DeepCopyInto

func (in *StormForger) DeepCopyInto(out *StormForger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StormForger) Default

func (in *StormForger) Default()

type StormForgerAccessToken

type StormForgerAccessToken struct {
	// The path to the file that contains the service account access token.
	File string `json:"file,omitempty"`
	// A literal token value, this should only be used for testing as it is not secure.
	Literal string `json:"literal,omitempty"`
	// Reference to an existing secret key that contains the access token.
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

StormForgerAccessToken is used to configure a service account access token for the StormForger API.

func (*StormForgerAccessToken) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StormForgerAccessToken.

func (*StormForgerAccessToken) DeepCopyInto

func (in *StormForgerAccessToken) DeepCopyInto(out *StormForgerAccessToken)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StormForgerAccessToken) Default

func (in *StormForgerAccessToken) Default()

type StormForgerScenario

type StormForgerScenario struct {
	// The test case can be used to specify an existing test case in the StormForger API or
	// it can be used to override the generated test case name when specified in conjunction
	// with the local test case file. The organization is optional if it is configured globally.
	TestCase string `json:"testCase,omitempty"`
	// Path to a local test case file used to define a new test case in the StormForger API.
	TestCaseFile string `json:"testCaseFile,omitempty"`
}

StormForgerScenario is used to generate load using StormForger.

func (*StormForgerScenario) DeepCopy

func (in *StormForgerScenario) DeepCopy() *StormForgerScenario

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StormForgerScenario.

func (*StormForgerScenario) DeepCopyInto

func (in *StormForgerScenario) DeepCopyInto(out *StormForgerScenario)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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