v1alpha1

package
v0.3.4-pre2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// GroupName of the CRDs
	GroupName = "standard.oam.dev"
	// Version of the group of CRDs
	Version = "v1alpha1"
)
View Source
const (
	// RolloutSpecVerified indicates that the rollout spec matches the resource we have in the cluster
	RolloutSpecVerified runtimev1alpha1.ConditionType = "RolloutSpecVerified"
	// RolloutInitialized means all the needed initialization work is done
	RolloutInitialized runtimev1alpha1.ConditionType = "Initialized"
	// RolloutInProgress means we are upgrading resources.
	RolloutInProgress runtimev1alpha1.ConditionType = "Ready"
	// RolloutSucceed means that the rollout is done.
	RolloutSucceed runtimev1alpha1.ConditionType = "Succeed"
	// BatchInitialized
	BatchInitialized runtimev1alpha1.ConditionType = "BatchInitialized"
	// BatchInRolled
	BatchInRolled runtimev1alpha1.ConditionType = "BatchInRolled"
	// BatchVerified
	BatchVerified runtimev1alpha1.ConditionType = "BatchVerified"
	// BatchRolloutFailed
	BatchRolloutFailed runtimev1alpha1.ConditionType = "BatchRolloutFailed"
	// BatchFinalized
	BatchFinalized runtimev1alpha1.ConditionType = "BatchFinalized"
	// BatchReady
	BatchReady runtimev1alpha1.ConditionType = "BatchReady"
)

These are valid conditions of the rollout.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}

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

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

Functions

func NewNegativeCondition added in v0.3.3

func NewNegativeCondition(condType runtimev1alpha1.ConditionType, message string) runtimev1alpha1.Condition

NewNegativeCondition creates a false condition type

func NewPositiveCondition added in v0.3.3

func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition

NewPositiveCondition creates a positive condition type

Types

type Autoscaler

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

	Spec   AutoscalerSpec   `json:"spec"`
	Status AutoscalerStatus `json:"status,omitempty"`
}

Autoscaler is the Schema for the autoscalers API +kubebuilder:object:root=true +kubebuilder:resource:categories={oam}

func (*Autoscaler) DeepCopy

func (in *Autoscaler) DeepCopy() *Autoscaler

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

func (*Autoscaler) DeepCopyInto

func (in *Autoscaler) DeepCopyInto(out *Autoscaler)

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

func (*Autoscaler) DeepCopyObject

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

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

func (*Autoscaler) GetCondition

func (as *Autoscaler) GetCondition(conditionType v1alpha1.ConditionType) v1alpha1.Condition

GetCondition get condition from CR status

func (*Autoscaler) GetWorkloadReference

func (as *Autoscaler) GetWorkloadReference() v1alpha1.TypedReference

GetWorkloadReference get workload reference

func (*Autoscaler) SetConditions

func (as *Autoscaler) SetConditions(c ...v1alpha1.Condition)

SetConditions set condition for CR status

func (*Autoscaler) SetWorkloadReference

func (as *Autoscaler) SetWorkloadReference(reference v1alpha1.TypedReference)

SetWorkloadReference set workload reference

type AutoscalerList

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

AutoscalerList contains a list of Autoscaler

func (*AutoscalerList) DeepCopy

func (in *AutoscalerList) DeepCopy() *AutoscalerList

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

func (*AutoscalerList) DeepCopyInto

func (in *AutoscalerList) DeepCopyInto(out *AutoscalerList)

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

func (*AutoscalerList) DeepCopyObject

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

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

type AutoscalerSpec

type AutoscalerSpec struct {
	// MinReplicas is the minimal replicas
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`

	// MinReplicas is the maximal replicas
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`

	// Triggers lists all triggers
	Triggers []Trigger `json:"triggers"`

	// TargetWorkload specify the workload which is going to be scaled,
	// it could be WorkloadReference or the child resource of it
	TargetWorkload TargetWorkload `json:"targetWorkload,omitempty"`

	// WorkloadReference marks the owner of the workload
	WorkloadReference v1alpha1.TypedReference `json:"workloadRef,omitempty"`
}

AutoscalerSpec defines the desired state of Autoscaler

func (*AutoscalerSpec) DeepCopy

func (in *AutoscalerSpec) DeepCopy() *AutoscalerSpec

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

func (*AutoscalerSpec) DeepCopyInto

func (in *AutoscalerSpec) DeepCopyInto(out *AutoscalerSpec)

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

type AutoscalerStatus

type AutoscalerStatus struct {
	v1alpha1.ConditionedStatus `json:",inline"`
}

AutoscalerStatus defines the observed state of Autoscaler

func (*AutoscalerStatus) DeepCopy

func (in *AutoscalerStatus) DeepCopy() *AutoscalerStatus

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

func (*AutoscalerStatus) DeepCopyInto

func (in *AutoscalerStatus) DeepCopyInto(out *AutoscalerStatus)

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

type Backend

type Backend struct {
	// ReadTimeout used for setting read timeout duration for backend service, the unit is second.
	ReadTimeout int `json:"readTimeout,omitempty"`
	// SendTimeout used for setting send timeout duration for backend service, the unit is second.
	SendTimeout int `json:"sendTimeout,omitempty"`
	// BackendService specifies the backend K8s service and port, it's optional
	BackendService *BackendServiceRef `json:"backendService,omitempty"`
}

Backend defines backend configure for route trait. Route will automatically discover podSpec and label for BackendService. If BackendService is already set, discovery won't work. If BackendService is not set, the discovery mechanism will work.

func (*Backend) DeepCopy

func (in *Backend) DeepCopy() *Backend

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

func (*Backend) DeepCopyInto

func (in *Backend) DeepCopyInto(out *Backend)

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

type BackendServiceRef

type BackendServiceRef struct {
	// Port allow you direct specify backend service port.
	Port intstr.IntOrString `json:"port"`
	// ServiceName allow you direct specify K8s service for backend service.
	ServiceName string `json:"serviceName"`
}

BackendServiceRef specifies the backend K8s service and port, if specified, the two fields are all required

func (*BackendServiceRef) DeepCopy

func (in *BackendServiceRef) DeepCopy() *BackendServiceRef

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

func (*BackendServiceRef) DeepCopyInto

func (in *BackendServiceRef) DeepCopyInto(out *BackendServiceRef)

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

type BatchRollingState added in v0.3.3

type BatchRollingState string

BatchRollingState is the sub state when the rollout is on the fly

const (
	// BatchInitializingState still rolling the batch, the batch rolling is not completed yet
	BatchInitializingState BatchRollingState = "batchInitializing"
	// BatchInRollingState still rolling the batch, the batch rolling is not completed yet
	BatchInRollingState BatchRollingState = "batchInRolling"
	// BatchVerifyingState verifying if the application is ready to roll.
	BatchVerifyingState BatchRollingState = "batchVerifying"
	// BatchRolloutFailedState indicates that the batch didn't get the manual or automatic approval
	BatchRolloutFailedState BatchRollingState = "batchVerifyFailed"
	// BatchFinalizingState indicates that all the pods in the are available, we can move on to the next batch
	BatchFinalizingState BatchRollingState = "batchFinalizing"
	// BatchReadyState indicates that all the pods in the are upgraded and its state is ready
	BatchReadyState BatchRollingState = "batchReady"
)

type CanaryMetric added in v0.3.3

type CanaryMetric struct {
	// Name of the metric
	Name string `json:"name"`

	// Interval represents the windows size
	Interval string `json:"interval,omitempty"`

	// Range value accepted for this metric
	// +optional
	MetricsRange *MetricsExpectedRange `json:"metricsRange,omitempty"`

	// TemplateRef references a metric template object
	// +optional
	TemplateRef *runtimev1alpha1.TypedReference `json:"templateRef,omitempty"`
}

CanaryMetric holds the reference to metrics used for canary analysis

func (*CanaryMetric) DeepCopy added in v0.3.3

func (in *CanaryMetric) DeepCopy() *CanaryMetric

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

func (*CanaryMetric) DeepCopyInto added in v0.3.3

func (in *CanaryMetric) DeepCopyInto(out *CanaryMetric)

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

type HookType added in v0.3.3

type HookType string

HookType can be pre, post or during rollout

const (
	// InitializeRolloutHook execute webhook during the rollout initializing phase
	InitializeRolloutHook HookType = "initialize-rollout"
	// PreBatchRolloutHook execute webhook before each batch rollout
	PreBatchRolloutHook HookType = "pre-batch-rollout"
	// PostBatchRolloutHook execute webhook after each batch rollout
	PostBatchRolloutHook HookType = "post-batch-rollout"
	// FinalizeRolloutHook execute the webhook during the rollout finalizing phase
	FinalizeRolloutHook HookType = "finalize-rollout"
)

type IssuerType

type IssuerType string

IssuerType defines the type of issuer

const (
	// ClusterIssuer is a cluster level type of issuer
	ClusterIssuer IssuerType = "ClusterIssuer"
	// NamespaceIssuer is the default one
	NamespaceIssuer IssuerType = "Issuer"
)

type MetricsExpectedRange added in v0.3.3

type MetricsExpectedRange struct {
	// Minimum value
	// +optional
	Min *intstr.IntOrString `json:"min,omitempty"`

	// Maximum value
	// +optional
	Max *intstr.IntOrString `json:"max,omitempty"`
}

MetricsExpectedRange defines the range used for metrics validation

func (*MetricsExpectedRange) DeepCopy added in v0.3.3

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

func (*MetricsExpectedRange) DeepCopyInto added in v0.3.3

func (in *MetricsExpectedRange) DeepCopyInto(out *MetricsExpectedRange)

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

type MetricsTrait

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

	Spec   MetricsTraitSpec   `json:"spec"`
	Status MetricsTraitStatus `json:"status,omitempty"`
}

MetricsTrait is the Schema for the metricstraits API +kubebuilder:resource:categories={oam} +kubebuilder:subresource:status

func (*MetricsTrait) DeepCopy

func (in *MetricsTrait) DeepCopy() *MetricsTrait

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

func (*MetricsTrait) DeepCopyInto

func (in *MetricsTrait) DeepCopyInto(out *MetricsTrait)

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

func (*MetricsTrait) DeepCopyObject

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

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

func (*MetricsTrait) GetCondition

GetCondition for get CR condition

func (*MetricsTrait) GetWorkloadReference

func (tr *MetricsTrait) GetWorkloadReference() runtimev1alpha1.TypedReference

GetWorkloadReference of this MetricsTrait.

func (*MetricsTrait) SetConditions

func (tr *MetricsTrait) SetConditions(c ...runtimev1alpha1.Condition)

SetConditions for set CR condition

func (*MetricsTrait) SetWorkloadReference

func (tr *MetricsTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference)

SetWorkloadReference of this MetricsTrait.

type MetricsTraitList

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

MetricsTraitList contains a list of MetricsTrait

func (*MetricsTraitList) DeepCopy

func (in *MetricsTraitList) DeepCopy() *MetricsTraitList

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

func (*MetricsTraitList) DeepCopyInto

func (in *MetricsTraitList) DeepCopyInto(out *MetricsTraitList)

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

func (*MetricsTraitList) DeepCopyObject

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

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

type MetricsTraitSpec

type MetricsTraitSpec struct {
	// An endpoint to be monitored by a ServiceMonitor.
	ScrapeService ScapeServiceEndPoint `json:"scrapeService"`
	// WorkloadReference to the workload whose metrics needs to be exposed
	WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`
}

MetricsTraitSpec defines the desired state of MetricsTrait

func (*MetricsTraitSpec) DeepCopy

func (in *MetricsTraitSpec) DeepCopy() *MetricsTraitSpec

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

func (*MetricsTraitSpec) DeepCopyInto

func (in *MetricsTraitSpec) DeepCopyInto(out *MetricsTraitSpec)

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

type MetricsTraitStatus

type MetricsTraitStatus struct {
	runtimev1alpha1.ConditionedStatus `json:",inline"`

	// ServiceMonitorName managed by this trait
	ServiceMonitorName string `json:"serviceMonitorName,omitempty"`

	// Port is the real port monitoring
	Port intstr.IntOrString `json:"port,omitempty"`
	// SelectorLabels is the real labels selected
	SelectorLabels map[string]string `json:"selectorLabels,omitempty"`
}

MetricsTraitStatus defines the observed state of MetricsTrait

func (*MetricsTraitStatus) DeepCopy

func (in *MetricsTraitStatus) DeepCopy() *MetricsTraitStatus

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

func (*MetricsTraitStatus) DeepCopyInto

func (in *MetricsTraitStatus) DeepCopyInto(out *MetricsTraitStatus)

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

type PodSpecWorkload

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

	Spec   PodSpecWorkloadSpec   `json:"spec,omitempty"`
	Status PodSpecWorkloadStatus `json:"status,omitempty"`
}

PodSpecWorkload is the Schema for the PodSpec API +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale +kubebuilder:resource:categories={oam} +kubebuilder:subresource:status

func (*PodSpecWorkload) DeepCopy

func (in *PodSpecWorkload) DeepCopy() *PodSpecWorkload

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

func (*PodSpecWorkload) DeepCopyInto

func (in *PodSpecWorkload) DeepCopyInto(out *PodSpecWorkload)

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

func (*PodSpecWorkload) DeepCopyObject

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

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

func (*PodSpecWorkload) GetCondition

GetCondition set condition for this CR

func (*PodSpecWorkload) SetConditions

func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition)

SetConditions set condition for this CR

type PodSpecWorkloadList

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

PodSpecWorkloadList contains a list of PodSpecWorkload

func (*PodSpecWorkloadList) DeepCopy

func (in *PodSpecWorkloadList) DeepCopy() *PodSpecWorkloadList

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

func (*PodSpecWorkloadList) DeepCopyInto

func (in *PodSpecWorkloadList) DeepCopyInto(out *PodSpecWorkloadList)

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

func (*PodSpecWorkloadList) DeepCopyObject

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

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

type PodSpecWorkloadSpec

type PodSpecWorkloadSpec struct {
	// Replicas is the desired number of replicas of the given podSpec.
	// These are replicas in the sense that they are instantiations of the same podSpec.
	// If unspecified, defaults to 1.
	Replicas *int32 `json:"replicas,omitempty"`

	// PodSpec describes the pods that will be created,
	// we omit the meta part as it will be exactly the same as the PodSpecWorkload
	PodSpec v1.PodSpec `json:"podSpec"`
}

PodSpecWorkloadSpec defines the desired state of PodSpecWorkload

func (*PodSpecWorkloadSpec) DeepCopy

func (in *PodSpecWorkloadSpec) DeepCopy() *PodSpecWorkloadSpec

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

func (*PodSpecWorkloadSpec) DeepCopyInto

func (in *PodSpecWorkloadSpec) DeepCopyInto(out *PodSpecWorkloadSpec)

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

type PodSpecWorkloadStatus

type PodSpecWorkloadStatus struct {
	cpv1alpha1.ConditionedStatus `json:",inline"`

	// Resources managed by this workload.
	Resources []cpv1alpha1.TypedReference `json:"resources,omitempty"`
}

PodSpecWorkloadStatus defines the observed state of PodSpecWorkload

func (*PodSpecWorkloadStatus) DeepCopy

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

func (*PodSpecWorkloadStatus) DeepCopyInto

func (in *PodSpecWorkloadStatus) DeepCopyInto(out *PodSpecWorkloadStatus)

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

type Protocol

type Protocol string

Protocol defines network protocols supported for things like container ports.

type RollingState added in v0.3.3

type RollingState string

RollingState is the overall rollout state

const (
	// VerifyingState verify that the rollout setting is valid and the controller can locate both the
	// target and the source
	VerifyingState RollingState = "verifying"
	// InitializingState rollout is initializing all the new resources
	InitializingState RollingState = "initializing"
	// RollingInBatchesState rolling out
	RollingInBatchesState RollingState = "rollingInBatches"
	// FinalisingState finalize the rolling, possibly clean up the old resources, adjust traffic
	FinalisingState RollingState = "finalising"
	// RolloutSucceedState rollout successfully completed to match the desired target state
	RolloutSucceedState RollingState = "rolloutSucceed"
	// RolloutFailedState rollout is failed, the target replica is not reached
	// we can not move forward anymore
	// we will let the client to decide when or whether to revert
	RolloutFailedState RollingState = "rolloutFailed"
)

type RolloutBatch added in v0.3.3

type RolloutBatch struct {
	// Replicas is the number of pods to upgrade in this batch
	// it can be an absolute number (ex: 5) or a percentage of total pods
	// we will ignore the percentage of the last batch to just fill the gap
	// +optional
	// it is mutually exclusive with the PodList field
	Replicas intstr.IntOrString `json:"replicas,omitempty"`

	// The list of Pods to get upgraded
	// +optional
	// it is mutually exclusive with the Replicas field
	PodList []string `json:"podList,omitempty"`

	// MaxUnavailable is the max allowed number of pods that is unavailable
	// during the upgrade. We will mark the batch as ready as long as there are less
	// or equal number of pods unavailable than this number.
	// default = 0
	// +optional
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// The wait time, in seconds, between instances upgrades, default = 0
	// +optional
	InstanceInterval *int32 `json:"instanceInterval,omitempty"`

	// RolloutWebhooks provides a way for the batch rollout to interact with an external process
	// +optional
	BatchRolloutWebhooks []RolloutWebhook `json:"batchRolloutWebhooks,omitempty"`

	// CanaryMetric provides a way for the batch rollout process to automatically check certain metrics
	// before moving to the next batch
	// +optional
	CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}

RolloutBatch is used to describe how the each batch rollout should be

func (*RolloutBatch) DeepCopy added in v0.3.3

func (in *RolloutBatch) DeepCopy() *RolloutBatch

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

func (*RolloutBatch) DeepCopyInto added in v0.3.3

func (in *RolloutBatch) DeepCopyInto(out *RolloutBatch)

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

type RolloutEvent added in v0.3.3

type RolloutEvent string

RolloutEvent is used to describe the events during rollout

const (
	// RollingFailedEvent indicates that we encountered an unexpected error during upgrading and can't be retried
	RollingFailedEvent RolloutEvent = "RollingFailedEvent"

	// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
	RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"

	// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
	RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"

	// RollingInitializedEvent indicates that we have finished initializing all the workload resources
	RollingInitializedEvent RolloutEvent = "RollingInitializedEvent"

	// AllBatchFinishedEvent indicates that all batches are upgraded
	AllBatchFinishedEvent RolloutEvent = "AllBatchFinishedEvent"

	// RollingFinalizedEvent indicates that we have finalized the rollout which includes but not
	// limited to the resource garbage collection
	RollingFinalizedEvent RolloutEvent = "AllBatchFinishedEvent"

	// InitializedOneBatchEvent indicates that we have successfully rolled out one batch
	InitializedOneBatchEvent RolloutEvent = "InitializedOneBatchEvent"

	// FinishedOneBatchEvent indicates that we have successfully rolled out one batch
	FinishedOneBatchEvent RolloutEvent = "FinishedOneBatchEvent"

	// BatchRolloutContinueEvent indicates that we need to continue to upgrade the pods in the batch
	BatchRolloutContinueEvent RolloutEvent = "BatchRolloutContinueEvent"

	// BatchRolloutVerifyingEvent indicates that we are waiting for the approval of resume one batch
	BatchRolloutVerifyingEvent RolloutEvent = "BatchRolloutVerifyingEvent"

	// OneBatchAvailableEvent indicates that the batch resource is considered available
	// this events comes after we have examine the pod readiness check and traffic shifting if needed
	OneBatchAvailableEvent RolloutEvent = "OneBatchAvailable"

	// BatchRolloutApprovedEvent indicates that we got the approval manually
	BatchRolloutApprovedEvent RolloutEvent = "BatchRolloutApprovedEvent"

	// BatchRolloutFailedEvent indicates that we are waiting for the approval of the
	BatchRolloutFailedEvent RolloutEvent = "BatchRolloutFailedEvent"

	// WorkloadModifiedEvent indicates that the res
	WorkloadModifiedEvent RolloutEvent = "WorkloadModifiedEvent"
)

type RolloutPlan added in v0.3.3

type RolloutPlan struct {

	// RolloutStrategy defines strategies for the rollout plan
	// +optional
	RolloutStrategy *RolloutStrategyType `json:"rolloutStrategy,omitempty"`

	// The size of the target resource. The default is the same
	// as the size of the source resource.
	// +optional
	TargetSize *int32 `json:"targetSize,omitempty"`

	// The number of batches, default = 1
	// mutually exclusive to RolloutBatches
	// +optional
	NumBatches *int32 `json:"numBatches,omitempty"`

	// The exact distribution among batches.
	// mutually exclusive to NumBatches.
	// The total number cannot exceed the targetSize or the size of the source resource
	// We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum
	// We highly recommend to leave the last batch's replica field empty
	// +optional
	RolloutBatches []RolloutBatch `json:"rolloutBatches,omitempty"`

	// All pods in the batches up to the batchPartition (included) will have
	// the target resource specification while the rest still have the source resource
	// This is designed for the operators to manually rollout
	// Default is the the number of batches which will rollout all the batches
	// +optional
	BatchPartition *int32 `json:"lastBatchToRollout,omitempty"`

	// Paused the rollout, default is false
	// +optional
	Paused bool `json:"paused,omitempty"`

	// RolloutWebhooks provide a way for the rollout to interact with an external process
	// +optional
	RolloutWebhooks []RolloutWebhook `json:"rolloutWebhooks,omitempty"`

	// CanaryMetric provides a way for the rollout process to automatically check certain metrics
	// before complete the process
	// +optional
	CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}

RolloutPlan fines the details of the rollout plan

func (*RolloutPlan) DeepCopy added in v0.3.3

func (in *RolloutPlan) DeepCopy() *RolloutPlan

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

func (*RolloutPlan) DeepCopyInto added in v0.3.3

func (in *RolloutPlan) DeepCopyInto(out *RolloutPlan)

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

type RolloutStatus added in v0.3.3

type RolloutStatus struct {
	// Conditions represents the latest available observations of a CloneSet's current state.
	runtimev1alpha1.ConditionedStatus `json:",inline"`

	// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
	// each workload type could use different ways to identify that so we cannot compare between resources
	NewPodTemplateIdentifier string `json:"targetGeneration,omitempty"`

	// lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template
	// each workload type could use different ways to identify that so we cannot compare between resources
	// We update this field only after a successful rollout
	LastAppliedPodTemplateIdentifier string `json:"lastAppliedPodTemplateIdentifier,omitempty"`

	// RollingState is the Rollout State
	RollingState RollingState `json:"rollingState"`

	// BatchRollingState only meaningful when the Status is rolling
	// +optional
	BatchRollingState BatchRollingState `json:"batchRollingState"`

	// The current batch the rollout is working on/blocked
	// it starts from 0
	CurrentBatch int32 `json:"currentBatch"`

	// UpgradedReplicas is the number of Pods upgraded by the rollout controller
	UpgradedReplicas int32 `json:"upgradedReplicas"`

	// UpgradedReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
	UpgradedReadyReplicas int32 `json:"upgradedReadyReplicas"`
}

RolloutStatus defines the observed state of a rollout plan

func (*RolloutStatus) DeepCopy added in v0.3.3

func (in *RolloutStatus) DeepCopy() *RolloutStatus

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

func (*RolloutStatus) DeepCopyInto added in v0.3.3

func (in *RolloutStatus) DeepCopyInto(out *RolloutStatus)

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

func (*RolloutStatus) RolloutFailed added in v0.3.3

func (r *RolloutStatus) RolloutFailed(reason string)

RolloutFailed is a special state transition since we need an error message

func (*RolloutStatus) RolloutRetry added in v0.3.3

func (r *RolloutStatus) RolloutRetry(reason string)

RolloutRetry is a special state transition since we need an error message

func (*RolloutStatus) StateTransition added in v0.3.3

func (r *RolloutStatus) StateTransition(event RolloutEvent)

StateTransition is the center place to do rollout state transition it returns an error if the transition is invalid it changes the coming rollout state if it's valid

type RolloutStrategyType added in v0.3.3

type RolloutStrategyType string

RolloutStrategyType defines strategies for pods rollout

const (
	// IncreaseFirstRolloutStrategyType indicates that we increase the target resources first
	IncreaseFirstRolloutStrategyType RolloutStrategyType = "IncreaseFirst"

	// DecreaseFirstRolloutStrategyType indicates that we decrease the source resources first
	DecreaseFirstRolloutStrategyType RolloutStrategyType = "DecreaseFirst"
)

type RolloutTrait added in v0.3.3

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

	Spec   RolloutTraitSpec `json:"spec,omitempty"`
	Status RolloutStatus    `json:"status,omitempty"`
}

RolloutTrait is the Schema for the RolloutTrait API +kubebuilder:object:root=true +genclient +kubebuilder:subresource:status

func (*RolloutTrait) DeepCopy added in v0.3.3

func (in *RolloutTrait) DeepCopy() *RolloutTrait

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

func (*RolloutTrait) DeepCopyInto added in v0.3.3

func (in *RolloutTrait) DeepCopyInto(out *RolloutTrait)

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

func (*RolloutTrait) DeepCopyObject added in v0.3.3

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

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

func (*RolloutTrait) GetCondition added in v0.3.3

GetCondition for get CR condition

func (*RolloutTrait) GetWorkloadReference added in v0.3.3

func (tr *RolloutTrait) GetWorkloadReference() runtimev1alpha1.TypedReference

GetWorkloadReference of this MetricsTrait.

func (*RolloutTrait) SetConditions added in v0.3.3

func (tr *RolloutTrait) SetConditions(c ...runtimev1alpha1.Condition)

SetConditions for set CR condition

func (*RolloutTrait) SetWorkloadReference added in v0.3.3

func (tr *RolloutTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference)

SetWorkloadReference of this MetricsTrait.

type RolloutTraitList added in v0.3.3

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

RolloutTraitList contains a list of RolloutTrait +kubebuilder:object:root=true +genclient

func (*RolloutTraitList) DeepCopy added in v0.3.3

func (in *RolloutTraitList) DeepCopy() *RolloutTraitList

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

func (*RolloutTraitList) DeepCopyInto added in v0.3.3

func (in *RolloutTraitList) DeepCopyInto(out *RolloutTraitList)

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

func (*RolloutTraitList) DeepCopyObject added in v0.3.3

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

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

type RolloutTraitSpec added in v0.3.3

type RolloutTraitSpec struct {
	// TargetRef references a target resource that contains the newer version
	// of the software. We assumed that new resource already exists.
	// This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset)
	TargetRef runtimev1alpha1.TypedReference `json:"targetRef"`

	// SourceRef references the list of resources that contains the older version
	// of the software. We assume that it's the first time to deploy when we cannot find any source.
	// +optional
	SourceRef []runtimev1alpha1.TypedReference `json:"sourceRef,omitempty"`

	// RolloutPlan is the details on how to rollout the resources
	RolloutPlan RolloutPlan `json:"rolloutPlan"`
}

RolloutTraitSpec defines the desired state of RolloutTrait

func (*RolloutTraitSpec) DeepCopy added in v0.3.3

func (in *RolloutTraitSpec) DeepCopy() *RolloutTraitSpec

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

func (*RolloutTraitSpec) DeepCopyInto added in v0.3.3

func (in *RolloutTraitSpec) DeepCopyInto(out *RolloutTraitSpec)

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

type RolloutWebhook added in v0.3.3

type RolloutWebhook struct {
	// Type of this webhook
	Type HookType `json:"type"`

	// Name of this webhook
	Name string `json:"name"`

	// URL address of this webhook
	URL string `json:"url"`

	// Request timeout for this webhook
	Timeout string `json:"timeout,omitempty"`

	// Metadata (key-value pairs) for this webhook
	// +optional
	Metadata *map[string]string `json:"metadata,omitempty"`
}

RolloutWebhook holds the reference to external checks used for canary analysis

func (*RolloutWebhook) DeepCopy added in v0.3.3

func (in *RolloutWebhook) DeepCopy() *RolloutWebhook

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

func (*RolloutWebhook) DeepCopyInto added in v0.3.3

func (in *RolloutWebhook) DeepCopyInto(out *RolloutWebhook)

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

type RolloutWebhookPayload added in v0.3.3

type RolloutWebhookPayload struct {
	// ResourceRef refers to the resource we are operating on
	ResourceRef *runtimev1alpha1.TypedReference `json:"resourceRef"`

	// RolloutRef refers to the rollout that is controlling the rollout
	RolloutRef *runtimev1alpha1.TypedReference `json:"rolloutRef"`

	// Metadata (key-value pairs) are the extra data send to this webhook
	Metadata map[string]string `json:"metadata,omitempty"`
}

RolloutWebhookPayload holds the info and metadata sent to webhooks

func (*RolloutWebhookPayload) DeepCopy added in v0.3.3

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

func (*RolloutWebhookPayload) DeepCopyInto added in v0.3.3

func (in *RolloutWebhookPayload) DeepCopyInto(out *RolloutWebhookPayload)

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

type Route

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

	Spec   RouteSpec   `json:"spec,omitempty"`
	Status RouteStatus `json:"status,omitempty"`
}

Route is the Schema for the routes API +kubebuilder:object:root=true +kubebuilder:resource:categories={oam} +kubebuilder:subresource:status

func (*Route) DeepCopy

func (in *Route) DeepCopy() *Route

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

func (*Route) DeepCopyInto

func (in *Route) DeepCopyInto(out *Route)

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

func (*Route) DeepCopyObject

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

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

func (*Route) GetCondition

GetCondition get condition from CR status

func (*Route) GetWorkloadReference

func (r *Route) GetWorkloadReference() runtimev1alpha1.TypedReference

GetWorkloadReference of this Route Trait.

func (*Route) SetConditions

func (r *Route) SetConditions(c ...runtimev1alpha1.Condition)

SetConditions set condition for CR status

func (*Route) SetWorkloadReference

func (r *Route) SetWorkloadReference(rt runtimev1alpha1.TypedReference)

SetWorkloadReference of this Route Trait.

type RouteList

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

RouteList contains a list of Route +kubebuilder:object:root=true

func (*RouteList) DeepCopy

func (in *RouteList) DeepCopy() *RouteList

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

func (*RouteList) DeepCopyInto

func (in *RouteList) DeepCopyInto(out *RouteList)

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

func (*RouteList) DeepCopyObject

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

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

type RouteSpec

type RouteSpec struct {
	// WorkloadReference to the workload whose metrics needs to be exposed
	WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"`

	// Host is the host of the route
	Host string `json:"host"`

	// TLS indicate route trait will create SSL secret using cert-manager with specified issuer
	// If this is nil, route trait will use a selfsigned issuer
	TLS *TLS `json:"tls,omitempty"`

	// Rules contain multiple rules of route
	Rules []Rule `json:"rules,omitempty"`

	// Provider indicate which ingress controller implementation the route trait will use, by default it's nginx-ingress
	Provider string `json:"provider,omitempty"`

	// IngressClass indicate which ingress class the route trait will use, by default it's nginx
	IngressClass string `json:"ingressClass,omitempty"`
}

RouteSpec defines the desired state of Route

func (*RouteSpec) DeepCopy

func (in *RouteSpec) DeepCopy() *RouteSpec

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

func (*RouteSpec) DeepCopyInto

func (in *RouteSpec) DeepCopyInto(out *RouteSpec)

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

type RouteStatus

type RouteStatus struct {
	Ingresses                         []runtimev1alpha1.TypedReference `json:"ingresses,omitempty"`
	Service                           *runtimev1alpha1.TypedReference  `json:"service,omitempty"`
	Status                            string                           `json:"status,omitempty"`
	runtimev1alpha1.ConditionedStatus `json:",inline"`
}

RouteStatus defines the observed state of Route

func (*RouteStatus) DeepCopy

func (in *RouteStatus) DeepCopy() *RouteStatus

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

func (*RouteStatus) DeepCopyInto

func (in *RouteStatus) DeepCopyInto(out *RouteStatus)

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

type Rule

type Rule struct {
	// Name will become the suffix of underlying ingress created by this rule, if not, will use index as suffix.
	Name string `json:"name,omitempty"`

	// Path is location Path, default for "/"
	Path string `json:"path,omitempty"`

	// RewriteTarget will rewrite request from Path to RewriteTarget path.
	RewriteTarget string `json:"rewriteTarget,omitempty"`

	// CustomHeaders pass a custom list of headers to the backend service.
	CustomHeaders map[string]string `json:"customHeaders,omitempty"`

	// DefaultBackend will become the ingress default backend if the backend is not available
	DefaultBackend *runtimev1alpha1.TypedReference `json:"defaultBackend,omitempty"`

	// Backend indicate how to connect backend service
	// If it's nil, will auto discovery
	Backend *Backend `json:"backend,omitempty"`
}

Rule defines to route rule

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

type ScapeServiceEndPoint

type ScapeServiceEndPoint struct {
	// The format of the metrics data,
	// The default and only supported format is "prometheus" for now
	Format string `json:"format,omitempty"`
	// Number or name of the port to access on the pods targeted by the service.
	// The default is discovered automatically from podTemplate, metricTrait will create a service for the workload
	TargetPort intstr.IntOrString `json:"port,omitempty"`
	// Route service traffic to pods with label keys and values matching this
	// The default is discovered automatically from podTemplate.
	// If no podTemplate, use the labels specified here, or use the labels of the workload
	TargetSelector map[string]string `json:"selector,omitempty"`
	// HTTP path to scrape for metrics.
	// default is /metrics
	// +optional
	Path string `json:"path,omitempty"`
	// Scheme at which metrics should be scraped
	// The default and only supported scheme is "http"
	// +optional
	Scheme string `json:"scheme,omitempty"`
	// The default is true
	// +optional
	Enabled *bool `json:"enabled,omitempty"`
}

ScapeServiceEndPoint defines a scrapeable endpoint serving Prometheus metrics.

func (*ScapeServiceEndPoint) DeepCopy

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

func (*ScapeServiceEndPoint) DeepCopyInto

func (in *ScapeServiceEndPoint) DeepCopyInto(out *ScapeServiceEndPoint)

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

type TLS

type TLS struct {
	IssuerName string `json:"issuerName,omitempty"`

	// Type indicate the issuer is ClusterIssuer or Issuer(namespace issuer), by default, it's Issuer
	// +kubebuilder:default:=Issuer
	Type IssuerType `json:"type,omitempty"`
}

TLS defines certificate issuer and type for mTLS configuration

func (*TLS) DeepCopy

func (in *TLS) DeepCopy() *TLS

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

func (*TLS) DeepCopyInto

func (in *TLS) DeepCopyInto(out *TLS)

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

type TargetWorkload

type TargetWorkload struct {
	Name string `json:"name"`
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
	// +optional
	Kind string `json:"kind,omitempty"`
}

TargetWorkload holds the a reference to the scale target Object

func (*TargetWorkload) DeepCopy

func (in *TargetWorkload) DeepCopy() *TargetWorkload

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

func (*TargetWorkload) DeepCopyInto

func (in *TargetWorkload) DeepCopyInto(out *TargetWorkload)

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

type Trigger

type Trigger struct {
	// Name is the trigger name, if not set, it will be automatically generated and make it globally unique
	Name string `json:"name,omitempty"`

	// Type allows value in [cpu/memory/storage/ephemeral-storage、cron、pps、qps/rps、custom]
	Type TriggerType `json:"type"`

	// Condition set the condition when to trigger scaling
	Condition map[string]string `json:"condition"`
}

Trigger defines the trigger of Autoscaler

func (*Trigger) DeepCopy

func (in *Trigger) DeepCopy() *Trigger

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

func (*Trigger) DeepCopyInto

func (in *Trigger) DeepCopyInto(out *Trigger)

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

type TriggerType

type TriggerType string

TriggerType defines the type of trigger

Jump to

Keyboard shortcuts

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