...

Package clusteragent

import "framework/clusteragent"
Overview
Index

Overview ▾

Constants

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"
)

type DefaultPolarisClusterAgent

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

func NewDefaultPolarisClusterAgent(
    clusterAgentConfig *config.ClusterAgentConfig,
    ginEngine *gin.Engine,
    clusterClient client.LocalClusterClient,
    nodesCache client.NodesCache,
    pluginRegistry *pipeline.PluginsRegistry[pipeline.ClusterAgentServices],
    logger *logr.Logger,
) *DefaultPolarisClusterAgent

func (*DefaultPolarisClusterAgent) ClusterClient

func (ca *DefaultPolarisClusterAgent) ClusterClient() client.LocalClusterClient

func (*DefaultPolarisClusterAgent) Config

func (ca *DefaultPolarisClusterAgent) Config() *config.ClusterAgentConfig

func (*DefaultPolarisClusterAgent) Logger

func (ca *DefaultPolarisClusterAgent) Logger() *logr.Logger

func (*DefaultPolarisClusterAgent) NodesCache

func (ca *DefaultPolarisClusterAgent) NodesCache() client.NodesCache

func (*DefaultPolarisClusterAgent) Start

func (ca *DefaultPolarisClusterAgent) Start(ctx context.Context) error

type PolarisClusterAgent

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
}

type PolarisClusterAgentError

Encapsulates an error response from the PolarisClusterAgent

type PolarisClusterAgentError struct {
    Error *client.PolarisErrorDto `json:"error" yaml:"error"`
}

type RemoteClusterAgentClient

ClusterClient implementation that connects via REST to a remote PolarisClusterAgent.

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

func NewRemoteClusterAgentClient

func NewRemoteClusterAgentClient(clusterName string, clusterConfig *config.RemoteClusterConfig, logger *logr.Logger) *RemoteClusterAgentClient

func (*RemoteClusterAgentClient) ClusterName

func (cbc *RemoteClusterAgentClient) ClusterName() string

func (*RemoteClusterAgentClient) CommitSchedulingDecision

func (cbc *RemoteClusterAgentClient) CommitSchedulingDecision(ctx context.Context, schedulingDecision *client.ClusterSchedulingDecision) (*client.CommitSchedulingDecisionSuccess, error)