Documentation
¶
Index ¶
- func ClassifierPredicate(logger logr.Logger) predicate.Funcs
- func ClassifierReportPredicate(logger logr.Logger) predicate.Funcs
- func ClusterPredicates(logger logr.Logger) predicate.Funcs
- func InitScheme() (*runtime.Scheme, error)
- func MachinePredicates(logger logr.Logger) predicate.Funcs
- func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
- func SecretPredicates(logger logr.Logger) predicate.Funcs
- func SveltosClusterPredicates(logger logr.Logger) predicate.Funcs
- type ClassifierReconciler
- type ClusterReconciler
- 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 ClusterPredicates ¶
ClusterPredicates predicates for v1Cluster. ClassifierReconciler watches v1Cluster events and react to those by reconciling itself based on following predicates
func InitScheme ¶
func MachinePredicates ¶
MachinePredicates predicates for v1Machine. ClassifierReconciler watches v1Machine events and react to those by reconciling itself based on following predicates
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
Types ¶
type ClassifierReconciler ¶
type ClassifierReconciler struct { client.Client Scheme *runtime.Scheme Deployer deployer.DeployerInterface ConcurrentReconciles int ClassifierReportMode ReportMode // 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 // 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) Reconcile ¶
func (r *ClassifierReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr 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. TODO(user): Modify the Reconcile function to compare the state specified by the Classifier object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.1/pkg/reconcile
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 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 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. // ClassifierAgent is provided with Kubeconfig to access // management cluster and can only update ClassifierReport 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.