Documentation
¶
Overview ¶
Package v1alpha1 is the v1alpha1 version of the analysis API. +k8s:deepcopy-gen=package,register +groupName=analysis.crane.io
Index ¶
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type AdoptionType
- type AnalysisType
- type Analytics
- type AnalyticsList
- type AnalyticsSpec
- type AnalyticsStatus
- type CompletionStrategy
- type CompletionStrategyType
- type Config
- type ConfigSet
- type ConfigSetList
- type Recommendation
- type RecommendationList
- type RecommendationMission
- type RecommendationSpec
- type RecommendationStatus
- type ResourceSelector
- type Target
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeBuilder initializes a scheme builder SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: analysis.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type AdoptionType ¶ added in v0.3.0
type AdoptionType string
const ( AdoptionTypeStatus AdoptionType = "Status" AdoptionTypeStatusAndAnnotation AdoptionType = "StatusAndAnnotation" AdoptionTypeAuto AdoptionType = "Auto" )
type AnalysisType ¶
type AnalysisType string
const ( AnalysisTypeReplicas AnalysisType = "Replicas" AnalysisTypeResource AnalysisType = "Resource" )
type Analytics ¶
type Analytics struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec AnalyticsSpec `json:"spec"`
// +optional
Status AnalyticsStatus `json:"status,omitempty"`
}
Analytics represents the configuration of an analytics object.
func (*Analytics) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Analytics.
func (*Analytics) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Analytics) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AnalyticsList ¶
type AnalyticsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Analytics `json:"items"`
}
AnalyticsList is a list of Analytics items.
func (*AnalyticsList) DeepCopy ¶
func (in *AnalyticsList) DeepCopy() *AnalyticsList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsList.
func (*AnalyticsList) DeepCopyInto ¶
func (in *AnalyticsList) DeepCopyInto(out *AnalyticsList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AnalyticsList) DeepCopyObject ¶
func (in *AnalyticsList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AnalyticsSpec ¶
type AnalyticsSpec struct {
// Type is the analysis type, including HPA and resource.
// +required
// +kubebuilder:validation:Required
Type AnalysisType `json:"type"`
// ResourceSelector indicates how to select resources(e.g. a set of Deployments) for an Analytics.
// +required
// +kubebuilder:validation:Required
ResourceSelectors []ResourceSelector `json:"resourceSelectors"`
// CompletionStrategy indicate how to complete an Analytics.
// +optional
CompletionStrategy CompletionStrategy `json:"completionStrategy"`
// Override Recommendation configs
// +optional
Config map[string]string `json:"config,omitempty"`
}
AnalyticsSpec describes the analytics type, what the analysis is for and how often the analysis routine runs.
func (*AnalyticsSpec) DeepCopy ¶
func (in *AnalyticsSpec) DeepCopy() *AnalyticsSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsSpec.
func (*AnalyticsSpec) DeepCopyInto ¶
func (in *AnalyticsSpec) DeepCopyInto(out *AnalyticsSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AnalyticsStatus ¶
type AnalyticsStatus struct {
// LastUpdateTime is the last time the status updated.
// +optional
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
// Conditions is an array of current analytics conditions.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Recommendations is a list of RecommendationMission that run parallel.
// +optional
// +listType=atomic
Recommendations []RecommendationMission `json:"recommendations,omitempty"`
}
AnalyticsStatus represents the current state of an analytics item.
func (*AnalyticsStatus) DeepCopy ¶
func (in *AnalyticsStatus) DeepCopy() *AnalyticsStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsStatus.
func (*AnalyticsStatus) DeepCopyInto ¶
func (in *AnalyticsStatus) DeepCopyInto(out *AnalyticsStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CompletionStrategy ¶
type CompletionStrategy struct {
// CompletionStrategy indicate the strategy to request an Analytics or Recommendation, value can be "Once" and "Periodical"
// the default CompletionStrategy is Once.
// +optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Enum=Once;Periodical
// +kubebuilder:default=Once
CompletionStrategyType CompletionStrategyType `json:"completionStrategyType,omitempty"`
// PeriodSeconds is the duration in seconds for an Analytics or Recommendation.
// +optional
PeriodSeconds *int64 `json:"periodSeconds,omitempty"`
}
CompletionStrategy presents how to complete a recommendation or a recommendation request.
func (*CompletionStrategy) DeepCopy ¶
func (in *CompletionStrategy) DeepCopy() *CompletionStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompletionStrategy.
func (*CompletionStrategy) DeepCopyInto ¶
func (in *CompletionStrategy) DeepCopyInto(out *CompletionStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CompletionStrategyType ¶
type CompletionStrategyType string
const ( CompletionStrategyPeriodical CompletionStrategyType = "Periodical" CompletionStrategyOnce CompletionStrategyType = "Once" )
type Config ¶
type Config struct {
// +optional
Targets []Target `json:"targets,omitempty"`
Properties map[string]string `json:"properties,omitempty"`
}
func (*Config) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.
func (*Config) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConfigSet ¶
type ConfigSet struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
Configs []Config `json:"configs,omitempty"`
}
ConfigSet represents the configuration set for recommendation.
func (*ConfigSet) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSet.
func (*ConfigSet) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ConfigSet) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ConfigSetList ¶
type ConfigSetList struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []ConfigSet `json:"items" protobuf:"bytes,2,rep,name=items"`
}
ConfigSetList is a list of ConfigSet.
func (*ConfigSetList) DeepCopy ¶
func (in *ConfigSetList) DeepCopy() *ConfigSetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSetList.
func (*ConfigSetList) DeepCopyInto ¶
func (in *ConfigSetList) DeepCopyInto(out *ConfigSetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ConfigSetList) DeepCopyObject ¶
func (in *ConfigSetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type Recommendation ¶
type Recommendation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec RecommendationSpec `json:"spec,omitempty"`
// +optional
Status RecommendationStatus `json:"status,omitempty"`
}
Recommendation represents the configuration of a single recommendation.
func (*Recommendation) DeepCopy ¶
func (in *Recommendation) DeepCopy() *Recommendation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recommendation.
func (*Recommendation) DeepCopyInto ¶
func (in *Recommendation) DeepCopyInto(out *Recommendation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Recommendation) DeepCopyObject ¶
func (in *Recommendation) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RecommendationList ¶
type RecommendationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Recommendation `json:"items"`
}
RecommendationList is a list of recommendations
func (*RecommendationList) DeepCopy ¶
func (in *RecommendationList) DeepCopy() *RecommendationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationList.
func (*RecommendationList) DeepCopyInto ¶
func (in *RecommendationList) DeepCopyInto(out *RecommendationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RecommendationList) DeepCopyObject ¶
func (in *RecommendationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RecommendationMission ¶ added in v0.5.0
type RecommendationMission struct {
corev1.ObjectReference `json:",inline"`
// +optional
TargetRef corev1.ObjectReference `json:"targetRef"`
// LastStartTime is last time we start a recommendation mission.
// +optional
LastStartTime *metav1.Time `json:"lastStartTime,omitempty"`
// Message presents the running message for this mission
// +optional
Message string `json:"message,omitempty"`
}
func (*RecommendationMission) DeepCopy ¶ added in v0.5.0
func (in *RecommendationMission) DeepCopy() *RecommendationMission
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationMission.
func (*RecommendationMission) DeepCopyInto ¶ added in v0.5.0
func (in *RecommendationMission) DeepCopyInto(out *RecommendationMission)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecommendationSpec ¶
type RecommendationSpec struct {
// +required
// +kubebuilder:validation:Required
TargetRef corev1.ObjectReference `json:"targetRef"`
// +required
// +kubebuilder:validation:Required
Type AnalysisType `json:"type"`
// CompletionStrategy indicate how to complete a recommendation.
// the default CompletionStrategy is Once.
// +optional
CompletionStrategy CompletionStrategy `json:"completionStrategy,omitempty"`
// AdoptionType indicate how to adopt recommendation value to target.
// the default AdoptionType is StatusAndAnnotation.
// +optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Enum=Status;StatusAndAnnotation;Auto
// +kubebuilder:default=StatusAndAnnotation
AdoptionType AdoptionType `json:"adoptionType,omitempty"`
}
RecommendationSpec describes the recommendation type and what the recommendation is for.
func (*RecommendationSpec) DeepCopy ¶
func (in *RecommendationSpec) DeepCopy() *RecommendationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationSpec.
func (*RecommendationSpec) DeepCopyInto ¶
func (in *RecommendationSpec) DeepCopyInto(out *RecommendationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecommendationStatus ¶
type RecommendationStatus struct {
// +optional
RecommendedValue string `json:"recommendedValue,omitempty"`
// Conditions is an array of current recommendation conditions.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// LastUpdateTime is last time we got an update on this status.
// +optional
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
}
RecommendationStatus represents the current state of a recommendation.
func (*RecommendationStatus) DeepCopy ¶
func (in *RecommendationStatus) DeepCopy() *RecommendationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationStatus.
func (*RecommendationStatus) DeepCopyInto ¶
func (in *RecommendationStatus) DeepCopyInto(out *RecommendationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSelector ¶
type ResourceSelector struct {
// Kind of the resource, e.g. Deployment
Kind string `json:"kind"`
// API version of the resource, e.g. "apps/v1"
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Name of the resource.
// +optional
Name string `json:"name,omitempty"`
// +optional
LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`
}
ResourceSelector describes how the resources will be selected.
func (*ResourceSelector) DeepCopy ¶
func (in *ResourceSelector) DeepCopy() *ResourceSelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSelector.
func (*ResourceSelector) DeepCopyInto ¶
func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Target ¶
type Target struct {
// +optional
Namespace string `json:"namespace,omitempty"`
// +optional
Kind string `json:"kind,omitempty"`
// +optional
Name string `json:"name,omitempty"`
}
func (*Target) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target.
func (*Target) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.