Documentation ¶
Index ¶
Constants ¶
const MaxInt = int(MaxUint >> 1)
const MaxUint = ^uint(0)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector is a object that allows to interact with nomad worker
func New ¶ added in v0.0.10
New creates a new nomad worker connector. The profile represents the name of the aws profile that shall be used to access the resources to scale the aws AutoScalingGroup. This parameter is optional. If the profile is NOT set the instance where sokar runs on has to have enough permissions to access the resources (ASG) for scaling (e.g. granted by a AWS Instance Profile). In this case the region parameter has to be specified instead (via WithAwsRegion()).
func (*Connector) AdjustScalingObjectCount ¶ added in v0.0.9
func (c *Connector) AdjustScalingObjectCount(datacenter string, min uint, max uint, from uint, to uint) error
AdjustScalingObjectCount will scale the nomad workers to the desired count (amount of instances)
func (*Connector) GetScalingObjectCount ¶
GetScalingObjectCount will return the count of the nomad workers
func (*Connector) IsScalingObjectDead ¶
IsScalingObjectDead will return if the nomad workers of the actual data-center are still available.
type Nodes ¶ added in v0.0.9
type Nodes interface { List(q *nomadApi.QueryOptions) ([]*nomadApi.NodeListStub, *nomadApi.QueryMeta, error) ToggleEligibility(nodeID string, eligible bool, q *nomadApi.WriteOptions) (*nomadApi.NodeEligibilityUpdateResponse, error) UpdateDrain(nodeID string, spec *nomadApi.DrainSpec, markEligible bool, q *nomadApi.WriteOptions) (*nomadApi.NodeDrainUpdateResponse, error) MonitorDrain(ctx context.Context, nodeID string, index uint64, ignoreSys bool) <-chan *nomadApi.MonitorMessage Allocations(nodeID string, q *nomadApi.QueryOptions) ([]*nomadApi.Allocation, *nomadApi.QueryMeta, error) }
Nodes represents the minimal interface used to gather information about nomad nodes
type Option ¶ added in v0.0.10
type Option func(c *Connector)
Option represents an option for the nomadWorker Connector
func TimeoutForInstanceTermination ¶ added in v0.0.11
TimeoutForInstanceTermination sets the maximum time the instance termination will be monitored before assuming that this action failed.
func WithAwsRegion ¶ added in v0.0.10
WithAwsRegion sets the aws region in which the resource to be scaled can be found
func WithLogger ¶ added in v0.0.10
WithLogger adds a configured Logger to the nomadWorker Connector