Documentation
¶
Overview ¶
Package controller implements the main Kubernetes controller for managing the OpenShift Lightspeed operator lifecycle.
This package contains the OLSConfigReconciler, which is the central orchestrator for the entire operator. It coordinates reconciliation across all components (appserver, postgres, console) and manages the OLSConfig custom resource.
Key Responsibilities:
- Reconcile the OLSConfig custom resource
- Coordinate component reconciliation (appserver, postgres, console)
- Manage status conditions and CR status updates
- Delegate LLM provider secret reconciliation to appserver package
- Set up resource watchers for automatic updates (secrets, configmaps)
- Implement hash-based change detection for configuration updates
- Manage operator-level resources (service monitors, network policies)
The main reconciliation flow:
- Reconcile operator-level resources (service monitor, network policy)
- Delegate LLM provider secret reconciliation to appserver.ReconcileLLMSecrets()
- Reconcile PostgreSQL database (if conversation cache enabled)
- Reconcile Console UI plugin
- Reconcile application server components
- Update status conditions based on deployment readiness
The OLSConfigReconciler implements the reconciler.Reconciler interface, allowing it to be passed to component packages for isolated reconciliation without circular dependencies.
Index ¶
- type OLSConfigReconciler
- func (r *OLSConfigReconciler) GetAppServerImage() string
- func (r *OLSConfigReconciler) GetConsoleUIImage() string
- func (r *OLSConfigReconciler) GetDataverseExporterImage() string
- func (r *OLSConfigReconciler) GetLCoreImage() string
- func (r *OLSConfigReconciler) GetLogger() logr.Logger
- func (r *OLSConfigReconciler) GetNamespace() string
- func (r *OLSConfigReconciler) GetOpenShiftMCPServerImage() string
- func (r *OLSConfigReconciler) GetOpenShiftMajor() string
- func (r *OLSConfigReconciler) GetOpenshiftMinor() string
- func (r *OLSConfigReconciler) GetPostgresImage() string
- func (r *OLSConfigReconciler) GetScheme() *runtime.Scheme
- func (r *OLSConfigReconciler) GetStateCache() map[string]string
- func (r *OLSConfigReconciler) IsPrometheusAvailable() bool
- func (r *OLSConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *OLSConfigReconciler) ReconcileNetworkPolicyForOperator(ctx context.Context) error
- func (r *OLSConfigReconciler) ReconcileServiceMonitorForOperator(ctx context.Context) error
- func (r *OLSConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *OLSConfigReconciler) UpdateStatusCondition(ctx context.Context, olsconfig *olsv1alpha1.OLSConfig, conditionType string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OLSConfigReconciler ¶
type OLSConfigReconciler struct {
client.Client
Logger logr.Logger
StateCache map[string]string
Options utils.OLSConfigReconcilerOptions
NextReconcileTime time.Time
}
OLSConfigReconciler reconciles a OLSConfig object
func (*OLSConfigReconciler) GetAppServerImage ¶
func (r *OLSConfigReconciler) GetAppServerImage() string
func (*OLSConfigReconciler) GetConsoleUIImage ¶
func (r *OLSConfigReconciler) GetConsoleUIImage() string
func (*OLSConfigReconciler) GetDataverseExporterImage ¶
func (r *OLSConfigReconciler) GetDataverseExporterImage() string
func (*OLSConfigReconciler) GetLCoreImage ¶
func (r *OLSConfigReconciler) GetLCoreImage() string
func (*OLSConfigReconciler) GetLogger ¶
func (r *OLSConfigReconciler) GetLogger() logr.Logger
func (*OLSConfigReconciler) GetNamespace ¶
func (r *OLSConfigReconciler) GetNamespace() string
func (*OLSConfigReconciler) GetOpenShiftMCPServerImage ¶
func (r *OLSConfigReconciler) GetOpenShiftMCPServerImage() string
func (*OLSConfigReconciler) GetOpenShiftMajor ¶
func (r *OLSConfigReconciler) GetOpenShiftMajor() string
func (*OLSConfigReconciler) GetOpenshiftMinor ¶
func (r *OLSConfigReconciler) GetOpenshiftMinor() string
func (*OLSConfigReconciler) GetPostgresImage ¶
func (r *OLSConfigReconciler) GetPostgresImage() string
func (*OLSConfigReconciler) GetScheme ¶
func (r *OLSConfigReconciler) GetScheme() *runtime.Scheme
Implement reconciler.Reconciler interface
func (*OLSConfigReconciler) GetStateCache ¶
func (r *OLSConfigReconciler) GetStateCache() map[string]string
func (*OLSConfigReconciler) IsPrometheusAvailable ¶
func (r *OLSConfigReconciler) IsPrometheusAvailable() bool
func (*OLSConfigReconciler) Reconcile ¶
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.17.3/pkg/reconcile
func (*OLSConfigReconciler) ReconcileNetworkPolicyForOperator ¶
func (r *OLSConfigReconciler) ReconcileNetworkPolicyForOperator(ctx context.Context) error
func (*OLSConfigReconciler) ReconcileServiceMonitorForOperator ¶
func (r *OLSConfigReconciler) ReconcileServiceMonitorForOperator(ctx context.Context) error
func (*OLSConfigReconciler) SetupWithManager ¶
func (r *OLSConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*OLSConfigReconciler) UpdateStatusCondition ¶
func (r *OLSConfigReconciler) UpdateStatusCondition(ctx context.Context, olsconfig *olsv1alpha1.OLSConfig, conditionType string, status bool, message string, err error, inCluster ...bool)
updateStatusCondition updates the status condition of the OLSConfig Custom Resource instance. TODO: Should we support Unknown status and ObservedGeneration? TODO: conditionType must be metav1.Condition?
Directories
¶
| Path | Synopsis |
|---|---|
|
Package appserver provides reconciliation logic for the OpenShift Lightspeed application server component.
|
Package appserver provides reconciliation logic for the OpenShift Lightspeed application server component. |
|
Package console provides reconciliation logic for the OpenShift Console UI plugin that integrates OpenShift Lightspeed into the OpenShift web console.
|
Package console provides reconciliation logic for the OpenShift Console UI plugin that integrates OpenShift Lightspeed into the OpenShift web console. |
|
Package lcore provides reconciliation logic for the LightSpeed Core (LCore) component.
|
Package lcore provides reconciliation logic for the LightSpeed Core (LCore) component. |
|
Package postgres provides reconciliation logic for the PostgreSQL database component used by OpenShift Lightspeed for conversation cache storage.
|
Package postgres provides reconciliation logic for the PostgreSQL database component used by OpenShift Lightspeed for conversation cache storage. |
|
Package reconciler defines the interface contract between the main OLSConfigReconciler and component-specific reconcilers (appserver, postgres, console).
|
Package reconciler defines the interface contract between the main OLSConfigReconciler and component-specific reconcilers (appserver, postgres, console). |
|
Package utils provides shared utility functions, types, and constants used across the OpenShift Lightspeed operator components.
|
Package utils provides shared utility functions, types, and constants used across the OpenShift Lightspeed operator components. |