Documentation
¶
Index ¶
- Constants
- func ClusterSummaryPredicates(logger logr.Logger) predicate.Funcs
- func HealthCheckPredicates(logger logr.Logger) predicate.Funcs
- func HealthCheckReportPredicates(logger logr.Logger) predicate.Funcs
- func InitScheme() (*runtime.Scheme, error)
- func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
- func SetAgentInMgmtCluster(isInMgmtCluster bool)
- func SetManagementClusterAccess(c client.Client, config *rest.Config)
- func SetManagementRecorder(r events.EventRecorder)
- type ClusterHealthCheckReconciler
- func (r *ClusterHealthCheckReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *ClusterHealthCheckReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
- func (r *ClusterHealthCheckReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
- type ClusterReconciler
- type HealthCheckReconciler
- type ReloaderReportReconciler
- type ReportMode
- type SveltosClusterReconciler
Constants ¶
const (
// Namespace where reports will be generated
ReportNamespace = "projectsveltos"
)
Variables ¶
This section is empty.
Functions ¶
func ClusterSummaryPredicates ¶
ClusterSummaryPredicates predicates for clustersummary. ClusterHealthCheckReconciler watches sveltos ClusterSummary events and react to those by reconciling itself based on following predicates
func HealthCheckPredicates ¶ added in v0.7.0
HealthCheckPredicates predicates for HealthCheck. ClusterHealthCheckReconciler watches sveltos HealthCheck events and react to those by reconciling itself based on following predicates
func HealthCheckReportPredicates ¶ added in v0.7.0
HealthCheckReportPredicates predicates for HealthCheckReport. ClusterHealthCheckReconciler watches sveltos HealthCheckReport 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 SetAgentInMgmtCluster ¶ added in v0.52.0
func SetAgentInMgmtCluster(isInMgmtCluster bool)
func SetManagementClusterAccess ¶ added in v0.52.0
func SetManagementRecorder ¶
func SetManagementRecorder(r events.EventRecorder)
Types ¶
type ClusterHealthCheckReconciler ¶
type ClusterHealthCheckReconciler struct {
client.Client
Scheme *runtime.Scheme
ConcurrentReconciles int
Deployer deployer.DeployerInterface
ShardKey string // when set, only clusters matching the ShardKey will be reconciled
CapiOnboardAnnotation string // when set, only capi clusters with this annotation are considered
Mux sync.Mutex // use a Mutex to update Map as MaxConcurrentReconciles is higher than one
Logger logr.Logger
// ClusterHealthChecks with a LivenessCheck of type LivenessTypeAddons
AddonsLivenessCHC map[types.NamespacedName]struct{}
// key: Sveltos/CAPI Cluster: value: set of all ClusterHealthCheck instances matching the Cluster
ClusterMap map[corev1.ObjectReference]*libsveltosset.Set
// key: ClusterHealthCheck: value: set of Sveltos/CAPI Clusters matched
CHCToClusterMap map[types.NamespacedName]*libsveltosset.Set
// key: ClusterHealthCheck; value ClusterHealthCheck Selector
ClusterHealthChecks map[corev1.ObjectReference]libsveltosv1beta1.Selector
// For each cluster contains current labels
// This is needed in following scenario:
// - ClusterHealthCheck is created
// - Cluster is created with labels matching ClusterHealthCheck
// - When first control plane machine in such cluster becomes available
// we need Cluster labels to know which ClusterHealthCheck to reconcile
ClusterLabels map[corev1.ObjectReference]map[string]string
// key: HealthCheck: value: set of all ClusterHealthCheck referencing it
HealthCheckMap map[corev1.ObjectReference]*libsveltosset.Set
// Key: ClusterHealthCheck: value: set of HealthChecks referenced
CHCToHealthCheckMap map[types.NamespacedName]*libsveltosset.Set
}
ClusterHealthCheckReconciler reconciles a ClusterHealthCheck object
func (*ClusterHealthCheckReconciler) SetupWithManager ¶
func (r *ClusterHealthCheckReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
SetupWithManager sets up the controller with the Manager.
func (*ClusterHealthCheckReconciler) WatchForCAPI ¶
func (r *ClusterHealthCheckReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
type ClusterReconciler ¶ added in v0.7.0
ClusterReconciler reconciles a Cluster object
func (*ClusterReconciler) SetupWithManager ¶ added in v0.7.0
func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type HealthCheckReconciler ¶ added in v0.7.0
type HealthCheckReconciler struct {
client.Client
Scheme *runtime.Scheme
HealthCheckReportMode ReportMode
ShardKey string // when set, only clusters matching the ShardKey will be reconciled
CapiOnboardAnnotation string // when set, only capi clusters with this annotation are considered
Version string
}
HealthCheckReconciler reconciles a HealthCheck object
func (*HealthCheckReconciler) Reconcile ¶ added in v0.7.0
func (r *HealthCheckReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
+kubebuilder:rbac:groups=lib.projectsveltos.io,resources=healthchecks,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=lib.projectsveltos.io,resources=healthchecks/status,verbs=get;update;patch +kubebuilder:rbac:groups=lib.projectsveltos.io,resources=healthchecks/finalizers,verbs=update
func (*HealthCheckReconciler) SetupWithManager ¶ added in v0.7.0
func (r *HealthCheckReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ReloaderReportReconciler ¶ added in v0.15.0
type ReloaderReportReconciler struct {
client.Client
Scheme *runtime.Scheme
ReloaderReportMode ReportMode
ShardKey string // when set, only clusters matching the ShardKey will be reconciled
CapiOnboardAnnotation string // when set, only capi clusters with this annotation are considered
Version string
}
ReloaderReportReconciler reconciles a ReloaderReport object
func (*ReloaderReportReconciler) SetupWithManager ¶ added in v0.15.0
func (r *ReloaderReportReconciler) SetupWithManager(mgr ctrl.Manager, collectionInterval int) error
SetupWithManager sets up the controller with the Manager.
type ReportMode ¶ added in v0.7.0
type ReportMode int
const ( // Default mode. In this mode, healthCheckManager running // in the management cluster periodically collects // HealthCheckReport from Sveltos/CAPI clusters CollectFromManagementCluster ReportMode = iota // In this mode, sveltos agent sends HealthCheckReport // to management cluster. // SveltosAgent is provided with Kubeconfig to access // management cluster and can only update HealthCheckReport (and ClassifierReport) AgentSendReportsNoGateway )
type SveltosClusterReconciler ¶ added in v0.7.0
SveltosClusterReconciler reconciles a SveltosCluster object
func (*SveltosClusterReconciler) SetupWithManager ¶ added in v0.7.0
func (r *SveltosClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Source Files
¶
- cluster_controller.go
- clusterhealthcheck_controller.go
- clusterhealthcheck_deployer.go
- clusterhealthcheck_features.go
- clusterhealthcheck_predicates.go
- clusterhealthcheck_transformations.go
- healthcheck_controller.go
- healthcheckreport.go
- healthcheckreport_collection.go
- liveness.go
- management_cluster.go
- metrics.go
- notification.go
- notification_constants.go
- recorder.go
- reloaderreport_collection.go
- reloaderreport_controller.go
- reloaderrreport.go
- sveltoscluster_controller.go
- utils.go