Documentation ¶
Index ¶
- func GetAgentConnection(ag *v1alpha1.Agent) (*grpc.ClientConn, error)
- type Controller
- func (a *Controller) Agent(name string) *v1alpha1.Agent
- func (a *Controller) AgentConnection(agent string) *grpc.ClientConn
- func (a *Controller) BlacklistedAgents() []string
- func (a *Controller) Configure()
- func (a *Controller) ControllerFunc(_ctx context.Context, ag *v1alpha1.Agent) error
- func (a *Controller) GetActiveAgentsWithInfo() map[string]*v1alpha1.Agent
- func (a *Controller) GetAllActiveAgents() []string
- func (a *Controller) GetAllAgentsWithInfo() map[string]*v1alpha1.Agent
- func (a *Controller) GetBlacklistedAgentsWithInfo() map[string]*v1alpha1.Agent
- func (a *Controller) Name() string
- func (a *Controller) Run() error
- func (a *Controller) Stop() error
- func (a *Controller) Type() string
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAgentConnection ¶
func GetAgentConnection(ag *v1alpha1.Agent) (*grpc.ClientConn, error)
GetAgentConnection returns a GRPC connection corresponding to the provided Agent manifest.
Types ¶
type Controller ¶
type Controller struct { // Manager is the controller manager for all the running controller // against agent manager. Manager *controller.Manager // Nodes contains the agent associated with the controller. // Each of these agents are managed by the agent controller using a global // controller manager Nodes map[string]Node // contains filtered or unexported fields }
Controller corresponds to the agent controller managed by apiserver.
var AgentCtrl *Controller = NewController()
AgentCtrl is the global instance of the agent controller running for the API server.
func NewController ¶
func NewController() *Controller
NewController returns a new agent controller manager which manages all the agents running for the API server.
func (*Controller) Agent ¶
func (a *Controller) Agent(name string) *v1alpha1.Agent
Agent returns the agent manifest of the provided name
func (*Controller) AgentConnection ¶
func (a *Controller) AgentConnection(agent string) *grpc.ClientConn
AgentConnection returns the grpc connection for the agent.
func (*Controller) BlacklistedAgents ¶
func (a *Controller) BlacklistedAgents() []string
BlacklistedAgents returns a list of agent nodes which are blacklisted by the agent controller
func (*Controller) Configure ¶
func (a *Controller) Configure()
Configure sets up the Agent controller and all its required components.
func (*Controller) ControllerFunc ¶
ControllerFunc is the function which runs for each agent connected to the Api server and deals with it's management.
func (*Controller) GetActiveAgentsWithInfo ¶
func (a *Controller) GetActiveAgentsWithInfo() map[string]*v1alpha1.Agent
GetActiveAgentsWithInfo returns a list with info of all active agents not including blacklisted.
func (*Controller) GetAllActiveAgents ¶
func (a *Controller) GetAllActiveAgents() []string
GetAllActiveAgents returns all the agent which are not blacklisted.
func (*Controller) GetAllAgentsWithInfo ¶
func (a *Controller) GetAllAgentsWithInfo() map[string]*v1alpha1.Agent
GetAllAgentsWithInfo returns a list with info of all the agents including blacklisted.
func (*Controller) GetBlacklistedAgentsWithInfo ¶
func (a *Controller) GetBlacklistedAgentsWithInfo() map[string]*v1alpha1.Agent
GetBlacklistedAgentsWithInfo returns a list with info of all the blacklisted agents
func (*Controller) Name ¶
func (a *Controller) Name() string
Name returns the name of the agent controller, it is completely defined by the name of the underlying store controller.
func (*Controller) Type ¶
func (a *Controller) Type() string
Type returns the type of controller configured, for agent this is agent.
type Node ¶
Node represents a single Agent object
func (*Node) CheckHealth ¶
CheckHealth checks for the health status of the provided agent in context. If the agent is not healthy or there is some issue with the connectivity the function returns an error.