v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the datadoghq v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=datadoghq.com

Package v1alpha1 contains API Schema definitions for the datadoghq v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=datadoghq.com

Index

Constants

View Source
const (
	// ConditionReasonSucceededRescale Condition reason for Succeeded Rescale
	ConditionReasonSucceededRescale = "SucceededRescale"
)

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func CheckWPAValidity

func CheckWPAValidity(wpa *WatermarkPodAutoscaler) error

CheckWPAValidity use to check the validty of a WatermarkPodAutoscaler return nil if valid, else an error

func IsDefaultWatermarkPodAutoscaler

func IsDefaultWatermarkPodAutoscaler(wpa *WatermarkPodAutoscaler) bool

IsDefaultWatermarkPodAutoscaler used to know if a WatermarkPodAutoscaler has default values

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func NewInt32

func NewInt32(i int32) *int32

NewInt32 return a pointer to an int32.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CrossVersionObjectReference

type CrossVersionObjectReference struct {
	// Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
	Kind string `json:"kind"`
	// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
	Name string `json:"name"`
	// API version of the referent
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
}

CrossVersionObjectReference contains enough information to let you identify the referred resource. +k8s:openapi-gen=true

func (*CrossVersionObjectReference) DeepCopy

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

func (*CrossVersionObjectReference) DeepCopyInto

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

type ExternalMetricSource

type ExternalMetricSource struct {
	// metricName is the name of the metric in question.
	MetricName string `json:"metricName"`
	// metricSelector is used to identify a specific time series
	// within a given metric.
	// +optional
	MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty"`

	HighWatermark *resource.Quantity `json:"highWatermark,omitempty"`
	LowWatermark  *resource.Quantity `json:"lowWatermark,omitempty"`
}

ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one "target" type should be set. +k8s:openapi-gen=true

func (*ExternalMetricSource) DeepCopy

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

func (*ExternalMetricSource) DeepCopyInto

func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource)

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

type MetricSourceType

type MetricSourceType string

MetricSourceType indicates the type of metric.

var (
	// ExternalMetricSourceType is a global metric that is not associated
	// with any Kubernetes object. It allows autoscaling based on information
	// coming from components running outside of cluster
	// (for example length of queue in cloud messaging service, or
	// QPS from loadbalancer running outside of cluster).
	ExternalMetricSourceType MetricSourceType = "External"

	// ResourceMetricSourceType is a resource metric known to Kubernetes, as
	// specified in requests and limits, describing each pod in the current
	// scale target (e.g. CPU or memory).  Such metrics are built in to
	// Kubernetes, and have special scaling options on top of those available
	// to normal per-pod metrics (the "pods" source).
	ResourceMetricSourceType MetricSourceType = "Resource"
)

type MetricSpec

type MetricSpec struct {
	// type is the type of metric source.  It should be one of "Object",
	// "Pods" or "Resource", each mapping to a matching field in the object.
	Type MetricSourceType `json:"type"`
	// external refers to a global metric that is not associated
	// with any Kubernetes object. It allows autoscaling based on information
	// coming from components running outside of cluster
	// (for example length of queue in cloud messaging service, or
	// QPS from loadbalancer running outside of cluster).
	// +optional
	External *ExternalMetricSource `json:"external,omitempty"`
	// resource refers to a resource metric (such as those specified in
	// requests and limits) known to Kubernetes describing each pod in the
	// current scale target (e.g. CPU or memory). Such metrics are built in to
	// Kubernetes, and have special scaling options on top of those available
	// to normal per-pod metrics using the "pods" source.
	// +optional
	Resource *ResourceMetricSource `json:"resource,omitempty"`
}

MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once). +k8s:openapi-gen=true

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 ResourceMetricSource

type ResourceMetricSource struct {
	// name is the name of the resource in question.
	Name v1.ResourceName `json:"name"`
	// metricSelector is used to identify a specific time series
	// within a given metric.
	// +optional
	MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty"`

	HighWatermark *resource.Quantity `json:"highWatermark,omitempty"`
	LowWatermark  *resource.Quantity `json:"lowWatermark,omitempty"`
}

ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. Only one "target" type should be set. +k8s:openapi-gen=true

func (*ResourceMetricSource) DeepCopy

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

func (*ResourceMetricSource) DeepCopyInto

func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource)

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

type WatermarkPodAutoscaler

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

	Spec   WatermarkPodAutoscalerSpec   `json:"spec,omitempty"`
	Status WatermarkPodAutoscalerStatus `json:"status,omitempty"`
}

WatermarkPodAutoscaler is the Schema for the watermarkpodautoscalers API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="value",type="string",JSONPath=".status.currentMetrics[*].external.currentValue.." +kubebuilder:printcolumn:name="high watermark",type="string",JSONPath=".spec.metrics[*].external.highWatermark.." +kubebuilder:printcolumn:name="low watermark",type="string",JSONPath=".spec.metrics[*].external.lowWatermark.." +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="min replicas",type="integer",JSONPath=".spec.minReplicas" +kubebuilder:printcolumn:name="max replicas",type="integer",JSONPath=".spec.maxReplicas" +kubebuilder:printcolumn:name="dry-run",type="string",JSONPath=".spec.dryRun" +kubebuilder:resource:path=watermarkpodautoscalers,shortName=wpa

func DefaultWatermarkPodAutoscaler

func DefaultWatermarkPodAutoscaler(wpa *WatermarkPodAutoscaler) *WatermarkPodAutoscaler

DefaultWatermarkPodAutoscaler sets the default in the WPA

func (*WatermarkPodAutoscaler) DeepCopy

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

func (*WatermarkPodAutoscaler) DeepCopyInto

func (in *WatermarkPodAutoscaler) DeepCopyInto(out *WatermarkPodAutoscaler)

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

func (*WatermarkPodAutoscaler) DeepCopyObject

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

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

type WatermarkPodAutoscalerList

type WatermarkPodAutoscalerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// +listType=set
	Items []WatermarkPodAutoscaler `json:"items"`
}

WatermarkPodAutoscalerList contains a list of WatermarkPodAutoscaler +k8s:openapi-gen=true

func (*WatermarkPodAutoscalerList) DeepCopy

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

func (*WatermarkPodAutoscalerList) DeepCopyInto

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

func (*WatermarkPodAutoscalerList) DeepCopyObject

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

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

type WatermarkPodAutoscalerSpec

type WatermarkPodAutoscalerSpec struct {

	// part of HorizontalController, see comments in the k8s repo: pkg/controller/podautoscaler/horizontal.go
	// +kubebuilder:validation:Minimum=1
	DownscaleForbiddenWindowSeconds int32 `json:"downscaleForbiddenWindowSeconds,omitempty"`

	// +kubebuilder:validation:Minimum=1
	UpscaleForbiddenWindowSeconds int32 `json:"upscaleForbiddenWindowSeconds,omitempty"`

	// Percentage of replicas that can be added in an upscale event. Max value will set the limit at the Maximum number of Replicas.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=100
	ScaleUpLimitFactor float64 `json:"scaleUpLimitFactor,omitempty"`

	// Percentage of replicas that can be added in an upscale event. Max value will set the limit at the Maximum number of Replicas.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=100
	ScaleDownLimitFactor float64 `json:"scaleDownLimitFactor,omitempty"`

	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:ExclusiveMinimum=true
	// +kubebuilder:validation:Maximum=1
	// +kubebuilder:validation:ExclusiveMaximum=true
	Tolerance float64 `json:"tolerance,omitempty"`

	// computed values take the # of replicas into account
	Algorithm string `json:"algorithm,omitempty"`

	// Whether planned scale changes are actually applied
	DryRun bool `json:"dryRun,omitempty"`

	// part of HorizontalPodAutoscalerSpec, see comments in the k8s-1.10.8 repo: staging/src/k8s.io/api/autoscaling/v1/types.go
	// reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
	// and will set the desired number of pods by using its Scale subresource.
	ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef"`
	// specifications that will be used to calculate the desired replica count
	// +listType=set
	Metrics []MetricSpec `json:"metrics,omitempty"`
	// +kubebuilder:validation:Minimum=1
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// +kubebuilder:validation:Minimum=1
	MaxReplicas int32 `json:"maxReplicas,omitempty"`
	// +kubebuilder:validation:Minimum=1
	ReadinessDelaySeconds int32 `json:"readinessDelay,omitempty"`
}

WatermarkPodAutoscalerSpec defines the desired state of WatermarkPodAutoscaler +k8s:openapi-gen=true

func (*WatermarkPodAutoscalerSpec) DeepCopy

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

func (*WatermarkPodAutoscalerSpec) DeepCopyInto

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

type WatermarkPodAutoscalerStatus

type WatermarkPodAutoscalerStatus struct {
	ObservedGeneration *int64       `json:"observedGeneration,omitempty"`
	LastScaleTime      *metav1.Time `json:"lastScaleTime,omitempty"`
	CurrentReplicas    int32        `json:"currentReplicas"`
	DesiredReplicas    int32        `json:"desiredReplicas"`
	// +listType=set
	CurrentMetrics []autoscalingv2.MetricStatus `json:"currentMetrics"`
	// +listType=set
	Conditions []autoscalingv2.HorizontalPodAutoscalerCondition `json:"conditions"`
}

WatermarkPodAutoscalerStatus defines the observed state of WatermarkPodAutoscaler +k8s:openapi-gen=true

func (*WatermarkPodAutoscalerStatus) DeepCopy

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

func (*WatermarkPodAutoscalerStatus) DeepCopyInto

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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