Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func Add(mgr manager.Manager) error
- func Logger(ctx context.Context) logr.Logger
- type DestinationRuleBuilder
- func (b *DestinationRuleBuilder) Build() *v1alpha3.DestinationRule
- func (b *DestinationRuleBuilder) RemoveExperimentLabel() *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithExperimentRegisterd(exp string) *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithInitLabel() *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithName(name string) *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithProgressingLabel() *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithProgressingToStable(stable *appsv1.Deployment) *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithStableDeployment(d *appsv1.Deployment) *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithStableLabel() *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithStableToProgressing(baseline *appsv1.Deployment) *DestinationRuleBuilder
- func (b *DestinationRuleBuilder) WithSubset(name string, d *appsv1.Deployment) *DestinationRuleBuilder
- type IstioRoutingRules
- func (r *IstioRoutingRules) Cleanup(instance *iter8v1alpha1.Experiment, targets *Targets, ic istioclient.Interface) (err error)
- func (r *IstioRoutingRules) DeleteAll(ic istioclient.Interface) (err error)
- func (r *IstioRoutingRules) GetWeight(subset string) int32
- func (rules *IstioRoutingRules) IsInit() bool
- func (r *IstioRoutingRules) IsStable() bool
- func (r *IstioRoutingRules) SetStableLabels()
- func (r *IstioRoutingRules) StableToProgressing(targets *Targets, expName, serviceNamespace string, ic istioclient.Interface) error
- func (r *IstioRoutingRules) ToStable(stableDep *appsv1.Deployment, stableName, serviceName, serviceNamespace string)
- func (r *IstioRoutingRules) UpdateRemoveRules(ic istioclient.Interface) error
- func (r *IstioRoutingRules) UpdateRolloutPercent(serviceName, serviceNamespace string, w int32, ic istioclient.Interface) error
- type Metric
- type Metrics
- type ReconcileExperiment
- func (r *ReconcileExperiment) MarkAnalyticsServiceError(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkAnalyticsServiceRunning(context context.Context, instance *iter8v1alpha1.Experiment)
- func (r *ReconcileExperiment) MarkExperimentFailed(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkExperimentProgress(context context.Context, instance *iter8v1alpha1.Experiment, broadcast bool, ...)
- func (r *ReconcileExperiment) MarkExperimentSucceeded(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkRoutingRulesError(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkRoutingRulesReady(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkSyncMetrics(context context.Context, instance *iter8v1alpha1.Experiment)
- func (r *ReconcileExperiment) MarkSyncMetricsError(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkTargetsError(context context.Context, instance *iter8v1alpha1.Experiment, ...)
- func (r *ReconcileExperiment) MarkTargetsFound(context context.Context, instance *iter8v1alpha1.Experiment) bool
- func (r *ReconcileExperiment) Reconcile(request reconcile.Request) (reconcile.Result, error)
- type Targets
- type VirtualServiceBuilder
- func (b *VirtualServiceBuilder) AppendStableSubset(service, ns string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) Build() *v1alpha3.VirtualService
- func (b *VirtualServiceBuilder) RemoveExperimentLabel() *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithExperimentRegisterd(exp string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithInitLabel() *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithName(name string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithNewStableSet(service string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithProgressingLabel() *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithProgressingToStable(service, ns string, subset string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithResourceVersion(rv string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRolloutPercent(service, ns string, rolloutPercent int32) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithStableLabel() *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithStableToProgressing(service, ns string) *VirtualServiceBuilder
Constants ¶
const ( MetricsConfigMap = "iter8config-metrics" Iter8Namespace = "iter8" Baseline = "baseline" Candidate = "candidate" Stable = "stable" Progressing = "progressing" )
const ( KubernetesService = "v1" KnativeServiceV1Alpha1 = "serving.knative.dev/v1alpha1" Iter8Controller = "iter8-controller" Finalizer = "finalizer.iter8-tools" )
const (
IstioRuleSuffix = ".iter8-experiment"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DestinationRuleBuilder ¶
type DestinationRuleBuilder v1alpha3.DestinationRule
func NewDestinationRule ¶
func NewDestinationRule(serviceName, name, namespace string) *DestinationRuleBuilder
func NewDestinationRuleBuilder ¶
func NewDestinationRuleBuilder(dr *v1alpha3.DestinationRule) *DestinationRuleBuilder
func (*DestinationRuleBuilder) Build ¶
func (b *DestinationRuleBuilder) Build() *v1alpha3.DestinationRule
func (*DestinationRuleBuilder) RemoveExperimentLabel ¶
func (b *DestinationRuleBuilder) RemoveExperimentLabel() *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithExperimentRegisterd ¶
func (b *DestinationRuleBuilder) WithExperimentRegisterd(exp string) *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithInitLabel ¶
func (b *DestinationRuleBuilder) WithInitLabel() *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithName ¶
func (b *DestinationRuleBuilder) WithName(name string) *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithProgressingLabel ¶
func (b *DestinationRuleBuilder) WithProgressingLabel() *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithProgressingToStable ¶
func (b *DestinationRuleBuilder) WithProgressingToStable(stable *appsv1.Deployment) *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithStableDeployment ¶
func (b *DestinationRuleBuilder) WithStableDeployment(d *appsv1.Deployment) *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithStableLabel ¶
func (b *DestinationRuleBuilder) WithStableLabel() *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithStableToProgressing ¶
func (b *DestinationRuleBuilder) WithStableToProgressing(baseline *appsv1.Deployment) *DestinationRuleBuilder
func (*DestinationRuleBuilder) WithSubset ¶
func (b *DestinationRuleBuilder) WithSubset(name string, d *appsv1.Deployment) *DestinationRuleBuilder
WithSubset adds subset to the rule if not existed(will not compare subset labels)
type IstioRoutingRules ¶
type IstioRoutingRules struct { DestinationRule *v1alpha3.DestinationRule VirtualService *v1alpha3.VirtualService }
func (*IstioRoutingRules) Cleanup ¶
func (r *IstioRoutingRules) Cleanup(instance *iter8v1alpha1.Experiment, targets *Targets, ic istioclient.Interface) (err error)
func (*IstioRoutingRules) DeleteAll ¶
func (r *IstioRoutingRules) DeleteAll(ic istioclient.Interface) (err error)
func (*IstioRoutingRules) GetWeight ¶
func (r *IstioRoutingRules) GetWeight(subset string) int32
func (*IstioRoutingRules) IsInit ¶
func (rules *IstioRoutingRules) IsInit() bool
func (*IstioRoutingRules) IsStable ¶
func (r *IstioRoutingRules) IsStable() bool
func (*IstioRoutingRules) SetStableLabels ¶
func (r *IstioRoutingRules) SetStableLabels()
func (*IstioRoutingRules) StableToProgressing ¶
func (r *IstioRoutingRules) StableToProgressing(targets *Targets, expName, serviceNamespace string, ic istioclient.Interface) error
func (*IstioRoutingRules) ToStable ¶
func (r *IstioRoutingRules) ToStable(stableDep *appsv1.Deployment, stableName, serviceName, serviceNamespace string)
func (*IstioRoutingRules) UpdateRemoveRules ¶
func (r *IstioRoutingRules) UpdateRemoveRules(ic istioclient.Interface) error
func (*IstioRoutingRules) UpdateRolloutPercent ¶
func (r *IstioRoutingRules) UpdateRolloutPercent(serviceName, serviceNamespace string, w int32, ic istioclient.Interface) error
type Metric ¶
type Metric struct { Name string `yaml:"name"` IsCounter bool `yaml:"is_counter"` AbsentValue string `yaml:"absent_value"` SampleSizeTemplate string `yaml:"sample_size_query_template"` }
Metric structure of cm/iter8_metric
type ReconcileExperiment ¶
ReconcileExperiment reconciles a Experiment object
func (*ReconcileExperiment) MarkAnalyticsServiceError ¶
func (r *ReconcileExperiment) MarkAnalyticsServiceError(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkAnalyticsServiceRunning ¶
func (r *ReconcileExperiment) MarkAnalyticsServiceRunning(context context.Context, instance *iter8v1alpha1.Experiment)
func (*ReconcileExperiment) MarkExperimentFailed ¶
func (r *ReconcileExperiment) MarkExperimentFailed(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkExperimentProgress ¶
func (r *ReconcileExperiment) MarkExperimentProgress(context context.Context, instance *iter8v1alpha1.Experiment, broadcast bool, reason, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkExperimentSucceeded ¶
func (r *ReconcileExperiment) MarkExperimentSucceeded(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkRoutingRulesError ¶
func (r *ReconcileExperiment) MarkRoutingRulesError(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkRoutingRulesReady ¶
func (r *ReconcileExperiment) MarkRoutingRulesReady(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkSyncMetrics ¶
func (r *ReconcileExperiment) MarkSyncMetrics(context context.Context, instance *iter8v1alpha1.Experiment)
func (*ReconcileExperiment) MarkSyncMetricsError ¶
func (r *ReconcileExperiment) MarkSyncMetricsError(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
func (*ReconcileExperiment) MarkTargetsError ¶
func (r *ReconcileExperiment) MarkTargetsError(context context.Context, instance *iter8v1alpha1.Experiment, messageFormat string, messageA ...interface{})
MarkTargetsError records the condition that the target components are missing
func (*ReconcileExperiment) MarkTargetsFound ¶
func (r *ReconcileExperiment) MarkTargetsFound(context context.Context, instance *iter8v1alpha1.Experiment) bool
func (*ReconcileExperiment) Reconcile ¶
Reconcile reads that state of the cluster for a Experiment object and makes changes based on the state read and what is in the Experiment.Spec +kubebuilder:rbac:groups=iter8.tools,resources=experiments,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=iter8.tools,resources=experiments/status,verbs=get;update;patch +kubebuilder:rbac:groups=networking.istio.io,resources=destinationrules,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=networking.istio.io,resources=virtualservices,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=serving.knative.dev,resources=services,verbs=get;list;watch;update;patch +kubebuilder:rbac:groups=serving.knative.dev,resources=services/status,verbs=get +kubebuilder:rbac:groups=serving.knative.dev,resources=revisions,verbs=get;list;watch +kubebuilder:rbac:groups=serving.knative.dev,resources=revisions/status,verbs=get +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;update;patch;delete +kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch
type Targets ¶
type Targets struct { Service *corev1.Service Baseline *appsv1.Deployment Candidate *appsv1.Deployment }
func InitTargets ¶
func InitTargets() *Targets
func (*Targets) Cleanup ¶
func (t *Targets) Cleanup(context context.Context, instance *iter8v1alpha1.Experiment, client client.Client) error
type VirtualServiceBuilder ¶
type VirtualServiceBuilder v1alpha3.VirtualService
func NewVirtualService ¶
func NewVirtualService(serviceName, name, namespace string) *VirtualServiceBuilder
func NewVirtualServiceBuilder ¶
func NewVirtualServiceBuilder(vs *v1alpha3.VirtualService) *VirtualServiceBuilder
func (*VirtualServiceBuilder) AppendStableSubset ¶
func (b *VirtualServiceBuilder) AppendStableSubset(service, ns string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) Build ¶
func (b *VirtualServiceBuilder) Build() *v1alpha3.VirtualService
func (*VirtualServiceBuilder) RemoveExperimentLabel ¶
func (b *VirtualServiceBuilder) RemoveExperimentLabel() *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithExperimentRegisterd ¶
func (b *VirtualServiceBuilder) WithExperimentRegisterd(exp string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithInitLabel ¶
func (b *VirtualServiceBuilder) WithInitLabel() *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithName ¶
func (b *VirtualServiceBuilder) WithName(name string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithNewStableSet ¶
func (b *VirtualServiceBuilder) WithNewStableSet(service string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithProgressingLabel ¶
func (b *VirtualServiceBuilder) WithProgressingLabel() *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithProgressingToStable ¶
func (b *VirtualServiceBuilder) WithProgressingToStable(service, ns string, subset string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithResourceVersion ¶
func (b *VirtualServiceBuilder) WithResourceVersion(rv string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRolloutPercent ¶
func (b *VirtualServiceBuilder) WithRolloutPercent(service, ns string, rolloutPercent int32) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithStableLabel ¶
func (b *VirtualServiceBuilder) WithStableLabel() *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithStableToProgressing ¶
func (b *VirtualServiceBuilder) WithStableToProgressing(service, ns string) *VirtualServiceBuilder
WithStableToProgressing removes Stable subset while adds Baseline and Candidate subsets to the route