v2alpha2

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Overview

Package v2alpha2 contains API Schema definitions for the v2alpha2 API group +kubebuilder:object:generate=true +groupName=iter8.tools

Index

Constants

View Source
const (
	ReasonExperimentInitialized      = "ExperimentInitialized"
	ReasonTargetAcquired             = "TargetAcquired"
	ReasonIterationCompleted         = "IterationUpdate"
	ReasonExperimentCompleted        = "ExperimentCompleted"
	ReasonAnalyticsServiceError      = "AnalyticsServiceError"
	ReasonMetricUnavailable          = "MetricUnavailable"
	ReasonMetricsUnreadable          = "MetricsUnreadable"
	ReasonHandlerLaunched            = "HandlerLaunched"
	ReasonHandlerCompleted           = "HandlerCompleted"
	ReasonHandlerFailed              = "HandlerFailed"
	ReasonLaunchHandlerFailed        = "LaunchHandlerFailed"
	ReasonWeightRedistributionFailed = "WeightRedistributionFailed"
	ReasonInvalidExperiment          = "InvalidExperiment"
	ReasonStageAdvanced              = "StageAdvanced"
)

A set of reason setting the experiment condition status

View Source
const (
	// DefaultStartHandler is the prefix of the default start handler
	DefaultStartHandler string = "start"

	// DefaultFinishHandler is the prefix of the default finish handler
	DefaultFinishHandler string = "finish"

	// DefaultFailureHandler is the prefix of the default failure handler
	DefaultFailureHandler string = "finish"

	// DefaultRollbackHandler is the prefix of the default rollback handler
	DefaultRollbackHandler string = "finish"

	// DefaultLoopHandler is the prefix of the default loop handler
	DefaultLoopHandler string = "loop"

	// DefaultMaxCandidateWeight is the default traffic percentage used in experiment, which is 100
	DefaultMaxCandidateWeight int32 = 100

	// DefaultMaxCandidateWeightIncrement is the default maxIncrement for traffic update, which is 10
	DefaultMaxCandidateWeightIncrement int32 = 10

	// DefaultDeploymentPattern is the default deployment pattern for experiments
	// It takes effect when the testing pattern is canary, A/B or A/B/n
	DefaultDeploymentPattern DeploymentPatternType = DeploymentPatternProgressive

	// DefaultIntervalSeconds is default interval duration as a string
	DefaultIntervalSeconds = 20

	// DefaultIterationsPerLoop is the default number of iterations, 15
	DefaultIterationsPerLoop int32 = 15

	// DefaultMaxLoops is the default maximum number of loops, 1
	// reserved for future use
	DefaultMaxLoops int32 = 1
)
View Source
const (
	//DefaultCompletedIterations is the number of iterations that have completed; ie, 0
	DefaultCompletedIterations = 0
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "iter8.tools", Version: "v2alpha2"}

	// 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
)
View Source
var DefaultBlueGreenSplit = []int32{0, 100}

DefaultBlueGreenSplit is the default split to be used for bluegreen experiment

ValidTestingPatternTypes are legal strategy types iter8 is aware of Should match list in github.com/iter8-tools/etc3/api/v2alpha2 (cf. constants.go)

Functions

This section is empty.

Types

type Action

type Action []TaskSpec

Action is a slice of task specifications.

func (Action) DeepCopy

func (in Action) DeepCopy() Action

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

func (Action) DeepCopyInto

func (in Action) DeepCopyInto(out *Action)

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

type ActionMap

type ActionMap map[string]Action

ActionMap type for containing a collection of actions.

func (ActionMap) DeepCopy

func (in ActionMap) DeepCopy() ActionMap

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

func (ActionMap) DeepCopyInto

func (in ActionMap) DeepCopyInto(out *ActionMap)

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

type AggregatedBuiltinHists added in v0.1.24

type AggregatedBuiltinHists struct {
	AnalysisMetaData `json:",inline" yaml:",inline"`
	// This field needs leeway to evolve. At the moment, it would look like DurationHists from fortio output, but further experimentation is needed. Hence, `apiextensionsv1.JSON` is a safe starting point.
	Data apiextensionsv1.JSON `json:"data" yaml:"data"`
}

AggregatedBuiltinHists ..

func (*AggregatedBuiltinHists) DeepCopy added in v0.1.24

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

func (*AggregatedBuiltinHists) DeepCopyInto added in v0.1.24

func (in *AggregatedBuiltinHists) DeepCopyInto(out *AggregatedBuiltinHists)

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

type AggregatedMetricsAnalysis

type AggregatedMetricsAnalysis struct {
	AnalysisMetaData `json:",inline" yaml:",inline"`

	// Data is a map from metric name to most recent metric data
	Data map[string]AggregatedMetricsData `json:"data" yaml:"data"`
}

AggregatedMetricsAnalysis ..

func (*AggregatedMetricsAnalysis) DeepCopy

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

func (*AggregatedMetricsAnalysis) DeepCopyInto

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

type AggregatedMetricsData

type AggregatedMetricsData struct {
	// Max value observed for this metric across all versions
	// +optional
	Max *resource.Quantity `json:"max,omitempty" yaml:"max,omitempty"`

	// Min value observed for this metric across all versions
	// +optional
	Min *resource.Quantity `json:"min,omitempty" yaml:"min,omitempty"`

	// Data is a map from version name to the most recent aggregated metrics data for that version
	Data map[string]AggregatedMetricsVersionData `json:"data" yaml:"data"`
}

AggregatedMetricsData ..

func (*AggregatedMetricsData) DeepCopy

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

func (*AggregatedMetricsData) DeepCopyInto

func (in *AggregatedMetricsData) DeepCopyInto(out *AggregatedMetricsData)

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

type AggregatedMetricsVersionData

type AggregatedMetricsVersionData struct {
	// Max value observed for this metric for this version
	// +optional
	Max *resource.Quantity `json:"max,omitempty" yaml:"max,omitempty"`

	// Min value observed for this metric for this version
	// +optional
	Min *resource.Quantity `json:"min,omitempty" yaml:"min,omitempty"`

	// Value of the metric observed for this version
	// +optional
	Value *resource.Quantity `json:"value,omitempty" yaml:"value,omitempty"`

	// SampleSize is the size of the sample used for computing this metric.
	// This field is applicable only to Gauge metrics
	// +kubebuilder:validation:Minimum:=0
	SampleSize *int32 `json:"sampleSize,omitempty" yaml:"sampleSize,omitempty"`
}

AggregatedMetricsVersionData ..

func (*AggregatedMetricsVersionData) DeepCopy

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

func (*AggregatedMetricsVersionData) DeepCopyInto

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

type Analysis

type Analysis struct {
	// AggregatedBuiltinHistograms -- aggregated builtin metrics will be derived from this data structure
	AggregatedBuiltinHists *AggregatedBuiltinHists `json:"aggregatedBuiltinHists,omitempty" yaml:"aggregatedBuiltinHists,omitempty"`

	// AggregatedMetrics
	AggregatedMetrics *AggregatedMetricsAnalysis `json:"aggregatedMetrics,omitempty" yaml:"aggregatedMetrics,omitempty"`

	// WinnerAssessment
	WinnerAssessment *WinnerAssessmentAnalysis `json:"winnerAssessment,omitempty" yaml:"winnerAssessment,omitempty"`

	// VersionAssessments
	VersionAssessments *VersionAssessmentAnalysis `json:"versionAssessments,omitempty" yaml:"versionAssessments,omitempty"`

	// Weights
	Weights *WeightsAnalysis `json:"weights,omitempty" yaml:"weights,omitempty"`
}

Analysis is data from an analytics provider

func (*Analysis) DeepCopy

func (in *Analysis) DeepCopy() *Analysis

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

func (*Analysis) DeepCopyInto

func (in *Analysis) DeepCopyInto(out *Analysis)

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

type AnalysisMetaData

type AnalysisMetaData struct {
	// Provenance is source of data
	Provenance string `json:"provenance" yaml:"provenance"`

	// Timestamp is the timestamp when the controller got its data from an analytics engine
	Timestamp metav1.Time `json:"timestamp" yaml:"timestamp"`

	// Message optional messsage for user
	// +optional
	Message *string `json:"message,omitempty" yaml:"message,omitempty"`
}

AnalysisMetaData ..

func (*AnalysisMetaData) DeepCopy

func (in *AnalysisMetaData) DeepCopy() *AnalysisMetaData

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

func (*AnalysisMetaData) DeepCopyInto

func (in *AnalysisMetaData) DeepCopyInto(out *AnalysisMetaData)

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

type AuthType added in v0.1.20

type AuthType string

AuthType identifies the type of authentication used in the HTTP request +kubebuilder:validation:Enum=Basic;Bearer;APIKey

const (
	// BasicAuthType corresponds to authentication with basic auth
	BasicAuthType AuthType = "Basic"

	// BearerAuthType corresponds to authentication with bearer token
	BearerAuthType AuthType = "Bearer"

	// APIKeyAuthType corresponds to authentication with API keys
	APIKeyAuthType AuthType = "APIKey"
)

type BooleanList

type BooleanList []bool

BooleanList ..

func (BooleanList) DeepCopy

func (in BooleanList) DeepCopy() BooleanList

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

func (BooleanList) DeepCopyInto

func (in BooleanList) DeepCopyInto(out *BooleanList)

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

type Criteria

type Criteria struct {

	// RequestCount identifies metric to be used to count how many requests a version has seen
	// Typically set by the controller (based on setup configuration) but can be overridden by the user
	// + optional
	RequestCount *string `json:"requestCount,omitempty" yaml:"requestCount,omitempty"`

	// Rewards is a list of metrics that should be used to evaluate the reward for a version in the experiment.
	// +optional
	Rewards []Reward `json:"rewards,omitempty" yaml:"rewards,omitempty"`

	// Indicators is a list of metrics to be measured and reported on each iteration of the experiment.
	// +optional
	Indicators []string `json:"indicators,omitempty" yaml:"indicators,omitempty"`

	// Objectives is a list of conditions on metrics that must be tested on each iteration of the experiment.
	// Failure of an objective might reduces the likelihood that a version will be selected as the winning version.
	// Failure of an objective might also trigger an experiment rollback.
	// +optional
	Objectives []Objective `json:"objectives,omitempty" yaml:"objectives,omitempty"`

	// Strength identifies the required degree of support the analytics must provide before it will
	// assert success for an objective.
	// +optional
	Strength apiextensionsv1.JSON `json:"strength,omitempty" yaml:"strength,omitempty"`
}

Criteria is list of criteria to be evaluated throughout the experiment

func (*Criteria) DeepCopy

func (in *Criteria) DeepCopy() *Criteria

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

func (*Criteria) DeepCopyInto

func (in *Criteria) DeepCopyInto(out *Criteria)

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

type DeploymentPatternType

type DeploymentPatternType string

DeploymentPatternType identifies the deployment patterns that can be used +kubebuilder:validation:Enum=FixedSplit;Progressive;BlueGreen

const (
	// DeploymentPatternFixedSplit indicates the deployment pattern is fixed split
	DeploymentPatternFixedSplit DeploymentPatternType = "FixedSplit"

	// DeploymentPatternProgressive indicates that the deployment pattern progressive
	DeploymentPatternProgressive DeploymentPatternType = "Progressive"

	// DeploymentPatternBlueGreen indicates that the deployment pattern is blue-green
	DeploymentPatternBlueGreen DeploymentPatternType = "BlueGreen"
)

type Duration

type Duration struct {
	// IntervalSeconds is the length of an interval of the experiment in seconds
	// Default is 20 (seconds)
	// +kubebuilder:validation:Minimum:=1
	// +optional
	IntervalSeconds *int32 `json:"intervalSeconds,omitempty" yaml:"intervalSeconds,omitempty"`

	// IterationsPerLoop is the maximum number of iterations
	// Default is 15
	// +kubebuilder:validation:Minimum:=1
	// +optional
	IterationsPerLoop *int32 `json:"iterationsPerLoop,omitempty" yaml:"iterationsPerLoop,omitempty"`

	// MaxLoops is the maximum number of loops
	// Default is 1
	// Reserved for future use
	// +kubebuilder:validation:Minimum:=1
	// +optional
	MaxLoops *int32 `json:"maxLoops,omitempty" yaml:"maxLoops,omitempty"`
}

Duration of an experiment

func (*Duration) DeepCopy

func (in *Duration) DeepCopy() *Duration

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

func (*Duration) DeepCopyInto

func (in *Duration) DeepCopyInto(out *Duration)

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

type Experiment

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

	Spec   ExperimentSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status ExperimentStatus `json:"status,omitempty" yaml:"spec,omitempty"`
}

Experiment is the Schema for the experiments API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="type",type="string",JSONPath=".spec.strategy.testingPattern" +kubebuilder:printcolumn:name="target",type="string",JSONPath=".spec.target" +kubebuilder:printcolumn:name="stage",type="string",JSONPath=".status.stage" +kubebuilder:printcolumn:name="completed iterations",type="string",JSONPath=".status.completedIterations" +kubebuilder:printcolumn:name="message",type="string",JSONPath=".status.message"

func (*Experiment) DeepCopy

func (in *Experiment) DeepCopy() *Experiment

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

func (*Experiment) DeepCopyInto

func (in *Experiment) DeepCopyInto(out *Experiment)

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

func (*Experiment) DeepCopyObject

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

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

func (*Experiment) InitializeStatus

func (e *Experiment) InitializeStatus()

InitializeStatus initialize status value of an experiment

type ExperimentBuilder

type ExperimentBuilder Experiment

ExperimentBuilder ..

func NewExperiment

func NewExperiment(name, namespace string) *ExperimentBuilder

NewExperiment returns an iter8 experiment

func (*ExperimentBuilder) Build

func (b *ExperimentBuilder) Build() *Experiment

Build the experiment object

func (*ExperimentBuilder) DeepCopy

func (in *ExperimentBuilder) DeepCopy() *ExperimentBuilder

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

func (*ExperimentBuilder) DeepCopyInto

func (in *ExperimentBuilder) DeepCopyInto(out *ExperimentBuilder)

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

func (*ExperimentBuilder) WithAction

func (b *ExperimentBuilder) WithAction(key string, tasks []TaskSpec) *ExperimentBuilder

WithAction ..

func (*ExperimentBuilder) WithBaselineVersion

func (b *ExperimentBuilder) WithBaselineVersion(name string, objRef *corev1.ObjectReference) *ExperimentBuilder

WithBaselineVersion ..

func (*ExperimentBuilder) WithCandidateVersion

func (b *ExperimentBuilder) WithCandidateVersion(name string, objRef *corev1.ObjectReference) *ExperimentBuilder

WithCandidateVersion .. Expects VersionInfo to be defined already via WithBaselineVersion()

func (*ExperimentBuilder) WithCondition

func (b *ExperimentBuilder) WithCondition(condition ExperimentConditionType, status corev1.ConditionStatus, reason string, messageFormat string, messageA ...interface{}) *ExperimentBuilder

WithCondition ..

func (*ExperimentBuilder) WithCurrentWeight

func (b *ExperimentBuilder) WithCurrentWeight(name string, weight int32) *ExperimentBuilder

WithCurrentWeight ..

func (*ExperimentBuilder) WithDeploymentPattern

func (b *ExperimentBuilder) WithDeploymentPattern(deploymentPattern DeploymentPatternType) *ExperimentBuilder

WithDeploymentPattern ..

func (*ExperimentBuilder) WithDuration

func (b *ExperimentBuilder) WithDuration(interval int32, iterationsPerLoop int32, maxLoops int32) *ExperimentBuilder

WithDuration ..

func (*ExperimentBuilder) WithIndicator

func (b *ExperimentBuilder) WithIndicator(metric Metric) *ExperimentBuilder

WithIndicator ..

func (*ExperimentBuilder) WithObjective

func (b *ExperimentBuilder) WithObjective(metric Metric, upper *resource.Quantity, lower *resource.Quantity, rollback bool) *ExperimentBuilder

WithObjective ..

func (*ExperimentBuilder) WithRecommendedWeight

func (b *ExperimentBuilder) WithRecommendedWeight(name string, weight int32) *ExperimentBuilder

WithRecommendedWeight ..

func (*ExperimentBuilder) WithRequestCount

func (b *ExperimentBuilder) WithRequestCount(requestCount string) *ExperimentBuilder

WithRequestCount ..

func (*ExperimentBuilder) WithReward

func (b *ExperimentBuilder) WithReward(metric Metric, preferredDirection PreferredDirectionType) *ExperimentBuilder

WithReward ..

func (*ExperimentBuilder) WithTarget

func (b *ExperimentBuilder) WithTarget(target string) *ExperimentBuilder

WithTarget sets spec.Target

func (*ExperimentBuilder) WithTestingPattern

func (b *ExperimentBuilder) WithTestingPattern(testingPattern TestingPatternType) *ExperimentBuilder

WithTestingPattern ..

type ExperimentCondition

type ExperimentCondition struct {
	// Type of the condition
	Type ExperimentConditionType `json:"type" yaml:"type"`

	// Status of the condition
	Status corev1.ConditionStatus `json:"status" yaml:"status"`

	// LastTransitionTime is the time when this condition is last updated
	// +optional
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"`

	// Reason for the last update
	// +optional
	Reason *string `json:"reason,omitempty" yaml:"reason,omitempty"`

	// Detailed explanation on the update
	// +optional
	Message *string `json:"message,omitempty" yaml:"message,omitempty"`
}

ExperimentCondition describes a condition of an experiment

func (*ExperimentCondition) DeepCopy

func (in *ExperimentCondition) DeepCopy() *ExperimentCondition

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

func (*ExperimentCondition) DeepCopyInto

func (in *ExperimentCondition) DeepCopyInto(out *ExperimentCondition)

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

func (*ExperimentCondition) IsFalse

func (c *ExperimentCondition) IsFalse() bool

IsFalse tells whether the experiment condition is false or not

func (*ExperimentCondition) IsTrue

func (c *ExperimentCondition) IsTrue() bool

IsTrue tells whether the experiment condition is true or not

func (*ExperimentCondition) IsUnknown

func (c *ExperimentCondition) IsUnknown() bool

IsUnknown tells whether the experiment condition is false or not

type ExperimentConditionType

type ExperimentConditionType string

ExperimentConditionType limits conditions can be set by controller +kubebuilder:validation:Enum:=Completed;Failed;TargetAcquired

const (
	// ExperimentConditionExperimentCompleted has status True when the experiment is completed
	// Unknown initially, set to False during initialization
	ExperimentConditionExperimentCompleted ExperimentConditionType = "Completed"

	// ExperimentConditionExperimentFailed has status True when the experiment has failed
	// False until failure occurs
	ExperimentConditionExperimentFailed ExperimentConditionType = "Failed"

	// ExperimentConditionTargetAcquired has status True when an experiment has a lock on the target
	// False until can lock the target
	ExperimentConditionTargetAcquired ExperimentConditionType = "TargetAcquired"
)

type ExperimentList

type ExperimentList struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`
	metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Items           []Experiment `json:"items"`
}

ExperimentList contains a list of Experiment +kubebuilder:object:root=true

func (*ExperimentList) DeepCopy

func (in *ExperimentList) DeepCopy() *ExperimentList

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

func (*ExperimentList) DeepCopyInto

func (in *ExperimentList) DeepCopyInto(out *ExperimentList)

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

func (*ExperimentList) DeepCopyObject

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

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

type ExperimentSpec

type ExperimentSpec struct {

	// Target is used to enable concurrent experimentation
	// Two experiments cannot be running concurrently for the same target.
	// +kubebuilder:validation:MinLength:=1
	Target string `json:"target" yaml:"target"`

	// VersionInfo is information about versions that is typically provided by the domain start handler
	// +optional
	VersionInfo *VersionInfo `json:"versionInfo,omitempty" yaml:"versionInfo,omitempty"`

	// Strategy identifies the type of experiment and its properties
	Strategy Strategy `json:"strategy" yaml:"strategy"`

	// Criteria contains a list of Criterion for assessing the candidates
	// Note that the number of rewards that can be/must be specified depends on the testing pattern
	// +optional
	Criteria *Criteria `json:"criteria,omitempty" yaml:"criteria,omitempty"`

	// Duration describes how long the experiment will last.
	// +optional
	Duration *Duration `json:"duration,omitempty" yaml:"duration,omitempty"`
}

ExperimentSpec defines the desired state of Experiment

func (*ExperimentSpec) DeepCopy

func (in *ExperimentSpec) DeepCopy() *ExperimentSpec

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

func (*ExperimentSpec) DeepCopyInto

func (in *ExperimentSpec) DeepCopyInto(out *ExperimentSpec)

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

func (*ExperimentSpec) GetDeploymentPattern

func (s *ExperimentSpec) GetDeploymentPattern() DeploymentPatternType

GetDeploymentPattern returns spec.strategy.deploymentPattern if set

func (*ExperimentSpec) GetFailureHandler

func (s *ExperimentSpec) GetFailureHandler() *string

GetFailureHandler returns the handler to be called if there is a failure during experiment execution

func (*ExperimentSpec) GetFinishHandler

func (s *ExperimentSpec) GetFinishHandler() *string

GetFinishHandler returns the handler that should be called when an experiment ha completed.

func (*ExperimentSpec) GetIntervalAsDuration

func (s *ExperimentSpec) GetIntervalAsDuration() time.Duration

GetIntervalAsDuration returns spec.duration.intervalSeconds as a time.Duration (in ns)

func (*ExperimentSpec) GetIntervalSeconds

func (s *ExperimentSpec) GetIntervalSeconds() int32

GetIntervalSeconds returns specified(or default) interval for each duration

func (*ExperimentSpec) GetIterationsPerLoop

func (s *ExperimentSpec) GetIterationsPerLoop() int32

GetIterationsPerLoop returns the specified (or default) iterations

func (*ExperimentSpec) GetLoopHandler

func (s *ExperimentSpec) GetLoopHandler() *string

GetLoopHandler returns the handler to be called at the end of each loop (except the last)

func (*ExperimentSpec) GetMaxCandidateWeight

func (s *ExperimentSpec) GetMaxCandidateWeight() int32

GetMaxCandidateWeight return spec.strategy.weights.maxCandidateWeight if set Otherwise it returns DefaultMaxCandidateWeight (100)

func (*ExperimentSpec) GetMaxCandidateWeightIncrement

func (s *ExperimentSpec) GetMaxCandidateWeightIncrement() int32

GetMaxCandidateWeightIncrement return spec.strategy.weights.maxCandidateWeightIncrement if set Otherwise it returns DefaultMaxCandidateWeightIncrement (10)

func (*ExperimentSpec) GetMaxLoops

func (s *ExperimentSpec) GetMaxLoops() int32

GetMaxLoops returns specified (or default) max mumber of loops

func (*ExperimentSpec) GetNumberOfBaseline

func (s *ExperimentSpec) GetNumberOfBaseline() int

GetNumberOfBaseline returns the number of baselines in VersionInfo (1 if present, 0 otherwise)

func (*ExperimentSpec) GetNumberOfCandidates

func (s *ExperimentSpec) GetNumberOfCandidates() int

GetNumberOfCandidates returns the number of candidates in VersionInfo

func (*ExperimentSpec) GetRequestCount

func (s *ExperimentSpec) GetRequestCount() *string

GetRequestCount returns the requst count metric If there are no criteria specified or no request count specified, this is nil

func (*ExperimentSpec) GetRollbackHandler

func (s *ExperimentSpec) GetRollbackHandler() *string

GetRollbackHandler returns the handler to be called if a candidate fails its objective(s)

func (*ExperimentSpec) GetStartHandler

func (s *ExperimentSpec) GetStartHandler() *string

GetStartHandler returns the name of the handler to be called when an experiment starts

func (*ExperimentSpec) HasBaseline

func (s *ExperimentSpec) HasBaseline() bool

HasBaseline determines if a baseline has been identified in a s.VersionInfo

func (*ExperimentSpec) InitializeCriteria

func (s *ExperimentSpec) InitializeCriteria()

InitializeCriteria initializes any criteria details not already set

func (*ExperimentSpec) InitializeDeploymentPattern

func (s *ExperimentSpec) InitializeDeploymentPattern()

InitializeDeploymentPattern initializes spec.strategy.deploymentPattern if not already set

func (*ExperimentSpec) InitializeDuration

func (s *ExperimentSpec) InitializeDuration()

InitializeDuration initializes spec.durations if not already set

func (*ExperimentSpec) InitializeInterval

func (s *ExperimentSpec) InitializeInterval()

InitializeInterval sets duration.interval if not already set using the default value

func (*ExperimentSpec) InitializeIterationsPerLoop

func (s *ExperimentSpec) InitializeIterationsPerLoop()

InitializeIterationsPerLoop sets duration.iterationsPerLoop to the default if not already set

func (*ExperimentSpec) InitializeMaxCandidateWeight

func (s *ExperimentSpec) InitializeMaxCandidateWeight()

InitializeMaxCandidateWeight initializes spec.strategy.weights.maxCandiateWeight if not already set

func (*ExperimentSpec) InitializeMaxCandidateWeightIncrement

func (s *ExperimentSpec) InitializeMaxCandidateWeightIncrement()

InitializeMaxCandidateWeightIncrement initializes spec.strategy.weights.maxCandidateWeightIncrement if not already set

func (*ExperimentSpec) InitializeMaxLoops

func (s *ExperimentSpec) InitializeMaxLoops()

InitializeMaxLoops sets duration.iterationsPerLoop to the default if not already set

func (*ExperimentSpec) InitializeObjectives

func (s *ExperimentSpec) InitializeObjectives()

InitializeObjectives initializes the rollbackOnFailure field of all objectives if the strategy type is "bluegreen"

func (*ExperimentSpec) InitializeRequestCount

func (s *ExperimentSpec) InitializeRequestCount()

InitializeRequestCount sets the request count metric to the default value if not already set

func (*ExperimentSpec) InitializeSpec

func (s *ExperimentSpec) InitializeSpec()

InitializeSpec initializes values in Spec to default values if not already set

func (*ExperimentSpec) InitializeWeights

func (s *ExperimentSpec) InitializeWeights()

InitializeWeights initializes weights if not already set

type ExperimentStageType

type ExperimentStageType string

ExperimentStageType identifies valid stages of an experiment +kubebuilder:validation:Enum:=Waiting;Initializing;Running;Finishing;Completed

const (
	// ExperimentStageWaiting indicates the experiment is not yet scheduled to run because it
	// does not yet have exclusive experiment access to the target
	ExperimentStageWaiting ExperimentStageType = "Waiting"

	// ExperimentStageInitializing indicates an experiment has acquired access to the target
	// and a start handler, if  any, is running
	ExperimentStageInitializing ExperimentStageType = "Initializing"

	// ExperimentStageRunning indicates an experiment is running
	ExperimentStageRunning ExperimentStageType = "Running"

	// ExperimentStageFinishing indicates an experiment has completed its iterations and is
	// running any termination handler (either success or  failure)
	ExperimentStageFinishing ExperimentStageType = "Finishing"

	// ExperimentStageCompleted indicates an experiment has completed
	ExperimentStageCompleted ExperimentStageType = "Completed"
)

func (ExperimentStageType) After

func (stage ExperimentStageType) After(otherStage ExperimentStageType) bool

After Determines if a stage is after another

type ExperimentStatus

type ExperimentStatus struct {

	// List of conditions
	// +optional
	Conditions []*ExperimentCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"`

	// InitTime is the times when the experiment is initialized (experiment CR is new)
	// +optional
	// matches example
	InitTime *metav1.Time `json:"initTime,omitempty" yaml:"initTime,omitempty"`

	// StartTime is the time when the experiment starts (after the start handler finished)
	// +optional
	// matches
	StartTime *metav1.Time `json:"startTime,omitempty" yaml:"startTime,omitempty"`

	// LastUpdateTime is the last time iteration has been updated
	// +optional
	LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"`

	// Stage indicates where the experiment is in its process of execution
	// +optional
	Stage *ExperimentStageType `json:"stage,omitempty" yaml:"stage,omitempty"`

	// CurrentIteration is the current iteration number.
	// It is undefined until the experiment starts.
	// +optional
	CompletedIterations *int32 `json:"completedIterations,omitempty" yaml:"completedIterations,omitempty"`

	// CurrentWeightDistribution is currently applied traffic weights
	// +optional
	CurrentWeightDistribution []WeightData `json:"currentWeightDistribution,omitempty" yaml:"currentWeightDistribution,omitempty"`

	// Analysis returned by the last analyis
	// +optional
	Analysis *Analysis `json:"analysis,omitempty" yaml:"analysis,omitempty"`

	// VersionRecommendedForPromotion is the version recommended as the baseline after the experiment completes.
	// Will be set to the winner (status.analysis[].data.winner)
	// or to the current baseline in the case of a rollback.
	// +optional
	VersionRecommendedForPromotion *string `json:"versionRecommendedForPromotion,omitempty" yaml:"versionRecommendedForPromotion,omitempty"`

	// Message specifies message to show in the kubectl printer
	// +optional
	Message *string `json:"message,omitempty" yaml:"message,omitempty"`

	// Metrics is a list of all the metrics used in the experiment
	// It is inserted by the controller from the references in spec.criteria
	// Key is the name as referenced in spec.criteria
	// +optional
	Metrics []MetricInfo `json:"metrics,omitempty" yaml:"metrics,omitempty"`
}

ExperimentStatus defines the observed state of Experiment

func (*ExperimentStatus) DeepCopy

func (in *ExperimentStatus) DeepCopy() *ExperimentStatus

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

func (*ExperimentStatus) DeepCopyInto

func (in *ExperimentStatus) DeepCopyInto(out *ExperimentStatus)

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

func (*ExperimentStatus) GetCompletedIterations

func (s *ExperimentStatus) GetCompletedIterations() int32

GetCompletedIterations ..

func (*ExperimentStatus) GetCondition

func (s *ExperimentStatus) GetCondition(condition ExperimentConditionType) *ExperimentCondition

GetCondition returns condition of given conditionType

func (*ExperimentStatus) IncrementCompletedIterations

func (s *ExperimentStatus) IncrementCompletedIterations() int32

IncrementCompletedIterations ..

func (*ExperimentStatus) MarkCondition

func (s *ExperimentStatus) MarkCondition(condition ExperimentConditionType, status corev1.ConditionStatus, reason string, messageFormat string, messageA ...interface{}) bool

MarkCondition sets a condition with a status, reason and message. The reason and method are also combined to set status.Message Note that we compare all fields to determine if we are actually changing anything. We do this because we want to also expose the message externally (via Kubernetes events and notifications) but want to do so only once -- the first time it is set.

func (*ExperimentStatus) SetVersionRecommendedForPromotion

func (s *ExperimentStatus) SetVersionRecommendedForPromotion(currentBaseline string)

SetVersionRecommendedForPromotion sets a version recommended for promotion to either: the recommended winner or the current baseline

type MethodType added in v0.1.20

type MethodType string

MethodType identifies the HTTP request method (aka verb) used in the HTTP request +kubebuilder:validation:Enum=GET;POST

const (
	// GETMethodType corresponds to HTTP GET method
	GETMethodType MethodType = "GET"

	// POSTMethodType corresponds to HTTP POST method
	POSTMethodType MethodType = "POST"
)

type Metric

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

	Spec MetricSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
}

Metric is the Schema for the metrics API +kubebuilder:object:root=true +kubebuilder:printcolumn:name="type",type="string",JSONPath=".spec.type" +kubebuilder:printcolumn:name="description",type="string",JSONPath=".spec.description"

func (*Metric) DeepCopy

func (in *Metric) DeepCopy() *Metric

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

func (*Metric) DeepCopyInto

func (in *Metric) DeepCopyInto(out *Metric)

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

func (*Metric) DeepCopyObject

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

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

type MetricBuilder

type MetricBuilder Metric

MetricBuilder type for building new config by hand

func NewMetric

func NewMetric(name, namespace string) *MetricBuilder

NewMetric returns a new metric builder

func (*MetricBuilder) Build

func (b *MetricBuilder) Build() *Metric

Build ..

func (*MetricBuilder) DeepCopy

func (in *MetricBuilder) DeepCopy() *MetricBuilder

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

func (*MetricBuilder) DeepCopyInto

func (in *MetricBuilder) DeepCopyInto(out *MetricBuilder)

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

func (*MetricBuilder) WithAuthType added in v0.1.20

func (b *MetricBuilder) WithAuthType(authType AuthType) *MetricBuilder

WithAuthType ..

func (*MetricBuilder) WithBody added in v0.1.20

func (b *MetricBuilder) WithBody(body string) *MetricBuilder

WithBody ..

func (*MetricBuilder) WithDescription

func (b *MetricBuilder) WithDescription(description string) *MetricBuilder

WithDescription ..

func (*MetricBuilder) WithHeaderTemplates

func (b *MetricBuilder) WithHeaderTemplates(headerTemplates []NamedValue) *MetricBuilder

WithHeaderTemplates ..

func (*MetricBuilder) WithJQExpression

func (b *MetricBuilder) WithJQExpression(jqExpression *string) *MetricBuilder

WithJQExpression ...

func (*MetricBuilder) WithMethod added in v0.1.20

func (b *MetricBuilder) WithMethod(method MethodType) *MetricBuilder

WithMethod ..

func (*MetricBuilder) WithMock added in v0.1.27

func (b *MetricBuilder) WithMock(mock []NamedLevel) *MetricBuilder

WithMock ...

func (*MetricBuilder) WithParams

func (b *MetricBuilder) WithParams(params []NamedValue) *MetricBuilder

WithParams ..

func (*MetricBuilder) WithProvider

func (b *MetricBuilder) WithProvider(provider string) *MetricBuilder

WithProvider ..

func (*MetricBuilder) WithSampleSize

func (b *MetricBuilder) WithSampleSize(name string) *MetricBuilder

WithSampleSize ..

func (*MetricBuilder) WithSecret

func (b *MetricBuilder) WithSecret(name string) *MetricBuilder

WithSecret ..

func (*MetricBuilder) WithType

func (b *MetricBuilder) WithType(t MetricType) *MetricBuilder

WithType ..

func (*MetricBuilder) WithURLTemplate

func (b *MetricBuilder) WithURLTemplate(urlTemplate *string) *MetricBuilder

WithURLTemplate ..

func (*MetricBuilder) WithUnits

func (b *MetricBuilder) WithUnits(units string) *MetricBuilder

WithUnits ..

type MetricInfo

type MetricInfo struct {
	// Name is identifier for metric.  Can be of the form "name" or "namespace/name"
	Name string `json:"name" yaml:"name"`

	// MetricObj is the referenced metric
	// +kubebuilder:validation:EmbeddedResource
	MetricObj Metric `json:"metricObj" yaml:"metricObj"`
}

MetricInfo is name/value pair; entry for list of metrics

func (*MetricInfo) DeepCopy

func (in *MetricInfo) DeepCopy() *MetricInfo

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

func (*MetricInfo) DeepCopyInto

func (in *MetricInfo) DeepCopyInto(out *MetricInfo)

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

type MetricList

type MetricList struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`
	metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Items           []Metric `json:"items" yaml:"items"`
}

MetricList contains a list of Metric +kubebuilder:object:root=true

func (*MetricList) DeepCopy

func (in *MetricList) DeepCopy() *MetricList

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

func (*MetricList) DeepCopyInto

func (in *MetricList) DeepCopyInto(out *MetricList)

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

func (*MetricList) DeepCopyObject

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

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

type MetricSpec

type MetricSpec struct {

	// Params are key/value pairs corresponding to HTTP request parameters
	// Value may be templated, in which Iter8 will attempt to substitute placeholders in the template at query time using version information.
	// +optional
	Params []NamedValue `json:"params,omitempty" yaml:"params,omitempty"`

	// Text description of the metric
	// +optional
	Description *string `json:"description,omitempty" yaml:"description,omitempty"`

	// Units of the metric. Used for informational purposes.
	// +optional
	Units *string `json:"units,omitempty" yaml:"units,omitempty"`

	// Type of the metric
	// +kubebuilder:default:="Gauge"
	// +optional
	Type *MetricType `json:"type,omitempty" yaml:"type,omitempty"`

	// SampleSize is a reference to a counter metric resource.
	// The value of the SampleSize metric denotes the number of data points over which this metric is computed.
	// This field is relevant only when Type == Gauge
	// +optional
	SampleSize *string `json:"sampleSize,omitempty" yaml:"sampleSize,omitempty"`

	// AuthType is the type of authentication used in the HTTP request
	// +optional
	AuthType *AuthType `json:"authType,omitempty" yaml:"authType,omitempty"`

	// Method is the HTTP method used in the HTTP request
	// +kubebuilder:default:="GET"
	// +optional
	Method *MethodType `json:"method,omitempty" yaml:"method,omitempty"`

	// Body is the string used to construct the (json) body of the HTTP request
	// Body may be templated, in which Iter8 will attempt to substitute placeholders in the template at query time using version information.
	// +optional
	Body *string `json:"body,omitempty" yaml:"body,omitempty"`

	// Provider identifies the type of metric database. Used for informational purposes.
	// +optional
	Provider *string `json:"provider,omitempty" yaml:"provider,omitempty"`

	// JQExpression defines the jq expression used by Iter8 to extract the metric value from the (JSON) response returned by the HTTP URL queried by Iter8.
	// An empty string is a valid jq expression.
	// +optional
	JQExpression *string `json:"jqExpression,omitempty" yaml:"jqExpression,omitempty"`

	// Secret is a reference to the Kubernetes secret.
	// Secret contains data used for HTTP authentication.
	// Secret may also contain data used for placeholder substitution in HeaderTemplates and URLTemplate.
	// +optional
	Secret *string `json:"secret,omitempty" yaml:"secret,omitempty"`

	// HeaderTemplates are key/value pairs corresponding to HTTP request headers and their values.
	// Value may be templated, in which Iter8 will attempt to substitute placeholders in the template at query time using Secret.
	// Placeholder substitution will be attempted only when Secret != nil.
	// +optional
	HeaderTemplates []NamedValue `json:"headerTemplates,omitempty" yaml:"headerTemplates,omitempty"`

	// URLTemplate is a template for the URL queried during the HTTP request.
	// Typically, URLTemplate is expected to be the actual URL without any placeholders.
	// However, as indicated by its name, URLTemplate may be templated.
	// In this case, Iter8 will attempt to substitute placeholders in the URLTemplate at query time using Secret.
	// Placeholder substitution will be attempted only when Secret != nil.
	// +optional
	URLTemplate *string `json:"urlTemplate,omitempty" yaml:"urlTemplate,omitempty"`

	// Mock enables mocking of metric values, which is useful in tests and tutorial/documentation.
	// Iter8 metrics can be either counter (which keep increasing over time) or gauge (which can increase or decrease over time).
	// Mock enables mocking of both.
	// +optional
	Mock []NamedLevel `json:"mock,omitempty" yaml:"mock,omitempty"`
}

MetricSpec defines the desired state of Metric

func (*MetricSpec) DeepCopy

func (in *MetricSpec) DeepCopy() *MetricSpec

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

func (*MetricSpec) DeepCopyInto

func (in *MetricSpec) DeepCopyInto(out *MetricSpec)

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

type MetricType

type MetricType string

MetricType identifies the type of the metric. +kubebuilder:validation:Enum=Counter;Gauge

const (
	// CounterMetricType corresponds to Prometheus Counter metric type
	CounterMetricType MetricType = "Counter"

	// GaugeMetricType is an enhancement of Prometheus Gauge metric type
	GaugeMetricType MetricType = "Gauge"
)

type NamedLevel added in v0.1.27

type NamedLevel struct {
	// Name of the version
	Name string `json:"name" yaml:"name"`

	// Level of the version
	Level resource.Quantity `json:"level" yaml:"level"`
}

NamedLevel contains the name of a version and the level of the version to be used in mock metric generation. The semantics of level are the following: If the metric is a counter, if level is x, and time elapsed since the start of the experiment is y, then x*y is the metric value. Note: this will keep increasing over time as counters do. If the metric is gauge, if level is x, the metric value is a random value with mean x. Note: due to randomness, this stay around x but can go up or down as a gauges do.

func (*NamedLevel) DeepCopy added in v0.1.27

func (in *NamedLevel) DeepCopy() *NamedLevel

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

func (*NamedLevel) DeepCopyInto added in v0.1.27

func (in *NamedLevel) DeepCopyInto(out *NamedLevel)

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

type NamedValue

type NamedValue struct {
	// Name of parameter
	Name string `json:"name" yaml:"name"`

	// Value of parameter
	Value string `json:"value" yaml:"value"`
}

NamedValue name/value to be used in constructing a REST query to backend metrics server

func (*NamedValue) DeepCopy

func (in *NamedValue) DeepCopy() *NamedValue

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

func (*NamedValue) DeepCopyInto

func (in *NamedValue) DeepCopyInto(out *NamedValue)

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

type Objective

type Objective struct {
	// Metric is the name of the metric resource that defines the metric to be measured.
	// If the value contains a "/", the prefix will be considered to be a namespace name.
	// If the value does not contain a "/", the metric should be defined either in the same namespace
	// or in the default domain namespace (defined as a property of iter8 when installed).
	// The experiment namespace takes precedence.
	Metric string `json:"metric" yaml:"metric"`

	// UpperLimit is the maximum acceptable value of the metric.
	// +optional
	UpperLimit *resource.Quantity `json:"upperLimit,omitempty" yaml:"upperLimit,omitempty"`

	// UpperLimit is the minimum acceptable value of the metric.
	// +optional
	LowerLimit *resource.Quantity `json:"lowerLimit,omitempty" yaml:"lowerLimit,omitempty"`

	// RollbackOnFailure indicates that if the criterion is not met, the experiment should be ended
	// default is false
	// +optional
	RollbackOnFailure *bool `json:"rollback_on_failure,omitempty" yaml:"rollback_on_failure,omitempty"`
}

Objective is a service level objective

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) GetRollbackOnFailure

func (o *Objective) GetRollbackOnFailure(deploymentPattern DeploymentPatternType) bool

GetRollbackOnFailure identifies if the experiment should be rolledback on failure of an objective

type PreferredDirectionType

type PreferredDirectionType string

PreferredDirectionType defines the valid values for reward.PreferredDirection +kubebuilder:validation:Enum=High;Low

const (
	// PreferredDirectionHigher indicates that a higher value is "better"
	PreferredDirectionHigher PreferredDirectionType = "High"

	// PreferredDirectionLower indicates that a lower value is "better"
	PreferredDirectionLower PreferredDirectionType = "Low"
)

type Reward

type Reward struct {
	// Metric ..
	Metric string `json:"metric" yaml:"metric"`

	// PreferredDirection identifies whether higher or lower values of the reward metric are preferred
	// valid values are "higher" and "lower"
	PreferredDirection PreferredDirectionType `json:"preferredDirection" yaml:"preferredDirection"`
}

Reward ..

func (*Reward) DeepCopy

func (in *Reward) DeepCopy() *Reward

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

func (*Reward) DeepCopyInto

func (in *Reward) DeepCopyInto(out *Reward)

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

type Strategy

type Strategy struct {
	// TestingPattern is the testing pattern of an experiment
	TestingPattern TestingPatternType `json:"testingPattern" yaml:"testingPattern"`

	// DeploymentPattern is the deployment pattern of an experiment.
	// It takes effect when the testing pattern is one of Canary, A/B or A/B/n.
	// It defaults to Progressive.
	// +optional
	DeploymentPattern *DeploymentPatternType `json:"deploymentPattern,omitempty" yaml:"deploymentPattern,omitempty"`

	// Actions define the collections of tasks that are executed by handlers.
	// Specifically, start and finish actions are invoked by start and finish handlers respectively.
	// +optional
	Actions ActionMap `json:"actions,omitempty" yaml:"actions,omitempty"`

	// Weights modify the behavior of the traffic split algorithm.
	// Defaults depend on the experiment type.
	// +optional
	Weights *Weights `json:"weights,omitempty" yaml:"weights,omitempty"`
}

Strategy identifies the type of experiment and its properties The behavior of the experiment can be modified by setting advanced properties.

func (*Strategy) DeepCopy

func (in *Strategy) DeepCopy() *Strategy

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

func (*Strategy) DeepCopyInto

func (in *Strategy) DeepCopyInto(out *Strategy)

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

type TaskSpec

type TaskSpec struct {
	// Task unique identifies the task to be executed with the library.
	// Examples include 'init-experiment', 'exec', etc.
	Task string `json:"task" yaml:"task"`
	// Condition specifies when this task should be executed.
	// Task will be evaluated if condition evaluates to true, and not otherwise.
	// +optional
	Condition *string `json:"condition,omitempty" yaml:"condition,omitempty"`
	// With holds inputs to this task.
	// Different task require different types of inputs. Hence, this data is held as json.RawMessage to be decoded by individual task libraries.
	// +optional
	With map[string]apiextensionsv1.JSON `json:"with,omitempty" yaml:"with,omitempty"`
}

TaskSpec contains the specification of a task.

func (*TaskSpec) DeepCopy

func (in *TaskSpec) DeepCopy() *TaskSpec

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

func (*TaskSpec) DeepCopyInto

func (in *TaskSpec) DeepCopyInto(out *TaskSpec)

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

type TestingPatternType

type TestingPatternType string

TestingPatternType identifies the type of experiment type +kubebuilder:validation:Enum=Canary;A/B;A/B/N;Conformance

const (
	// TestingPatternCanary indicates an experiment is a canary experiment
	TestingPatternCanary TestingPatternType = "Canary"

	// TestingPatternAB indicates an experiment is a A/B experiment
	TestingPatternAB TestingPatternType = "A/B"

	// TestingPatternABN indicates an experiment is a A/B/n experiment
	TestingPatternABN TestingPatternType = "A/B/N"

	// TestingPatternConformance indicates an experiment is a conformance experiment
	TestingPatternConformance TestingPatternType = "Conformance"
)

type VersionAssessmentAnalysis

type VersionAssessmentAnalysis struct {
	AnalysisMetaData `json:",inline" yaml:",inline"`

	// Data is a map from version name to an array of indicators as to whether or not the objectives are satisfied
	// The order of the array entries is the same as the order of objectives in spec.criteria.objectives
	// There must be an entry for each objective
	Data map[string]BooleanList `json:"data" yaml:"data"`
}

VersionAssessmentAnalysis ..

func (*VersionAssessmentAnalysis) DeepCopy

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

func (*VersionAssessmentAnalysis) DeepCopyInto

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

type VersionDetail

type VersionDetail struct {

	// Name is a name for the version
	Name string `json:"name" yaml:"name"`

	// Variables is a list of variables that can be used by handlers and in metrics queries
	// +optional
	Variables []NamedValue `json:"variables,omitempty" yaml:"variables,omitempty"`

	// WeightObjRef is a reference to another kubernetes object
	// +optional
	WeightObjRef *corev1.ObjectReference `json:"weightObjRef,omitempty" yaml:"weightObjRef,omitempty"`
}

VersionDetail is detail about a single version

func (*VersionDetail) DeepCopy

func (in *VersionDetail) DeepCopy() *VersionDetail

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

func (*VersionDetail) DeepCopyInto

func (in *VersionDetail) DeepCopyInto(out *VersionDetail)

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

type VersionInfo

type VersionInfo struct {
	// Baseline is baseline version
	Baseline VersionDetail `json:"baseline" yaml:"baseline"`

	// Candidates is list candidate versions
	// +optional
	Candidates []VersionDetail `json:"candidates,omitempty" yaml:"candidates,omitempty"`
}

VersionInfo is information about versions that is typically provided by the domain start handler.

func (*VersionInfo) DeepCopy

func (in *VersionInfo) DeepCopy() *VersionInfo

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

func (*VersionInfo) DeepCopyInto

func (in *VersionInfo) DeepCopyInto(out *VersionInfo)

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

type WeightData

type WeightData struct {
	// Name the name of a version
	Name string `json:"name" yaml:"name"`

	// Value is the weight assigned to name
	Value int32 `json:"value" yaml:"value"`
}

WeightData is the weight for a version

func (*WeightData) DeepCopy

func (in *WeightData) DeepCopy() *WeightData

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

func (*WeightData) DeepCopyInto

func (in *WeightData) DeepCopyInto(out *WeightData)

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

type Weights

type Weights struct {
	// MaxCandidateWeight is the maximum percent of traffic that should be sent to the
	// candidate versions during an experiment
	// +kubebuilder:validation:Minimum:=0
	// +kubebuilder:validation:Maximum:=100
	// +optional
	MaxCandidateWeight *int32 `json:"maxCandidateWeight,omitempty" yaml:"maxCandidateWeight,omitempty"`

	// MaxCandidateWeightIncrement the maximum permissible increase in traffic to a candidate in one iteration
	// +kubebuilder:validation:Minimum:=0
	// +kubebuilder:validation:Maximum:=100
	// +optional
	MaxCandidateWeightIncrement *int32 `json:"maxCandidateWeightIncrement,omitempty" yaml:"maxCandidateWeightIncrement,omitempty"`
}

Weights modify the behavior of the traffic split algorithm.

func (*Weights) DeepCopy

func (in *Weights) DeepCopy() *Weights

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

func (*Weights) DeepCopyInto

func (in *Weights) DeepCopyInto(out *Weights)

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

type WeightsAnalysis

type WeightsAnalysis struct {
	AnalysisMetaData `json:",inline" yaml:",inline"`

	// Data
	Data []WeightData `json:"data" yaml:"data"`
}

WeightsAnalysis ..

func (*WeightsAnalysis) DeepCopy

func (in *WeightsAnalysis) DeepCopy() *WeightsAnalysis

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

func (*WeightsAnalysis) DeepCopyInto

func (in *WeightsAnalysis) DeepCopyInto(out *WeightsAnalysis)

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

type WinnerAssessmentAnalysis

type WinnerAssessmentAnalysis struct {
	AnalysisMetaData `json:",inline" yaml:",inline"`

	// Data
	Data WinnerAssessmentData `json:"data" yaml:"data"`
}

WinnerAssessmentAnalysis ..

func (*WinnerAssessmentAnalysis) DeepCopy

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

func (*WinnerAssessmentAnalysis) DeepCopyInto

func (in *WinnerAssessmentAnalysis) DeepCopyInto(out *WinnerAssessmentAnalysis)

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

type WinnerAssessmentData

type WinnerAssessmentData struct {
	// WinnerFound whether or not a winning version has been identified
	WinnerFound bool `json:"winnerFound" yaml:"winnerFound"`

	// Winner if found
	// +optional
	Winner *string `json:"winner,omitempty" yaml:"winner,omitempty"`
}

WinnerAssessmentData ..

func (*WinnerAssessmentData) DeepCopy

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

func (*WinnerAssessmentData) DeepCopyInto

func (in *WinnerAssessmentData) DeepCopyInto(out *WinnerAssessmentData)

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