aws

package
Version: v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName identifies this module as aws
	ProviderName = "aws"
	// LifecycleOnDemand string constant for On-Demand EC2 instances
	LifecycleOnDemand = "on-demand"
	// LifecycleSpot string constant for Spot EC2 instances
	LifecycleSpot = "spot"
)
View Source
const AssumeRoleNamePrefix = "atlassian-escalator"

AssumeRoleNamePrefix is the assume role session name prefix

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	ProviderOpts cloudprovider.BuildOpts
	Opts         Opts
}

Builder builds the aws cloud provider

func (Builder) Build

Build the cloud provider

type CloudProvider

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

CloudProvider providers an aws cloud provider implementation

func (*CloudProvider) GetInstance added in v1.3.0

func (c *CloudProvider) GetInstance(node *v1.Node) (cloudprovider.Instance, error)

GetInstance creates an Instance object through k8s Node object

func (*CloudProvider) GetNodeGroup

func (c *CloudProvider) GetNodeGroup(id string) (cloudprovider.NodeGroup, bool)

GetNodeGroup gets the node group from the cloud provider. Returns if it exists or not

func (*CloudProvider) Name

func (c *CloudProvider) Name() string

Name returns name of the cloud provider.

func (*CloudProvider) NodeGroups

func (c *CloudProvider) NodeGroups() []cloudprovider.NodeGroup

NodeGroups returns all node groups configured for this cloud provider.

func (*CloudProvider) Refresh

func (c *CloudProvider) Refresh() error

Refresh is called before every main loop and can be used to dynamically update cloud provider state.

func (*CloudProvider) RegisterNodeGroups

func (c *CloudProvider) RegisterNodeGroups(groups ...cloudprovider.NodeGroupConfig) error

RegisterNodeGroups adds the nodegroup to the list of nodes groups

type Instance added in v1.3.0

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

Instance includes base EC2 instance information

func (*Instance) ID added in v1.6.0

func (i *Instance) ID() string

ID return EC2 instance ID

func (*Instance) InstantiationTime added in v1.3.0

func (i *Instance) InstantiationTime() time.Time

InstantiationTime returns EC2 instance launch time

type NodeGroup

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

NodeGroup implements a aws nodegroup

func NewNodeGroup

func NewNodeGroup(config *cloudprovider.NodeGroupConfig, asg *autoscaling.Group, provider *CloudProvider) *NodeGroup

NewNodeGroup creates a new nodegroup from the aws group backing

func (*NodeGroup) Belongs

func (n *NodeGroup) Belongs(node *v1.Node) bool

Belongs determines if the node belongs in the current node group

func (*NodeGroup) DecreaseTargetSize

func (n *NodeGroup) DecreaseTargetSize(delta int64) error

DecreaseTargetSize decreases the target size of the node group. This function doesn't permit to delete any existing node and can be used only to reduce the request for new nodes that have not been yet fulfilled. Delta should be negative. It is assumed that cloud provider will not delete the existing nodes when there is an option to just decrease the target.

func (*NodeGroup) DeleteNodes

func (n *NodeGroup) DeleteNodes(nodes ...*v1.Node) error

DeleteNodes deletes nodes from this node group. Error is returned either on failure or if the given node doesn't belong to this node group. This function should wait until node group size is updated.

func (*NodeGroup) ID

func (n *NodeGroup) ID() string

ID returns an unique identifier of the node group.

func (*NodeGroup) IncreaseSize

func (n *NodeGroup) IncreaseSize(delta int64) error

IncreaseSize increases the size of the node group. To delete a node you need to explicitly name it and use DeleteNode. This function should wait until node group size is updated.

func (*NodeGroup) MaxSize

func (n *NodeGroup) MaxSize() int64

MaxSize returns maximum size of the node group.

func (*NodeGroup) MinSize

func (n *NodeGroup) MinSize() int64

MinSize returns minimum size of the node group.

func (*NodeGroup) Name added in v1.9.0

func (n *NodeGroup) Name() string

Name returns the name of the node group for this cloud provider node group.

func (*NodeGroup) Nodes

func (n *NodeGroup) Nodes() []string

Nodes returns a list of all nodes that belong to this node group.

func (*NodeGroup) Size

func (n *NodeGroup) Size() int64

Size is the number of instances in the nodegroup at the current time

func (*NodeGroup) String

func (n *NodeGroup) String() string

func (*NodeGroup) TargetSize

func (n *NodeGroup) TargetSize() int64

TargetSize returns the current target size of the node group. It is possible that the number of nodes in Kubernetes is different at the moment but should be equal to Size() once everything stabilizes (new nodes finish startup and registration or removed nodes are deleted completely).

type Opts

type Opts struct {
	AssumeRoleARN string
}

Opts includes options for AWS cloud provider

Jump to

Keyboard shortcuts

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