const (
// The prefix of all agent endpoints.
// Thus, the agent endpoints are reachable under "/agent/*"
ClusterAgentEndpointsPrefix = "agent"
// The endpoint name for committing a scheduling decision.
CommitSchedulingDecisionEndpoint = "scheduling-decision"
)
Default, orchestrator-independent implementation of the PolarisClusterAgent.
This service will expose a REST API at /agent/* All orchestrator-specific cluster interactions are handled by the clusterClient.
type DefaultPolarisClusterAgent struct {
// contains filtered or unexported fields
}
func NewDefaultPolarisClusterAgent(
clusterAgentConfig *config.ClusterAgentConfig,
ginEngine *gin.Engine,
clusterClient client.LocalClusterClient,
nodesCache client.NodesCache,
pluginRegistry *pipeline.PluginsRegistry[pipeline.ClusterAgentServices],
logger *logr.Logger,
) *DefaultPolarisClusterAgent
func (ca *DefaultPolarisClusterAgent) ClusterClient() client.LocalClusterClient
func (ca *DefaultPolarisClusterAgent) Config() *config.ClusterAgentConfig
func (ca *DefaultPolarisClusterAgent) Logger() *logr.Logger
func (ca *DefaultPolarisClusterAgent) NodesCache() client.NodesCache
func (ca *DefaultPolarisClusterAgent) Start(ctx context.Context) error
The cluster agent service is responsible for providing a remote polaris-scheduler access to the local cluster.
type PolarisClusterAgent interface {
pipeline.ClusterAgentServices
// Starts the cluster agent.
//
// The context can be used to stop the agent.
// Returns nil if the agent has started successfully.
Start(ctx context.Context) error
}
Encapsulates an error response from the PolarisClusterAgent
type PolarisClusterAgentError struct {
Error *client.PolarisErrorDto `json:"error" yaml:"error"`
}
ClusterClient implementation that connects via REST to a remote PolarisClusterAgent.
type RemoteClusterAgentClient struct {
// contains filtered or unexported fields
}
func NewRemoteClusterAgentClient(clusterName string, clusterConfig *config.RemoteClusterConfig, logger *logr.Logger) *RemoteClusterAgentClient
func (cbc *RemoteClusterAgentClient) ClusterName() string
func (cbc *RemoteClusterAgentClient) CommitSchedulingDecision(ctx context.Context, schedulingDecision *client.ClusterSchedulingDecision) (*client.CommitSchedulingDecisionSuccess, error)