Documentation
¶
Overview ¶
Package controller implements the Kubernetes controllers for agent-orca CRDs.
Index ¶
Constants ¶
const ( // LabelManagedByMCPServer marks Tools generated by the MCPServer controller. LabelManagedByMCPServer = "mcpserver" // LabelManagedBy identifies who manages a resource. LabelManagedBy = "agentorca.io/managed-by" // LabelMCPServer identifies which MCPServer owns a Tool. LabelMCPServer = "agentorca.io/mcpserver" )
const ( // ControllerPrincipal is the reserved name in MCPServer.allowedAgents that // grants the KnowledgeBase controller access to the MCP server. ControllerPrincipal = "_controller" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentDeploymentReconciler ¶
type AgentDeploymentReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
K8s kubernetes.Interface
ModelRouterImage string
StateConfig state.Config
CloudProvider security.CloudProvider
// TokenReviewerClusterRole is the ClusterRole that grants "create tokenreviews".
TokenReviewerClusterRole string
// OperatorAPIURL is the base URL of the operator's internal API server.
// Injected into the router config so the model-router can call RAG, handoff, etc.
OperatorAPIURL string
// LLMRequestTimeout is the per-LLM-request timeout written into every router
// config (default 1h). Injected from the LLM_REQUEST_TIMEOUT env var.
LLMRequestTimeout time.Duration
// ContextCompactionRatio is the target fraction of the context window to
// compact the in-memory buffer down to when truncation fires (issue #54).
// Default 0.5 (50%); set to 0.1 for aggressive compaction to ~10%.
// Injected from the CONTEXT_COMPACTION_RATIO env var.
ContextCompactionRatio float64
// HindsightURL is the configured hindsight API endpoint (e.g. http://hindsight.local).
// Injected from the HINDSIGHT_URL env var. Used to generate ipBlock egress rules
// in the per-run NetworkPolicies when the cluster has a default-deny egress policy.
HindsightURL string
}
AgentDeploymentReconciler reconciles an AgentDeployment object.
func (*AgentDeploymentReconciler) Reconcile ¶
func (r *AgentDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile implements the reconciliation loop for AgentDeployment.
func (*AgentDeploymentReconciler) SetupWithManager ¶
func (r *AgentDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type AgentReconciler ¶
type AgentReconciler struct {
client.Client
Scheme *runtime.Scheme
CloudProvider security.CloudProvider
}
AgentReconciler reconciles a Agent object.
func (*AgentReconciler) SetupWithManager ¶
func (r *AgentReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type AgentRunReconciler ¶
type AgentRunReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
K8s kubernetes.Interface
Dynamic dynamic.Interface
ModelRouterImage string
StateConfig state.Config
StateStore state.Store
CloudProvider security.CloudProvider
// PostgresStore is the optional PostgreSQL archival store. When non-nil,
// terminal-phase AgentRuns are snapshotted here for long-term retention
// and historical querying by the UI.
PostgresStore *postgresql.Store
// TokenReviewerClusterRole is the name of the ClusterRole that grants
// "create tokenreviews" — injected at startup from the Helm release name.
// The agentrun controller binds each agent SA to this role so the
// model-router sidecar can call the TokenReview API.
TokenReviewerClusterRole string
// OperatorAPIURL is the base URL of the operator's internal API server,
// injected from the OPERATOR_API_URL env var. Written into every router
// ConfigMap so sidecars can call /agentrun endpoints for handoff and child runs.
// Example: "http://agent-orca-internal-api.agent-orca-system.svc.cluster.local:8082"
OperatorAPIURL string
// LLMRequestTimeout is the per-LLM-request timeout written into every router
// config (default 1h). Injected from the LLM_REQUEST_TIMEOUT env var.
LLMRequestTimeout time.Duration
// ContextCompactionRatio is the target fraction of the context window to
// compact the in-memory buffer down to when truncation fires (issue #54).
// Default 0.5 (50%); set to 0.1 for aggressive compaction to ~10%.
// Injected from the CONTEXT_COMPACTION_RATIO env var.
ContextCompactionRatio float64
// HindsightURL is the configured hindsight API endpoint (e.g. http://hindsight.local).
// Injected from the HINDSIGHT_URL env var. Used to generate ipBlock egress rules
// in the per-run NetworkPolicies when the cluster has a default-deny egress policy.
HindsightURL string
}
AgentRunReconciler reconciles a AgentRun object.
func (*AgentRunReconciler) SetupWithManager ¶
func (r *AgentRunReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type AgentWorkflowReconciler ¶
AgentWorkflowReconciler reconciles AgentWorkflow objects.
func (*AgentWorkflowReconciler) SetupWithManager ¶
func (r *AgentWorkflowReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller with the Manager.
type KnowledgeBaseReconciler ¶
type KnowledgeBaseReconciler struct {
client.Client
Scheme *runtime.Scheme
MCPIngesterImage string
QdrantImage string
}
KnowledgeBaseReconciler reconciles KnowledgeBase objects.
func (*KnowledgeBaseReconciler) SetupWithManager ¶
func (r *KnowledgeBaseReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller with the Manager.
type MCPServerReconciler ¶
MCPServerReconciler reconciles an MCPServer object. It generates one child Tool CR per declared tool in the MCPServer spec, and — for OAuth-only remote MCP servers — performs the OAuth token exchange itself (no sidecar) so the flow lives entirely in the MCPServer CR.
func (*MCPServerReconciler) SetupWithManager ¶
func (r *MCPServerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ModelProviderReconciler ¶
ModelProviderReconciler reconciles a ModelProvider object.
func (*ModelProviderReconciler) SetupWithManager ¶
func (r *ModelProviderReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ModelSelectorReconciler ¶
ModelSelectorReconciler reconciles a ModelSelector object
func (*ModelSelectorReconciler) Reconcile ¶
func (r *ModelSelectorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, 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 ModelSelector 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.23.1/pkg/reconcile
func (*ModelSelectorReconciler) SetupWithManager ¶
func (r *ModelSelectorReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type TenantConfigReconciler ¶
type TenantConfigReconciler struct {
client.Client
Scheme *runtime.Scheme
Refresher TenantRefresher
}
TenantConfigReconciler reconciles TenantConfig objects and keeps the external auth middleware's tenant cache up to date.
func (*TenantConfigReconciler) SetupWithManager ¶
func (r *TenantConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type TenantRefresher ¶
TenantRefresher is implemented by ExternalAuth to refresh the tenant cache.
type ToolReconciler ¶
ToolReconciler reconciles a Tool object.
func (*ToolReconciler) SetupWithManager ¶
func (r *ToolReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Source Files
¶
- agent_controller.go
- agentdeployment_controller.go
- agentrun_controller.go
- agentworkflow_controller.go
- authrouter_config.go
- helpers.go
- kb_mcp_ingest.go
- knowledgebase_controller.go
- mcp_resolve.go
- mcpserver_controller.go
- modelprovider_controller.go
- modelselector_controller.go
- parse_service_hostname.go
- qdrant_upgrade.go
- tenantconfig_controller.go
- tool_controller.go