Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ReconcilesTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "carbon_aware_keda_scaler_reconciles_total", Help: "Total number of reconciles", }, []string{"app"}, ) ReconcileErrorsTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "carbon_aware_keda_scaler_reconcile_errors_total", Help: "Total number of reconcile errors", }, []string{"app"}, ) CarbonIntensityMetric = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "carbon_aware_keda_scaler_carbon_intensity", Help: "Carbon intensity", }, []string{"app"}, ) DefaultMaxReplicasMetric = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "carbon_aware_keda_scaler_default_max_replicas", Help: "Default max replicas", }, []string{"app"}, ) MaxReplicasMetric = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "carbon_aware_keda_scaler_max_replicas", Help: "Max replicas", }, []string{"app"}, ) EcoModeOffMetric = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "carbon_aware_keda_scaler_eco_mode_off", Help: "Eco mode off", }, []string{"app", "code"}, ) )
Functions ¶
This section is empty.
Types ¶
type CarbonAwareKedaScalerReconciler ¶
type CarbonAwareKedaScalerReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder CarbonForecastFetcher }
CarbonAwareKedaScalerReconciler reconciles a CarbonAwareKedaScaler object
func (*CarbonAwareKedaScalerReconciler) Reconcile ¶
func (r *CarbonAwareKedaScalerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (*CarbonAwareKedaScalerReconciler) SetupWithManager ¶
func (r *CarbonAwareKedaScalerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CarbonForecast ¶
type CarbonForecastConfigMapFetcher ¶
type CarbonForecastConfigMapFetcher struct { Client client.Client ConfigMapName string ConfigMapNamespace string ConfigMapKey string }
CarbonForecastConfigMapFetcher is an implementation of CarbonForecastFetcher that fetches the carbon forecast from a configmap
func (*CarbonForecastConfigMapFetcher) Fetch ¶
func (c *CarbonForecastConfigMapFetcher) Fetch(ctx context.Context) ([]CarbonForecast, error)
type CarbonForecastFetcher ¶
type CarbonForecastFetcher interface {
Fetch(ctx context.Context) ([]CarbonForecast, error)
}
type CarbonForecastMockConfigMapFetcher ¶
type CarbonForecastMockConfigMapFetcher struct { Client client.Client CarbonForecast []CarbonForecast }
CarbonForecastMockConfigMapFetcher is an implementation of CarbonForecastFetcher that creates and fetches a mock configmap
func (*CarbonForecastMockConfigMapFetcher) Fetch ¶
func (c *CarbonForecastMockConfigMapFetcher) Fetch(ctx context.Context) ([]CarbonForecast, error)