Documentation
¶
Index ¶
Constants ¶
const ( LabelKeyApp = "app" LabelKeyMCPServer = "mcp-server" )
Kubernetes label keys reserved and applied by the operator on managed workloads.
const ( ReconcilePhaseValidation = "validation" ReconcilePhaseDeployment = "deployment" ReconcilePhaseService = "service" ReconcilePhaseNetworkPolicy = "networkpolicy" )
ReconcilePhase is the value for the "phase" label on mcpserver_reconcile_phase_duration_seconds.
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.
const ( ReasonValid = "Valid" ReasonInvalid = "Invalid" ReasonUnknown = "Unknown" )
Reasons for Accepted condition.
const ( ReasonAvailable = "Available" ReasonConfigurationInvalid = "ConfigurationInvalid" ReasonScaledToZero = "ScaledToZero" ReasonInitializing = "Initializing" )
Reasons for Ready condition.
const ( WaitingReasonImagePullBackOff = "ImagePullBackOff" WaitingReasonErrImagePull = "ErrImagePull" WaitingReasonCrashLoopBackOff = "CrashLoopBackOff" WaitingReasonCreateContainerConfigError = "CreateContainerConfigError" )
Container waiting reasons from Kubernetes pod status.
const (
EventReasonCapabilityChanged = "CapabilityChanged"
)
Event-only reasons (not used as condition reasons).
const ManagedWorkloadName = "mcp-server"
ManagedWorkloadName is the standard app label value and name of the main container in operator-created Deployments.
const MetricReasonReconcileError = "ReconcileError"
MetricReasonReconcileError is the `reason` label on deployment/service failure counters when the corresponding reconcile step returns an error.
const (
TerminatedReasonOOMKilled = "OOMKilled"
)
Container terminated reasons from Kubernetes pod status.
Variables ¶
var ErrNilMap = errors.New("destination map not initialized")
var MCPClientVersion = "v0.1.0"
MCPClientVersion is the version sent during MCP handshake. Bump with releases.
Functions ¶
func CacheOptions ¶ added in v0.3.0
CacheOptions returns the manager cache configuration.
The controller watches Pods to surface container-level failure diagnostics (image pull failures, crash loops, OOM kills) on the Ready condition. Pods are the only object type where an unscoped informer would make memory scale with cluster size rather than with MCPServer count, so the informer is both:
- restricted server-side to pods this operator manages, via the presence of LabelKeyMCPServer, and
- trimmed to the fields the diagnostics actually read.
Tests should build their manager from this function rather than duplicating the configuration, otherwise they validate a copy instead of what production runs.
func IsOwnershipConflict ¶ added in v0.3.0
Types ¶
type MCPServerReconciler ¶
type MCPServerReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder events.EventRecorder
MCPDialer func(ctx context.Context, url string, transport *http.Transport) (*mcpv1alpha1.MCPServerInfo, error) // nil = use real MCP handshake
APIReader client.Reader
// TLSEnvVars holds TLS-related environment variables to propagate to every
// MCP server container. Populated at startup when PROPAGATE_TLS_ENV_VARS is set.
TLSEnvVars []corev1.EnvVar
// TLSProfile applies operator-wide TLS settings (min version, cipher suites)
// to outbound connections. Populated from TLS_MIN_VERSION / TLS_CIPHER_SUITES.
TLSProfile func(*tls.Config)
// contains filtered or unexported fields
}
MCPServerReconciler reconciles a MCPServer object
func (*MCPServerReconciler) Reconcile ¶
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 OwnershipConflictError ¶ added in v0.3.0
type OwnershipConflictError struct {
Message string
}
func (*OwnershipConflictError) Error ¶ added in v0.3.0
func (e *OwnershipConflictError) Error() string
type ValidationError ¶ added in v0.2.0
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
Source Files
¶
- audit.go
- cache.go
- constants.go
- custom_metadata.go
- mcpserver_controller.go
- mcpserver_controller_conditions.go
- mcpserver_controller_confighash.go
- mcpserver_controller_deployment.go
- mcpserver_controller_handshake.go
- mcpserver_controller_networkpolicy.go
- mcpserver_controller_ownership.go
- mcpserver_controller_service.go
- mcpserver_controller_tls.go
- mcpserver_controller_validation.go
- metrics.go