controlplane

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

MCPServerGVR is the dynamic-client resource identity for MCPServer objects.

Functions

func DeploymentDesiredReplicas

func DeploymentDesiredReplicas(d appsv1.Deployment, defaultReplicas int32) int32

DeploymentDesiredReplicas returns the desired replica count, using defaultReplicas when the Deployment does not set spec.replicas.

func DeploymentReady

func DeploymentReady(d appsv1.Deployment, defaultReplicas int32) bool

DeploymentReady reports whether the Deployment has the desired number of ready replicas.

func PublicMCPEndpoint

func PublicMCPEndpoint(mcpServer mcpv1alpha1.MCPServer) string

PublicMCPEndpoint returns the public MCP endpoint path or URL for a server. The operator publishes the canonical URL in status.url, derived with the same scheme, host, and path rules the ingress and gateway use; that value wins. The fallback covers servers the operator has not reconciled yet.

Types

type ListServersOptions

type ListServersOptions struct {
	LabelSelector        string
	SkipDeploymentStatus bool
}

type ListServersResult

type ListServersResult struct {
	Servers                []ServerInfo
	CRDError               error
	UsedDeploymentFallback bool
}

ListServersResult contains MCPServer summaries and metadata about fallback behavior used while reading them.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager reads and mutates MCP Runtime control-plane resources in Kubernetes.

func New

func New(clients *k8sclient.Clients) *Manager

New creates a control-plane manager backed by Kubernetes clients.

func (*Manager) ApplyServer

func (m *Manager) ApplyServer(ctx context.Context, server *mcpv1alpha1.MCPServer) (*mcpv1alpha1.MCPServer, error)

ApplyServer creates or updates an MCPServer resource.

func (*Manager) DeleteServer

func (m *Manager) DeleteServer(ctx context.Context, namespace, name string) error

DeleteServer deletes one MCPServer resource.

func (*Manager) GetServer

func (m *Manager) GetServer(ctx context.Context, namespace, name string) (*mcpv1alpha1.MCPServer, error)

GetServer retrieves one MCPServer resource.

func (*Manager) GetServerInfo

func (m *Manager) GetServerInfo(ctx context.Context, namespace, name string) (ServerInfo, error)

GetServerInfo retrieves one MCPServer and joins it with its backing Deployment readiness when the Deployment is available.

func (*Manager) ListServers

func (m *Manager) ListServers(ctx context.Context, namespace string) (ListServersResult, error)

ListServers lists MCPServer resources in namespace and joins them with the readiness of their stable backing Deployments. If the MCPServer resource is unavailable, it falls back to legacy managed Deployments.

func (*Manager) ListServersWithOptions

func (m *Manager) ListServersWithOptions(ctx context.Context, namespace string, opts ListServersOptions) (ListServersResult, error)

ListServersWithOptions lists MCPServer resources in namespace using optional Kubernetes list filters.

type ServerDeploymentStatus

type ServerDeploymentStatus struct {
	Ready  string
	Status string
}

ServerDeploymentStatus summarizes readiness for the Deployment that backs an MCPServer.

func StatusForDeployment

func StatusForDeployment(d appsv1.Deployment) ServerDeploymentStatus

StatusForDeployment summarizes Deployment readiness in the format used by runtime server listings.

type ServerInfo

type ServerInfo struct {
	Name           string                      `json:"name"`
	Namespace      string                      `json:"namespace"`
	UID            string                      `json:"uid,omitempty"`
	TeamID         string                      `json:"team_id,omitempty"`
	Image          string                      `json:"image,omitempty"`
	ImageTag       string                      `json:"imageTag,omitempty"`
	Description    string                      `json:"description,omitempty"`
	Ready          string                      `json:"ready"`
	Status         string                      `json:"status"`
	Labels         map[string]string           `json:"labels,omitempty"`
	Age            string                      `json:"age"`
	Endpoint       string                      `json:"endpoint,omitempty"`
	GatewayEnabled bool                        `json:"-"`
	ServicePort    int32                       `json:"servicePort,omitempty"`
	Generation     int64                       `json:"generation,omitempty"`
	Tools          []mcpv1alpha1.ToolConfig    `json:"tools,omitempty"`
	Prompts        []mcpv1alpha1.InventoryItem `json:"prompts"`
	Resources      []mcpv1alpha1.InventoryItem `json:"resources"`
	Tasks          []mcpv1alpha1.InventoryItem `json:"tasks"`
}

ServerInfo is the control-plane projection of an MCPServer and its backing workload status.

func ServerInfoFromMCPServer

func ServerInfoFromMCPServer(mcpServer mcpv1alpha1.MCPServer, deploymentStatus ServerDeploymentStatus) ServerInfo

ServerInfoFromMCPServer projects an MCPServer plus optional Deployment status into the control-plane server summary shape.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL