Documentation ¶
Index ¶
- Constants
- type Builder
- type CloudProvider
- func (c *CloudProvider) GetInstance(node *v1.Node) (cloudprovider.Instance, error)
- func (c *CloudProvider) GetNodeGroup(id string) (cloudprovider.NodeGroup, bool)
- func (c *CloudProvider) Name() string
- func (c *CloudProvider) NodeGroups() []cloudprovider.NodeGroup
- func (c *CloudProvider) Refresh() error
- func (c *CloudProvider) RegisterNodeGroups(groups ...cloudprovider.NodeGroupConfig) error
- type Instance
- type NodeGroup
- func (n *NodeGroup) Belongs(node *v1.Node) bool
- func (n *NodeGroup) DecreaseTargetSize(delta int64) error
- func (n *NodeGroup) DeleteNodes(nodes ...*v1.Node) error
- func (n *NodeGroup) ID() string
- func (n *NodeGroup) IncreaseSize(delta int64) error
- func (n *NodeGroup) MaxSize() int64
- func (n *NodeGroup) MinSize() int64
- func (n *NodeGroup) Name() string
- func (n *NodeGroup) Nodes() []string
- func (n *NodeGroup) Size() int64
- func (n *NodeGroup) String() string
- func (n *NodeGroup) TargetSize() int64
- type Opts
Constants ¶
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" )
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 ¶
func (b Builder) Build() (cloudprovider.CloudProvider, error)
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) InstantiationTime ¶ added in v1.3.0
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) DecreaseTargetSize ¶
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 ¶
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) IncreaseSize ¶
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) Name ¶ added in v1.9.0
Name returns the name of the node group for this cloud provider node group.
func (*NodeGroup) TargetSize ¶
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).