Documentation ¶
Overview ¶
Package v1 contains API Schema definitions for the konsumerator v1 API group +kubebuilder:object:generate=true +groupName=konsumerator.lwolf.org
Index ¶
- Constants
- Variables
- type AutoscalerSpec
- type AutoscalerType
- type Consumer
- type ConsumerList
- type ConsumerSpec
- type ConsumerStatus
- type ConsumptionQuerySpec
- type ContainerResourcePolicy
- type ContainerScalingMode
- type FallbackStrategy
- type GlobalResourcePolicy
- type InstanceState
- type OffsetQuerySpec
- type ProductionQuerySpec
- type PrometheusAutoscalerSpec
- type ResourcePolicy
Constants ¶
const ( AutoscalerTypePrometheus AutoscalerType = "prometheus" AutoscalerTypeVpa AutoscalerType = "vpa" AutoscalerTypeNone AutoscalerType = "" // ContainerScalingModeAuto means autoscaling is enabled for a container. ContainerScalingModeAuto ContainerScalingMode = "Auto" // ContainerScalingModeOff means autoscaling is disabled for a container. ContainerScalingModeOff ContainerScalingMode = "Off" FallbackStrategyMin = "min" FallbackStrategyMax = "max" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "konsumerator.lwolf.org", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type AutoscalerSpec ¶
type AutoscalerSpec struct { Mode AutoscalerType `json:"mode"` // +optional PendingScaleUpDuration *metav1.Duration `json:"pendingScaleUpDuration,omitempty"` // +optional PendingScaleDownDuration *metav1.Duration `json:"pendingScaleDownDuration,omitempty"` // +optional Prometheus *PrometheusAutoscalerSpec `json:"prometheus,omitempty"` }
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 AutoscalerType ¶
type AutoscalerType string
type Consumer ¶
type Consumer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ConsumerSpec `json:"spec,omitempty"` Status ConsumerStatus `json:"status,omitempty"` }
Consumer is the Schema for the consumers API
func (*Consumer) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Consumer.
func (*Consumer) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Consumer) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ConsumerList ¶
type ConsumerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Consumer `json:"items"` }
ConsumerList contains a list of Consumer
func (*ConsumerList) DeepCopy ¶
func (in *ConsumerList) DeepCopy() *ConsumerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumerList.
func (*ConsumerList) DeepCopyInto ¶
func (in *ConsumerList) DeepCopyInto(out *ConsumerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ConsumerList) DeepCopyObject ¶
func (in *ConsumerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ConsumerSpec ¶
type ConsumerSpec struct { // Important: Run "make" to regenerate code after modifying this file NumPartitions *int32 `json:"numPartitions"` // Number of partitions NumPartitionsPerInstance *int32 `json:"numPartitionsPerInstance,omitempty"` // Number of partitions to assign to each consumer Name string `json:"name"` // Name of the instance to run Namespace string `json:"namespace"` // Namespace to run managed instances Autoscaler *AutoscalerSpec `json:"autoscaler"` // Auto-scaler configuration // +optional PartitionEnvKey string `json:"partitionEnvKey,omitempty"` DeploymentTemplate appsv1.DeploymentSpec `json:"deploymentTemplate"` ResourcePolicy *ResourcePolicy `json:"resourcePolicy"` }
ConsumerSpec defines the desired state of Consumer
func (*ConsumerSpec) DeepCopy ¶
func (in *ConsumerSpec) DeepCopy() *ConsumerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumerSpec.
func (*ConsumerSpec) DeepCopyInto ¶
func (in *ConsumerSpec) DeepCopyInto(out *ConsumerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConsumerStatus ¶
type ConsumerStatus struct { // Important: Run "make" to regenerate code after modifying this file // +optional ObservedGeneration *int64 `json:"observedGeneration,omitempty"` // +optional Expected *int32 `json:"expected,omitempty"` // +optional Running *int32 `json:"running,omitempty"` // +optional Paused *int32 `json:"paused,omitempty"` // +optional Lagging *int32 `json:"lagging,omitempty"` // +optional Missing *int32 `json:"missing,omitempty"` // +optional Outdated *int32 `json:"outdated,omitempty"` // +optional Redundant *int32 `json:"redundant,omitempty"` // +optional LastSyncTime *metav1.Time `json:"lastSyncTime,omitempty"` // +optional LastSyncState map[string]InstanceState `json:"lastSyncState,omitempty"` }
ConsumerStatus defines the observed state of Consumer
func (*ConsumerStatus) DeepCopy ¶
func (in *ConsumerStatus) DeepCopy() *ConsumerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumerStatus.
func (*ConsumerStatus) DeepCopyInto ¶
func (in *ConsumerStatus) DeepCopyInto(out *ConsumerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConsumptionQuerySpec ¶
type ConsumptionQuerySpec struct { Query string `json:"query"` PartitionLabel string `json:"partitionLabel"` }
func (*ConsumptionQuerySpec) DeepCopy ¶
func (in *ConsumptionQuerySpec) DeepCopy() *ConsumptionQuerySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumptionQuerySpec.
func (*ConsumptionQuerySpec) DeepCopyInto ¶
func (in *ConsumptionQuerySpec) DeepCopyInto(out *ConsumptionQuerySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerResourcePolicy ¶
type ContainerResourcePolicy struct { // Name of the container or DefaultContainerResourcePolicy, in which // case the policy is used by the containers that don't have their own // policy specified. ContainerName string `json:"containerName,omitempty"` // Whether autoscaler is enabled for the container. The default is "Auto". // +optional Mode *ContainerScalingMode `json:"mode,omitempty"` // Specifies the minimal amount of resources that will be recommended // for the container. The default is no minimum. // +optional MinAllowed corev1.ResourceList `json:"minAllowed,omitempty"` // Specifies the maximum amount of resources that will be recommended // for the container. The default is no maximum. // +optional MaxAllowed corev1.ResourceList `json:"maxAllowed,omitempty"` }
ContainerResourcePolicy controls how autoscaler computes the recommended resources for a specific container.
func (*ContainerResourcePolicy) DeepCopy ¶
func (in *ContainerResourcePolicy) DeepCopy() *ContainerResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResourcePolicy.
func (*ContainerResourcePolicy) DeepCopyInto ¶
func (in *ContainerResourcePolicy) DeepCopyInto(out *ContainerResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerScalingMode ¶
type ContainerScalingMode string
ContainerScalingMode controls whether autoscaler is enabled for a specific container.
type FallbackStrategy ¶ added in v1.2.0
type FallbackStrategy string
FallbackStrategy specifies how resources should be assigned in case of missing Prometheus metrics. Currently, two strategies are implemented: min and max
type GlobalResourcePolicy ¶
type GlobalResourcePolicy struct { // Specifies the maximum amount of resources that could be allocated // to the entire application // +optional MaxAllowed corev1.ResourceList `json:"maxAllowed,omitempty"` }
func (*GlobalResourcePolicy) DeepCopy ¶
func (in *GlobalResourcePolicy) DeepCopy() *GlobalResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalResourcePolicy.
func (*GlobalResourcePolicy) DeepCopyInto ¶
func (in *GlobalResourcePolicy) DeepCopyInto(out *GlobalResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstanceState ¶
type InstanceState struct { ProductionRate int64 `json:"productionRate"` ConsumptionRate int64 `json:"consumptionRate"` MessagesBehind int64 `json:"messageBehind"` }
func (*InstanceState) DeepCopy ¶
func (in *InstanceState) DeepCopy() *InstanceState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceState.
func (*InstanceState) DeepCopyInto ¶
func (in *InstanceState) DeepCopyInto(out *InstanceState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OffsetQuerySpec ¶
type OffsetQuerySpec struct { Query string `json:"query"` PartitionLabel string `json:"partitionLabel"` }
func (*OffsetQuerySpec) DeepCopy ¶
func (in *OffsetQuerySpec) DeepCopy() *OffsetQuerySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OffsetQuerySpec.
func (*OffsetQuerySpec) DeepCopyInto ¶
func (in *OffsetQuerySpec) DeepCopyInto(out *OffsetQuerySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProductionQuerySpec ¶
type ProductionQuerySpec struct { Query string `json:"query"` PartitionLabel string `json:"partitionLabel"` }
func (*ProductionQuerySpec) DeepCopy ¶
func (in *ProductionQuerySpec) DeepCopy() *ProductionQuerySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProductionQuerySpec.
func (*ProductionQuerySpec) DeepCopyInto ¶
func (in *ProductionQuerySpec) DeepCopyInto(out *ProductionQuerySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrometheusAutoscalerSpec ¶
type PrometheusAutoscalerSpec struct { // TODO: needs to be extended to support protocol,address,tls,etc... // for now just http://prometheus:9091 should work Address []string `json:"address"` MinSyncPeriod *metav1.Duration `json:"minSyncPeriod"` Offset OffsetQuerySpec `json:"offset"` Production ProductionQuerySpec `json:"production"` Consumption ConsumptionQuerySpec `json:"consumption"` // +optional FallbackStrategy *FallbackStrategy `json:"fallbackStrategy,omitempty"` RatePerCore *int64 `json:"ratePerCore"` RamPerCore resource.Quantity `json:"ramPerCore"` // CpuIncrement sets the minimum cpu scaling step (default is 100m) // +optional CpuIncrement *resource.Quantity `json:"cpuIncrement,omitempty"` TolerableLag *metav1.Duration `json:"tolerableLag"` CriticalLag *metav1.Duration `json:"criticalLag"` RecoveryTime *metav1.Duration `json:"recoveryTime"` }
func (*PrometheusAutoscalerSpec) DeepCopy ¶
func (in *PrometheusAutoscalerSpec) DeepCopy() *PrometheusAutoscalerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusAutoscalerSpec.
func (*PrometheusAutoscalerSpec) DeepCopyInto ¶
func (in *PrometheusAutoscalerSpec) DeepCopyInto(out *PrometheusAutoscalerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePolicy ¶
type ResourcePolicy struct { // +optional GlobalPolicy *GlobalResourcePolicy `json:"globalPolicy,omitempty"` // Per-container resource policies. // +optional // +patchMergeKey=containerName // +patchStrategy=merge ContainerPolicies []ContainerResourcePolicy `json:"containerPolicies,omitempty" patchStrategy:"merge" patchMergeKey:"containerName"` }
func (*ResourcePolicy) DeepCopy ¶
func (in *ResourcePolicy) DeepCopy() *ResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicy.
func (*ResourcePolicy) DeepCopyInto ¶
func (in *ResourcePolicy) DeepCopyInto(out *ResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.