Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CarbonIntensityMetric = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "carbon_aware_karmada_operator_cluster_carbon_intensity", Help: "Cluster carbon intensity", }, []string{"cluster", "location", "active"}, ) ReconcilesTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "carbon_aware_karmada_operator_reconciles_total", Help: "Total number of reconciles", }, []string{"app"}, ) ReconcileErrorsTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "carbon_aware_karmada_operator_reconcile_errors_total", Help: "Total number of reconcile errors", }, []string{"app"}, ) )
Functions ¶
This section is empty.
Types ¶
type CarbonAwareKarmadaPolicyReconciler ¶
type CarbonAwareKarmadaPolicyReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder CarbonIntensityFetcher }
CarbonAwareKarmadaPolicyReconciler reconciles a CarbonAwareKarmadaPolicy object
func (*CarbonAwareKarmadaPolicyReconciler) Reconcile ¶
func (r *CarbonAwareKarmadaPolicyReconciler) 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.4/pkg/reconcile
func (*CarbonAwareKarmadaPolicyReconciler) SetupWithManager ¶
func (r *CarbonAwareKarmadaPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CarbonIntensity ¶
type CarbonIntensityFetcher ¶
type ClusterCarbonIntensity ¶
type ClusterCarbonIntensity struct { CarbonIntensity CarbonIntensity ClusterName string }
type GridIntensityFetcher ¶
type GridIntensityFetcher struct {
// contains filtered or unexported fields
}
func NewGridIntensityFetcher ¶
func NewGridIntensityFetcher(providerName string) (*GridIntensityFetcher, error)
func (*GridIntensityFetcher) Fetch ¶
func (g *GridIntensityFetcher) Fetch(ctx context.Context, clusterName, location string) (ClusterCarbonIntensity, error)
func (*GridIntensityFetcher) Provider ¶
func (g *GridIntensityFetcher) Provider() string
Click to show internal directories.
Click to hide internal directories.