Documentation
¶
Overview ¶
Package lcore provides reconciliation logic for the LightSpeed Core (LCore) component.
This package handles the complete lifecycle of the LCore stack, which includes:
- Llama Stack for AI model serving
- Lightspeed Stack for OLS integration
- Deployment and pod management for both containers
- Service account and RBAC configuration
- ConfigMap generation for both Llama Stack and OLS configuration
- Service and networking setup
- Service monitors and Prometheus rules for observability
- Network policies for security
The main entry point is ReconcileLCore, which orchestrates all sub-tasks required to ensure the LCore stack is running with the correct configuration.
Index ¶
- func GenerateAppServerNetworkPolicy(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*networkingv1.NetworkPolicy, error)
- func GenerateLCoreDeployment(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*appsv1.Deployment, error)
- func GenerateLcoreConfigMap(r reconciler.Reconciler, ctx context.Context, cr *olsv1alpha1.OLSConfig) (*corev1.ConfigMap, error)
- func GenerateLlamaStackConfigMap(r reconciler.Reconciler, ctx context.Context, cr *olsv1alpha1.OLSConfig) (*corev1.ConfigMap, error)
- func GenerateMetricsReaderSecret(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.Secret, error)
- func GeneratePrometheusRule(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*monv1.PrometheusRule, error)
- func GenerateSARClusterRole(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*rbacv1.ClusterRole, error)
- func GenerateService(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.Service, error)
- func GenerateServiceAccount(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.ServiceAccount, error)
- func GenerateServiceMonitor(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*monv1.ServiceMonitor, error)
- func ReconcileLCore(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
- func ReconcileLCoreDeployment(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
- func ReconcileLCoreResources(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
- func RestartLCore(r reconciler.Reconciler, ctx context.Context, deployment ...*appsv1.Deployment) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAppServerNetworkPolicy ¶
func GenerateAppServerNetworkPolicy(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*networkingv1.NetworkPolicy, error)
func GenerateLCoreDeployment ¶
func GenerateLCoreDeployment(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*appsv1.Deployment, error)
GenerateLCoreDeployment generates the Deployment for LCore (llama-stack + lightspeed-stack)
func GenerateLcoreConfigMap ¶
func GenerateLcoreConfigMap(r reconciler.Reconciler, ctx context.Context, cr *olsv1alpha1.OLSConfig) (*corev1.ConfigMap, error)
Generates LCoreConfigMap using YAML string building (like Llama Stack)
func GenerateLlamaStackConfigMap ¶
func GenerateLlamaStackConfigMap(r reconciler.Reconciler, ctx context.Context, cr *olsv1alpha1.OLSConfig) (*corev1.ConfigMap, error)
Generates Llama stack config map
func GenerateMetricsReaderSecret ¶
func GenerateMetricsReaderSecret(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.Secret, error)
func GeneratePrometheusRule ¶
func GeneratePrometheusRule(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*monv1.PrometheusRule, error)
func GenerateSARClusterRole ¶
func GenerateSARClusterRole(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*rbacv1.ClusterRole, error)
SAR = SubjectAccessReview SARClusterRole provides permissions for the OLS Application Server to perform authentication and authorization checks for users accessing the OLS API.
func GenerateService ¶
func GenerateService(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.Service, error)
func GenerateServiceAccount ¶
func GenerateServiceAccount(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*corev1.ServiceAccount, error)
Service account for running LCore server
func GenerateServiceMonitor ¶
func GenerateServiceMonitor(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (*monv1.ServiceMonitor, error)
func ReconcileLCore ¶
func ReconcileLCore(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
ReconcileLCore reconciles all LCore resources in the original order. This function is maintained for backward compatibility with existing tests. New code should call ReconcileLCoreResources and ReconcileLCoreDeployment separately.
func ReconcileLCoreDeployment ¶
func ReconcileLCoreDeployment(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
ReconcileLCoreDeployment reconciles the deployment and related resources (Phase 2)
func ReconcileLCoreResources ¶
func ReconcileLCoreResources(r reconciler.Reconciler, ctx context.Context, olsconfig *olsv1alpha1.OLSConfig) error
ReconcileLCoreResources reconciles all resources except the deployment (Phase 1) Uses continue-on-error pattern since these resources are independent
func RestartLCore ¶
func RestartLCore(r reconciler.Reconciler, ctx context.Context, deployment ...*appsv1.Deployment) error
RestartLCore triggers a rolling restart of the LCore deployment by updating its pod template annotation. This is useful when configuration changes require a pod restart (e.g., ConfigMap or Secret updates).
Types ¶
This section is empty.