v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the carbonaware v1alpha1 API group +kubebuilder:object:generate=true +groupName=carbonaware.kubernetes.azure.com

Index

Constants

View Source
const (
	ReasonSucceeded             = "OperatorSucceeded"
	ReasonTargetUpdateFailed    = "OperatorTargetUpdateFailed"
	ReasonTargetNotFound        = "OperatorTargetNotFound"
	ReasonTargetFetchError      = "OperatorTargetFetchError"
	ReasonCarbonDataFetchError  = "OperatorCarbonDataFetchError"
	ReasonMaxReplicasCountError = "OperatorMaxReplicasCountError"
	ReasonEcoModeDisabledError  = "OperatorEcoModeDisabledError"
	ReasonEcoModeDisabled       = "OperatorEcoModeDisabled"
)

Reasons why operator is in degraded status

Variables

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

	// 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 CarbonAwareKedaScaler

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

	Spec   CarbonAwareKedaScalerSpec   `json:"spec,omitempty"`
	Status CarbonAwareKedaScalerStatus `json:"status,omitempty"`
}

CarbonAwareKedaScaler is the Schema for the carbonawarekedascalers API

func (*CarbonAwareKedaScaler) DeepCopy

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

func (*CarbonAwareKedaScaler) DeepCopyInto

func (in *CarbonAwareKedaScaler) DeepCopyInto(out *CarbonAwareKedaScaler)

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

func (*CarbonAwareKedaScaler) DeepCopyObject

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

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

type CarbonAwareKedaScalerList

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

CarbonAwareKedaScalerList contains a list of CarbonAwareKedaScaler

func (*CarbonAwareKedaScalerList) DeepCopy

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

func (*CarbonAwareKedaScalerList) DeepCopyInto

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

func (*CarbonAwareKedaScalerList) DeepCopyObject

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

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

type CarbonAwareKedaScalerSpec

type CarbonAwareKedaScalerSpec struct {
	// type of the keda object to scale
	// +kubebuilder:validation:Required
	KedaTarget KedaTarget `json:"kedaTarget"`

	// namespace of the keda target
	// +kubebuilder:validation:Required
	KedaTargetRef KedaTargetRef `json:"kedaTargetRef"`

	// array of carbon intensity values preferrably in ascending order; each threshold value represents the upper limit and previous entry represents lower limit
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	MaxReplicasByCarbonIntensity []CarbonIntensityConfig `json:"maxReplicasByCarbonIntensity"`

	// configuration to disable carbon aware scaler
	// +kubebuilder:validation:Required
	EcoModeOff EcoModeOff `json:"ecoModeOff"`

	// carbon intensity forecast data source
	// must have at least localConfigMap or mockCarbonForecast set
	// +kubebuilder:validation:Required
	CarbonIntensityForecastDataSource CarbonIntensityForecastDataSource `json:"carbonIntensityForecastDataSource"`
}

CarbonAwareKedaScalerSpec defines the desired state of CarbonAwareKedaScaler

func (*CarbonAwareKedaScalerSpec) DeepCopy

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

func (*CarbonAwareKedaScalerSpec) DeepCopyInto

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

type CarbonAwareKedaScalerStatus

type CarbonAwareKedaScalerStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	// Conditions is a list of conditions and their status.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

CarbonAwareKedaScalerStatus defines the observed state of CarbonAwareKedaScaler

func (*CarbonAwareKedaScalerStatus) DeepCopy

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

func (*CarbonAwareKedaScalerStatus) DeepCopyInto

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

type CarbonIntensityConfig

type CarbonIntensityConfig struct {
	// carbon intensity threshold to scale the number of replicas
	// +kubebuilder:validation:Required
	CarbonIntensityThreshold int32 `json:"carbonIntensityThreshold"`

	// maximum number of replicas to scale to when the carbon intensity threshold meets or exceeds carbonIntensityThreshold
	// +kubebuilder:validation:Required
	MaxReplicas *int32 `json:"maxReplicas"`
}

CarbonIntensityConfig represents the configuration to scale the number of replicas based on carbon intensity

func (*CarbonIntensityConfig) DeepCopy

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

func (*CarbonIntensityConfig) DeepCopyInto

func (in *CarbonIntensityConfig) DeepCopyInto(out *CarbonIntensityConfig)

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

type CarbonIntensityDuration

type CarbonIntensityDuration struct {
	// carbon intensity threshold to disable carbon aware scaler
	// +kubebuilder:validation:Required
	CarbonIntensityThreshold int32 `json:"carbonIntensityThreshold"`

	// length of time in minutes to disable carbon aware scaler when the carbon intensity threshold meets or exceeds carbonIntensityThreshold
	// +kubebuilder:validation:Required
	OverrideEcoAfterDurationInMins int32 `json:"overrideEcoAfterDurationInMins"`
}

CarbonIntensityDuration represents the configuration to disable carbon aware scaler when carbon intensity is above a threshold for a specific duration

func (*CarbonIntensityDuration) DeepCopy

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

func (*CarbonIntensityDuration) DeepCopyInto

func (in *CarbonIntensityDuration) DeepCopyInto(out *CarbonIntensityDuration)

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

type CarbonIntensityForecastDataSource

type CarbonIntensityForecastDataSource struct {
	// local configmap details
	// +kubebuilder:validation:Optional
	LocalConfigMap LocalConfigMap `json:"localConfigMap,omitempty"`
	// mock carbon forecast data
	// +kubebuilder:validation:Optional
	MockCarbonForecast bool `json:"mockCarbonForecast,omitempty"`
}

CarbonIntensityForecastDataSource represents the carbon intensity forecast data source

func (*CarbonIntensityForecastDataSource) DeepCopy

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

func (*CarbonIntensityForecastDataSource) DeepCopyInto

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

type EcoModeOff

type EcoModeOff struct {
	// default maximum number of replicas when carbon aware scaler is disabled
	// +kubebuilder:validation:Required
	MaxReplicas int32 `json:"maxReplicas"`

	// disable carbon aware scaler when carbon intensity is above a threshold for a specific duration
	// +kubebuilder:validation:Optional
	CarbonIntensityDuration CarbonIntensityDuration `json:"carbonIntensityDuration,omitempty"`

	// disable carbon aware scaler at specific time periods
	// +kubebuilder:validation:Optional
	CustomSchedule []Schedule `json:"customSchedule,omitempty"`

	// disable carbon aware scaler on a recurring schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
	// +kubebuilder:validation:Optional
	RecurringSchedule []string `json:"recurringSchedule,omitempty"`
}

EcoModeOff represents the configuration to disable carbon aware scaler

func (*EcoModeOff) DeepCopy

func (in *EcoModeOff) DeepCopy() *EcoModeOff

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

func (*EcoModeOff) DeepCopyInto

func (in *EcoModeOff) DeepCopyInto(out *EcoModeOff)

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

type KedaTarget

type KedaTarget string

KedaTarget represents the type of the KEDA target Only one of the following KEDA targets is supported: - scaledobjects.keda.sh - scaledjobs.keda.sh +kubebuilder:validation:Enum=scaledobjects.keda.sh;scaledjobs.keda.sh

const (
	ScaledObject KedaTarget = "scaledobjects.keda.sh"
	ScaledJob    KedaTarget = "scaledjobs.keda.sh"
)

type KedaTargetRef

type KedaTargetRef struct {
	// name of the keda target
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// namespace of the keda target
	// +kubebuilder:validation:Required
	Namespace string `json:"namespace"`
}

KedaTargetRef represents the KEDA object to scale

func (*KedaTargetRef) DeepCopy

func (in *KedaTargetRef) DeepCopy() *KedaTargetRef

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

func (*KedaTargetRef) DeepCopyInto

func (in *KedaTargetRef) DeepCopyInto(out *KedaTargetRef)

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

type LocalConfigMap

type LocalConfigMap struct {
	// name of the configmap
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// namespace of the configmap
	// +kubebuilder:validation:Required
	Namespace string `json:"namespace"`

	// key of the carbon intensity forecast data in the configmap
	// +kubebuilder:validation:Required
	Key string `json:"key"`
}

func (*LocalConfigMap) DeepCopy

func (in *LocalConfigMap) DeepCopy() *LocalConfigMap

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

func (*LocalConfigMap) DeepCopyInto

func (in *LocalConfigMap) DeepCopyInto(out *LocalConfigMap)

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

type Schedule

type Schedule struct {
	// start time in utc
	// +kubebuilder:validation:Required
	StartTime string `json:"startTime"`

	// end time in utc
	// +kubebuilder:validation:Required
	EndTime string `json:"endTime"`
}

Schedule represents a time period to disable carbon aware scaler

func (*Schedule) DeepCopy

func (in *Schedule) DeepCopy() *Schedule

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

func (*Schedule) DeepCopyInto

func (in *Schedule) DeepCopyInto(out *Schedule)

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