v1alpha1

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the cronhpa v1alpha1 API group +kubebuilder:object:generate=true +groupName=cron-hpa.dtaniwaki.github.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cron-hpa.dtaniwaki.github.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

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

Functions

This section is empty.

Types

type CronHorizontalPodAutoscaler

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

	Spec   CronHorizontalPodAutoscalerSpec   `json:"spec,omitempty"`
	Status CronHorizontalPodAutoscalerStatus `json:"status,omitempty"`
}

CronHorizontalPodAutoscaler is the Schema for the cronhorizontalpodautoscalers API.

func (*CronHorizontalPodAutoscaler) DeepCopy

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

func (*CronHorizontalPodAutoscaler) DeepCopyInto

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

func (*CronHorizontalPodAutoscaler) DeepCopyObject

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

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

type CronHorizontalPodAutoscalerList

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

CronHorizontalPodAutoscalerList contains a list of CronHorizontalPodAutoscaler

func (*CronHorizontalPodAutoscalerList) DeepCopy

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

func (*CronHorizontalPodAutoscalerList) DeepCopyInto

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

func (*CronHorizontalPodAutoscalerList) DeepCopyObject

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

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

type CronHorizontalPodAutoscalerScheduledPatch

type CronHorizontalPodAutoscalerScheduledPatch struct {
	// Name is the name of this schedule.
	// +kubebuilder:validation:MaxLength=16
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
	Name string `json:"name"`
	// Schedule is a schedule to apply the HPA in the cron format like `0 */2 * * *`.
	// See https://pkg.go.dev/github.com/robfig/cron
	Schedule string `json:"schedule"`
	// Timezone is a timezone of the schedule
	Timezone string `json:"timezone"`
	// Patch is a patch to apply to the template at the schedule.
	Patch *HPAPatch `json:"patch,omitempty"`
}

CronHorizontalPodAutoscalerScheduledPatch is a patch w/ schedule to apply.

func (*CronHorizontalPodAutoscalerScheduledPatch) DeepCopy

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

func (*CronHorizontalPodAutoscalerScheduledPatch) DeepCopyInto

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

type CronHorizontalPodAutoscalerSpec

type CronHorizontalPodAutoscalerSpec struct {
	// Template is the template of HPA.
	Template HPATemplate `json:"template"`
	// schedules contain the specifications of HPA with a schedule.
	ScheduledPatches []CronHorizontalPodAutoscalerScheduledPatch `json:"scheduledPatches"`
}

CronHorizontalPodAutoscalerSpec defines the desired state of CronHorizontalPodAutoscaler

func (*CronHorizontalPodAutoscalerSpec) DeepCopy

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

func (*CronHorizontalPodAutoscalerSpec) DeepCopyInto

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

type CronHorizontalPodAutoscalerStatus

type CronHorizontalPodAutoscalerStatus struct {
	// LastCronTimestamp is the time of last cron job.
	LastCronTimestamp *metav1.Time `json:"lastCronTimestamp,omitempty"`
	// LastScheduledPatchName is the last patch name applied to the HPA.
	LastScheduledPatchName string `json:"lastScheduledPatchName,omitempty"`
}

CronHorizontalPodAutoscalerStatus defines the observed state of CronHorizontalPodAutoscaler.

func (*CronHorizontalPodAutoscalerStatus) DeepCopy

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

func (*CronHorizontalPodAutoscalerStatus) DeepCopyInto

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

type HPAPatch

type HPAPatch struct {
	// minReplicas is the lower limit for the number of replicas to which the autoscaler
	// can scale down.  It defaults to 1 pod.  minReplicas is allowed to be 0 if the
	// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
	// metric is configured.  Scaling is active as long as at least one metric value is
	// available.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
	// It cannot be less that minReplicas.
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`
	// metrics contains the specifications for which to use to calculate the
	// desired replica count (the maximum replica count across all metrics will
	// be used).  The desired replica count is calculated multiplying the
	// ratio between the target value and the current value by the current
	// number of pods.  Ergo, metrics used must decrease as the pod count is
	// increased, and vice-versa.  See the individual metric source types for
	// more information about how each type of metric must respond.
	// +optional
	Metrics []autoscalingv2beta2.MetricSpec `json:"metrics,omitempty"`
}

HPAPatch is a patch applied to the template.

func (*HPAPatch) DeepCopy

func (in *HPAPatch) DeepCopy() *HPAPatch

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

func (*HPAPatch) DeepCopyInto

func (in *HPAPatch) DeepCopyInto(out *HPAPatch)

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

type HPATemplate

type HPATemplate struct {
	Metadata *TemplateMetadata                              `json:"metadata,omitempty"`
	Spec     autoscalingv2beta2.HorizontalPodAutoscalerSpec `json:"spec"`
}

HPATemplate is the template of HPA to create.

func (*HPATemplate) DeepCopy

func (in *HPATemplate) DeepCopy() *HPATemplate

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

func (*HPATemplate) DeepCopyInto

func (in *HPATemplate) DeepCopyInto(out *HPATemplate)

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

type TemplateMetadata

type TemplateMetadata struct {
	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: http://kubernetes.io/docs/user-guide/labels
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

TemplateMetadata is a metadata type only for labels and annotations.

func (*TemplateMetadata) DeepCopy

func (in *TemplateMetadata) DeepCopy() *TemplateMetadata

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

func (*TemplateMetadata) DeepCopyInto

func (in *TemplateMetadata) DeepCopyInto(out *TemplateMetadata)

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