v1alpha1

package
v0.0.0-...-c0d2ad2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

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

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

Functions

Types

type MetricNotification

type MetricNotification struct {
	Type                      MetricNotificationType `json:"type"`
	MetricType                MetricSourceType       `json:"metricType"`
	Name                      string                 `json:"name"`
	CurrentAverageValue       resource.Quantity      `json:"currentAverageValue,omitempty"`
	TargetAverageValue        *resource.Quantity     `json:"targetAverageValue,omitempty"`
	CurrentAverageUtilization *int32                 `json:"currentAverageUtilization,omitempty"`
	TargetAverageUtilization  *int32                 `json:"targetAverageUtilization,omitempty"`
	ScrapeTime                time.Time              `json:"scrapeTime"`
}

+k8s:deepcopy-gen=false +k8s:openapi-gen=false +kubebuilder:skipversion

func (*MetricNotification) String

func (n *MetricNotification) String() string

type MetricNotificationType

type MetricNotificationType string

+k8s:deepcopy-gen=false +k8s:openapi-gen=false +kubebuilder:skipversion

const (
	// Alert metric notification informs about a metric those
	// values exceeded the ones set by its thresholds.
	Alert MetricNotificationType = "Alert"
	// Cooldown metric notification informs about a metric that
	// has improved to the extend of meeting thresholds set. This
	// notification may be used by the target application in order
	// to correlate internal adjustments with metric values improvements.
	Cooldown MetricNotificationType = "Cooldown"
)

type MetricReport

type MetricReport []MetricNotification

+k8s:deepcopy-gen=false +k8s:openapi-gen=false +kubebuilder:skipversion

func (*MetricReport) HasAlerts

func (r *MetricReport) HasAlerts() bool

func (*MetricReport) String

func (r *MetricReport) String() string

type MetricSourceType

type MetricSourceType string

+k8s:openapi-gen=true +kubebuilder:validation:Enum=Pods;Resource MetricSourceType indicates the type of metric.

const (
	// PodsMetricSourceType is a metric describing each pod in the current
	// target (for example, transactions-processed-per-second).  The values
	// will be averaged together before being compared to the target value.
	PodsMetricSourceType MetricSourceType = "Pods"
	// ResourceMetricSourceType is a resource metric known to Kubernetes, as
	// specified in requests and limits, describing each pod in the current
	// target (e.g. CPU or memory).
	ResourceMetricSourceType MetricSourceType = "Resource"
)

type MetricSpec

type MetricSpec struct {
	// type is the type of metric source.  It should be "Pods" or "Resource",
	// each mapping to a matching field in the object.
	Type MetricSourceType `json:"type"`
	// pods refers to a metric describing each pod matching the selector
	// (for example, transactions-processed-per-second). The values will be
	// averaged together before being compared to the target value.
	// +optional
	Pods *PodsMetricSource `json:"pods,omitempty"`
	// resource refers to a resource metric (such as those specified in
	// requests and limits) known to Kubernetes describing each pod matching
	// the selector (e.g. CPU or memory).
	// +optional
	Resource *ResourceMetricSource `json:"resource,omitempty"`
}

MetricSpec specifies metrics thresholds before webhook gets called +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 MetricStatus

type MetricStatus struct {
	// type is the type of metric source.  It should be "Pods" or "Resource",
	// each mapping to a matching field in the object.
	Type MetricSourceType `json:"type"`
	// alerting flags the metrics those values exceed defined thresholds
	Alerting bool `json:"alerting"`
	// pods refers to a metric describing each pod matching the selector
	// (for example, transactions-processed-per-second). The values will be
	// averaged together before being compared to the target value.
	// +optional
	Pods *PodsMetricStatus `json:"pods,omitempty"`
	// resource refers to a resource metric (such as those specified in
	// requests and limits) known to Kubernetes describing each pod
	// matching the selector (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 *ResourceMetricStatus `json:"resource,omitempty"`
	// scrapeTime is the last time the MetricWebhook scraped metrics
	ScrapeTime metav1.Time `json:"scrapeTime"`
}

MetricStatus describes the last-read state of a single metric. +k8s:openapi-gen=true

func (*MetricStatus) DeepCopy

func (in *MetricStatus) DeepCopy() *MetricStatus

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

func (*MetricStatus) DeepCopyInto

func (in *MetricStatus) DeepCopyInto(out *MetricStatus)

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

type MetricWebhook

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

	Spec   MetricWebhookSpec   `json:"spec,omitempty"`
	Status MetricWebhookStatus `json:"status,omitempty"`
}

MetricWebhook is the Schema for the metricwebhooks API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:resource:path=metricwebhooks,scope=Namespaced

func (*MetricWebhook) DeepCopy

func (in *MetricWebhook) DeepCopy() *MetricWebhook

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

func (*MetricWebhook) DeepCopyInto

func (in *MetricWebhook) DeepCopyInto(out *MetricWebhook)

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

func (*MetricWebhook) DeepCopyObject

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

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

type MetricWebhookList

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

MetricWebhookList contains a list of MetricWebhook

func (*MetricWebhookList) DeepCopy

func (in *MetricWebhookList) DeepCopy() *MetricWebhookList

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

func (*MetricWebhookList) DeepCopyInto

func (in *MetricWebhookList) DeepCopyInto(out *MetricWebhookList)

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

func (*MetricWebhookList) DeepCopyObject

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

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

type MetricWebhookSpec

type MetricWebhookSpec struct {
	// Selector is a label selector for pods for which metrics should be collected
	Selector metav1.LabelSelector `json:"selector"`
	// webhook points to the web endpoint that going to get metric alerts
	Webhook Webhook `json:"webhook"`
	// metrics contains the specifications for metrics thresholds
	// used to trigger webhook
	// +listType=set
	Metrics []MetricSpec `json:"metrics"`
	// scrapeInterval defines how frequently to scrape metrics
	ScrapeInterval metav1.Duration `json:"scrapeInterval"`
	// Determines whether a metric alert sent one more time after values go
	// under thresholds so that the client can track its adjustments improvements
	CooldownAlert bool `json:"cooldownAlert"`
}

MetricWebhookSpec defines the desired state of MetricWebhook +k8s:openapi-gen=true

func (*MetricWebhookSpec) DeepCopy

func (in *MetricWebhookSpec) DeepCopy() *MetricWebhookSpec

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

func (*MetricWebhookSpec) DeepCopyInto

func (in *MetricWebhookSpec) DeepCopyInto(out *MetricWebhookSpec)

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

type MetricWebhookStatus

type MetricWebhookStatus struct {
	// metrics is the last read state of the metrics used by this MetricWebhook.
	// +listType=set
	// +optional
	Metrics []MetricStatus `json:"metrics"`
}

MetricWebhookStatus defines the observed state of MetricWebhook +k8s:openapi-gen=true

func (*MetricWebhookStatus) DeepCopy

func (in *MetricWebhookStatus) DeepCopy() *MetricWebhookStatus

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

func (*MetricWebhookStatus) DeepCopyInto

func (in *MetricWebhookStatus) DeepCopyInto(out *MetricWebhookStatus)

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

type PodsMetricSource

type PodsMetricSource struct {
	// name is the name of the metric in question
	Name string `json:"name"`
	// targetAverageValue is the target value of the average of the
	// metric across all relevant pods (as a quantity)
	TargetAverageValue resource.Quantity `json:"targetAverageValue"`
}

PodsMetricSource indicates when to call webhook on a metric describing each pod matching the selector (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. +k8s:openapi-gen=true

func (*PodsMetricSource) DeepCopy

func (in *PodsMetricSource) DeepCopy() *PodsMetricSource

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

func (*PodsMetricSource) DeepCopyInto

func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource)

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

type PodsMetricStatus

type PodsMetricStatus struct {
	// name is the name of the metric in question
	Name string `json:"name"`
	// currentAverageValue is the current value of the average of the
	// metric across all relevant pods (as a quantity)
	CurrentAverageValue resource.Quantity `json:"currentAverageValue"`
	// targetAverageValue is the target value of the average of the
	// metric across all relevant pods (as a quantity) defined for this metric in specs
	TargetAverageValue resource.Quantity `json:"targetAverageValue"`
}

PodsMetricStatus indicates the current value of a metric describing each pod matching the selector (for example, transactions-processed-per-second). +k8s:openapi-gen=true

func (*PodsMetricStatus) DeepCopy

func (in *PodsMetricStatus) DeepCopy() *PodsMetricStatus

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

func (*PodsMetricStatus) DeepCopyInto

func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus)

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"`
	// targetAverageUtilization is the target value of the average of the
	// resource metric across all relevant pods, represented as a percentage of
	// the requested value of the resource for the pods.
	// +optional
	TargetAverageUtilization *int32 `json:"targetAverageUtilization,omitempty"`
	// targetAverageValue is the target value of the average of the
	// resource metric across all relevant pods, as a raw value (instead of as
	// a percentage of the request), similar to the "pods" metric source type.
	// +optional
	TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"`
}

ResourceMetricSource indicates when to call webhook on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod matching the selector (e.g. CPU or memory). The values will be averaged together before being compared to the target value. +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 ResourceMetricStatus

type ResourceMetricStatus struct {
	// name is the name of the resource in question.
	Name v1.ResourceName `json:"name"`
	// currentAverageUtilization is the current value of the average of the
	// resource metric across all relevant pods, represented as a percentage of
	// the requested value of the resource for the pods.  It will only be
	// present if `targetAverageValue` was set in the corresponding metric
	// specification.
	// +optional
	CurrentAverageUtilization *int32 `json:"currentAverageUtilization,omitempty"`
	// targetAverageUtilization is the target value of the average of the
	// resource metric across all relevant pods defined for this metric in specs
	// +optional
	TargetAverageUtilization *int32 `json:"targetAverageUtilization,omitempty"`
	// currentAverageValue is the current value of the average of the
	// resource metric across all relevant pods, as a raw value (instead of as
	// a percentage of the request), similar to the "pods" metric source type.
	// It will always be set, regardless of the corresponding metric specification.
	CurrentAverageValue resource.Quantity `json:"currentAverageValue"`
	// targetAverageValue is the target value of the average of the
	// metric across all relevant pods (as a quantity) defined for this metric in specs
	TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"`
}

ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod matching the selector (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. +k8s:openapi-gen=true

func (*ResourceMetricStatus) DeepCopy

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

func (*ResourceMetricStatus) DeepCopyInto

func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus)

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

type Webhook

type Webhook struct {
	// Explicit URL to hit, instead of matching service.
	// If neither Url nor Service are specified, the webhook
	// triggers all matching pods
	// +optional
	Url string `json:"url"`
	// Referent service
	// If neither Url nor Service are specified, the webhook
	// triggers all matching pods
	// +optional
	Service string `json:"service"`
	// Service port the webserver serves on
	// +optional
	Port int32 `json:"port"`
	// URL path to the webhook
	// +optional
	Path string `json:"path"`
}

Webhook describes the web endpoint that the operator calls on metrics reaching their thresholds +k8s:openapi-gen=true

func (*Webhook) DeepCopy

func (in *Webhook) DeepCopy() *Webhook

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

func (*Webhook) DeepCopyInto

func (in *Webhook) DeepCopyInto(out *Webhook)

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

Jump to

Keyboard shortcuts

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