Documentation
¶
Index ¶
- func ClassifierPredicate(logger logr.Logger) predicate.Funcs
- func ClassifierReportPredicate(logger logr.Logger) predicate.Funcs
- func ConfigMapPredicates(logger logr.Logger) predicate.Funcs
- func InitScheme() (*runtime.Scheme, error)
- func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
- func SecretPredicates(logger logr.Logger) predicate.Funcs
- func SetManagementClusterAccess(config *rest.Config, c client.Client)
- func SetSveltosAgentConfigMap(name string)
- func SetVersion(v string)
- func SveltosClusterPredicates(logger logr.Logger) predicate.Funcs
- type ClassifierReconciler
- type ClusterPredicate
- func (p ClusterPredicate) Create(obj event.TypedCreateEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Cluster]) bool
- type ClusterReconciler
- type MachinePredicate
- func (p MachinePredicate) Create(obj event.TypedCreateEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Machine]) bool
- type ReportMode
- type SveltosClusterReconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifierPredicate ¶
ClassifierPredicate predicates for Classifier. ClassifierReconciler watches Classifier events and react to those by reconciling itself based on following predicates
func ClassifierReportPredicate ¶
ClassifierReportPredicate predicates for ClassifierReport. ClassifierReconciler watches ClassifierReport events and react to those by reconciling itself based on following predicates
func ConfigMapPredicates ¶ added in v0.34.0
ConfigMapPredicates predicates for ConfigMap. ClassifierReconciler watches ConfigMap events and react to those by reconciling itself based on following predicates
func InitScheme ¶
func RegisterFeatures ¶
func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
func SecretPredicates ¶ added in v0.3.0
SecretPredicates predicates for Secret. ClassifierReconciler watches Secret events and react to those by reconciling itself based on following predicates
func SetManagementClusterAccess ¶ added in v0.18.0
func SetSveltosAgentConfigMap ¶ added in v0.34.0
func SetSveltosAgentConfigMap(name string)
func SetVersion ¶ added in v0.22.0
func SetVersion(v string)
Types ¶
type ClassifierReconciler ¶
type ClassifierReconciler struct { client.Client Scheme *runtime.Scheme Deployer deployer.DeployerInterface ConcurrentReconciles int ClassifierReportMode ReportMode AgentInMgmtCluster bool // if true, indicates sveltos-agent needs to be started in the management cluster // Management cluster controlplane endpoint. This is needed when mode is AgentSendReportsNoGateway. // It will be used by classifier-agent to send classifierreports back to management cluster. ControlPlaneEndpoint string ShardKey string // when set, only clusters matching the ShardKey will be reconciled // use a Mutex to update in-memory structure as MaxConcurrentReconciles is higher than one Mux sync.Mutex // key: Sveltos/CAPI Cluster namespace/name; value: set of all Classifiers deployed int the Cluster // When a Cluster changes, we need to reconcile one or more Classifier (as of now all Classifier // are deployed in all Clusters). In order to do so, Classifier reconciler watches for Sveltos/CAPI Cluster // changes. Inside a MapFunc there should be no I/O (if that fails, there is no way to recover). // So keeps track of Classifier sets deployed in each Sveltos/CAPI Cluster, so that when Sveltos/CAPI Cluster changes // list of Classifiers that need reconciliation is in memory. // Even though currently each Classifier is deployed in each Sveltos/CAPI Cluster, do not simply keep an in-memory // list of all existing Classifier. Rather keep a map per Sveltos/CAPI cluster. If in future, not all Classifiers // are deployed in all clusters, map will come in handy. // key: Sveltos/CAPI Cluster namespace/name; value: set of all ClusterProfiles matching the Cluster ClusterMap map[corev1.ObjectReference]*libsveltosset.Set // key: Classifier; value: set of Sveltos/CAPI Clusters matched ClassifierMap map[corev1.ObjectReference]*libsveltosset.Set // Contains list of all Classifier with at least one conflict ClassifierSet libsveltosset.Set // List of current existing Classifiers AllClassifierSet libsveltosset.Set }
ClassifierReconciler reconciles a Classifier object
func (*ClassifierReconciler) SetupWithManager ¶
func (r *ClassifierReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
SetupWithManager sets up the controller with the Manager.
func (*ClassifierReconciler) WatchForCAPI ¶ added in v0.3.0
func (r *ClassifierReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
type ClusterPredicate ¶ added in v0.29.0
func (ClusterPredicate) Create ¶ added in v0.29.0
func (p ClusterPredicate) Create(obj event.TypedCreateEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Delete ¶ added in v0.29.0
func (p ClusterPredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Generic ¶ added in v0.29.0
func (p ClusterPredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Update ¶ added in v0.29.0
func (p ClusterPredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Cluster]) bool
type ClusterReconciler ¶
ClusterReconciler reconciles a Cluster object
func (*ClusterReconciler) SetupWithManager ¶
func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MachinePredicate ¶ added in v0.29.0
func (MachinePredicate) Create ¶ added in v0.29.0
func (p MachinePredicate) Create(obj event.TypedCreateEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Delete ¶ added in v0.29.0
func (p MachinePredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Generic ¶ added in v0.29.0
func (p MachinePredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Update ¶ added in v0.29.0
func (p MachinePredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Machine]) bool
type ReportMode ¶
type ReportMode int
const ( // Default mode. In this mode, Classifier running // in the management cluster periodically collect // ClassifierReport from Sveltos/CAPI clusters CollectFromManagementCluster ReportMode = iota // In this mode, classifier agent sends ClassifierReport // to management cluster. // SveltosAgent is provided with Kubeconfig to access // management cluster and can only update ClassifierReport/ // HealthCheckReport/EventReport AgentSendReportsNoGateway )
type SveltosClusterReconciler ¶ added in v0.3.0
SveltosClusterReconciler reconciles a SveltosCluster object
func (*SveltosClusterReconciler) SetupWithManager ¶ added in v0.3.0
func (r *SveltosClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.