workloadintentobserver

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package workloadintentobserver independently observes Kubernetes MCPServer CR conditions and raw Deployment readiness, reporting monotonic observer_epoch health transitions back to Platform API without mutating desired intent, execution receipts, or River jobs.

Index

Constants

View Source
const (
	ConditionDeploymentReady = "DeploymentReady"
	ConditionServiceReady    = "ServiceReady"
	ConditionIngressReady    = "IngressReady"
	ConditionGatewayReady    = "GatewayReady"
	ConditionPolicyReady     = "PolicyReady"
	ConditionCanaryReady     = "CanaryReady"
)

Operator condition types matching internal/operator/conditions.go.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterReader

type ClusterReader interface {
	GetMCPServer(ctx context.Context, namespace, name string) (*mcpv1alpha1.MCPServer, bool, error)
	GetDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, bool, error)
}

ClusterReader reads live Kubernetes MCPServer CRs and raw Deployments.

type Config

type Config struct {
	ClusterKey   string
	ObserverID   string
	PollInterval time.Duration
}

Config configures the independent status observer loop.

type KubeClusterReader

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

KubeClusterReader implements ClusterReader against Kubernetes dynamic and core clients.

func NewKubeClusterReader

func NewKubeClusterReader(dyn dynamic.Interface, cs kubernetes.Interface) *KubeClusterReader

NewKubeClusterReader constructs a Kubernetes-backed ClusterReader.

func (*KubeClusterReader) GetDeployment

func (r *KubeClusterReader) GetDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, bool, error)

func (*KubeClusterReader) GetMCPServer

func (r *KubeClusterReader) GetMCPServer(ctx context.Context, namespace, name string) (*mcpv1alpha1.MCPServer, bool, error)

type Observer

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

Observer evaluates live Kubernetes state for ServerIntents and DeploymentIntents and records health transitions fenced by observer_epoch.

func New

func New(platform PlatformClient, cluster ClusterReader, cfg Config) *Observer

New creates an Observer.

func (*Observer) Run

func (o *Observer) Run(ctx context.Context)

Run polls and reports workload observations until ctx is canceled.

func (*Observer) RunOnce

func (o *Observer) RunOnce(ctx context.Context) error

RunOnce performs one complete observation pass across servers and deployments.

type PlatformClient

type PlatformClient interface {
	ClaimWorkloadObserverLease(ctx context.Context, clusterKey, observerID string) (apikit.WorkloadObserverLeaseResponse, error)
	ListServerIntents(ctx context.Context) ([]apikit.ServerIntent, error)
	RecordServerIntentObservation(ctx context.Context, serverID string, req apikit.ServerIntentObservationRequest) (apikit.WorkloadStatusObservation, error)
	ListDeploymentIntents(ctx context.Context) ([]apikit.DeploymentIntent, error)
	RecordDeploymentIntentObservation(ctx context.Context, deploymentID string, req apikit.DeploymentIntentObservationRequest) (apikit.WorkloadStatusObservation, error)
}

PlatformClient defines the Platform API operations needed by Observer.

Jump to

Keyboard shortcuts

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