controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelKeyApp       = "app"
	LabelKeyMCPServer = "mcp-server"
)

Kubernetes label keys reserved and applied by the operator on managed workloads.

View Source
const (
	ReconcilePhaseValidation = "validation"
	ReconcilePhaseDeployment = "deployment"
	ReconcilePhaseService    = "service"
)

ReconcilePhase is the value for the "phase" label on mcpserver_reconcile_phase_duration_seconds.

View Source
const (
	// ConditionTypeAccepted indicates the MCPServer configuration is valid.
	ConditionTypeAccepted = "Accepted"
	// ConditionTypeReady indicates the MCPServer is ready to serve requests.
	ConditionTypeReady = "Ready"
)

Condition types for MCPServer status.

View Source
const (
	ReasonValid   = "Valid"
	ReasonInvalid = "Invalid"
	ReasonUnknown = "Unknown"
)

Reasons for Accepted condition.

View Source
const (
	ReasonAvailable              = "Available"
	ReasonConfigurationInvalid   = "ConfigurationInvalid"
	ReasonDeploymentUnavailable  = "DeploymentUnavailable"
	ReasonServiceUnavailable     = "ServiceUnavailable"
	ReasonScaledToZero           = "ScaledToZero"
	ReasonInitializing           = "Initializing"
	ReasonMCPEndpointUnavailable = "MCPEndpointUnavailable"
)

Reasons for Ready condition.

View Source
const (
	WaitingReasonImagePullBackOff           = "ImagePullBackOff"
	WaitingReasonErrImagePull               = "ErrImagePull"
	WaitingReasonCrashLoopBackOff           = "CrashLoopBackOff"
	WaitingReasonCreateContainerConfigError = "CreateContainerConfigError"
)

Container waiting reasons from Kubernetes pod status.

View Source
const ManagedWorkloadName = "mcp-server"

ManagedWorkloadName is the standard app label value and name of the main container in operator-created Deployments.

View Source
const MetricReasonReconcileError = "ReconcileError"

MetricReasonReconcileError is the `reason` label on deployment/service failure counters when the corresponding reconcile step returns an error.

View Source
const (
	TerminatedReasonOOMKilled = "OOMKilled"
)

Container terminated reasons from Kubernetes pod status.

Variables

View Source
var ErrNilMap = errors.New("destination map not initialized")
View Source
var MCPClientVersion = "v0.1.0"

MCPClientVersion is the version sent during MCP handshake. Bump with releases.

Functions

This section is empty.

Types

type MCPServerReconciler

type MCPServerReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Recorder  events.EventRecorder
	MCPDialer func(ctx context.Context, url string) (*mcpv1alpha1.MCPServerInfo, error) // nil = use real MCP handshake
	APIReader client.Reader
}

MCPServerReconciler reconciles a MCPServer object

func (*MCPServerReconciler) Reconcile

func (r *MCPServerReconciler) 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.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.23.1/pkg/reconcile

func (*MCPServerReconciler) SetupWithManager

func (r *MCPServerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ValidationError added in v0.2.0

type ValidationError struct {
	Reason  string
	Message string
}

ValidationError represents a permanent configuration validation error. These errors indicate the MCPServer configuration is invalid and should not be retried.

func (*ValidationError) Error added in v0.2.0

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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