Documentation
¶
Index ¶
- Constants
- Variables
- func GetComponentKeys() []string
- func IsAnalyticsComponent(key string) bool
- func IsCoreComponent(key string) bool
- type Component
- type ComponentStatus
- type Manager
- func (m *Manager) GetAllComponentStatuses(ctx context.Context) ([]ComponentStatus, error)
- func (m *Manager) GetComponentLogs(ctx context.Context, key string, tailLines int64) ([]string, error)
- func (m *Manager) GetComponentStatus(ctx context.Context, key string) (ComponentStatus, error)
- func (m *Manager) GetCoreComponentStatuses(ctx context.Context) ([]ComponentStatus, error)
- func (m *Manager) RestartAllComponents(ctx context.Context) []error
- func (m *Manager) RestartComponent(ctx context.Context, key string) error
- type PortTarget
Constants ¶
const ( PlatformNamespace = platforminventory.PlatformNamespace ObservabilityNamespace = platforminventory.ObservabilityNamespace LogCollectorNamespace = platforminventory.LogCollectorNamespace OperatorNamespace = platforminventory.OperatorNamespace )
const SessionLocalMaxReplicas int32 = 1
SessionLocalMaxReplicas is the maximum safe replica count for Sentinel deployments that rely on the UI's in-memory session store until shared session storage is implemented.
Variables ¶
var Components = platforminventory.SentinelComponents(true)
Components preserves the historical public status and management surface.
var SessionLocalDeploymentNames = []string{
"github.com/mcp-runtime/mcp-runtime/services/ui",
"mcp-platform-gateway",
}
SessionLocalDeploymentNames lists Sentinel Deployments that must stay at SessionLocalMaxReplicas. Scaling UI or gateway beyond one replica breaks login and /auth/admin-check when requests hit different pods.
Functions ¶
func GetComponentKeys ¶
func GetComponentKeys() []string
GetComponentKeys returns sorted list of all component keys.
func IsAnalyticsComponent ¶
IsAnalyticsComponent returns true if the component is part of analytics/observability.
func IsCoreComponent ¶
IsCoreComponent returns true if the component is part of the core Sentinel runtime.
Types ¶
type Component ¶
type Component = platforminventory.Component
Component and PortTarget retain the Sentinel API's existing field names.
func FindComponent ¶
FindComponent finds a component by key or alias.
type ComponentStatus ¶
type ComponentStatus struct {
Key string `json:"key"`
Display string `json:"display"`
Namespace string `json:"namespace"`
Kind string `json:"kind"`
Resource string `json:"resource"`
Status string `json:"status"`
Ready string `json:"ready"`
Message string `json:"message,omitempty"`
}
ComponentStatus represents the runtime status of a component.
func StatusFromWorkload ¶
func StatusFromWorkload(component Component, readyReplicas, desiredReplicas int32, message string) ComponentStatus
StatusFromWorkload creates a ComponentStatus from Kubernetes workload info.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides operations for Sentinel stack components. Each component carries its own namespace from the inventory.
func NewManager ¶
func NewManager(clientset kubernetes.Interface) *Manager
NewManager creates a new Sentinel component manager.
func (*Manager) GetAllComponentStatuses ¶
func (m *Manager) GetAllComponentStatuses(ctx context.Context) ([]ComponentStatus, error)
GetAllComponentStatuses returns the status of all components.
func (*Manager) GetComponentLogs ¶
func (m *Manager) GetComponentLogs(ctx context.Context, key string, tailLines int64) ([]string, error)
GetComponentLogs returns logs for a component (for API streaming).
func (*Manager) GetComponentStatus ¶
GetComponentStatus returns the status of a single component.
func (*Manager) GetCoreComponentStatuses ¶
func (m *Manager) GetCoreComponentStatuses(ctx context.Context) ([]ComponentStatus, error)
GetCoreComponentStatuses returns statuses for core runtime components only.
func (*Manager) RestartAllComponents ¶
RestartAllComponents restarts all core components.
type PortTarget ¶
type PortTarget = platforminventory.PortTarget
func FindPortTarget ¶
func FindPortTarget(name string) (*PortTarget, error)
FindPortTarget finds a component with a port forwarding target.