Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAWS(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func BuildAwsCloudProvider(awsManager *AwsManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
- type AwsInstanceRef
- type AwsManager
- func (m *AwsManager) Cleanup()
- func (m *AwsManager) DeleteInstances(instances []*AwsInstanceRef) error
- func (m *AwsManager) GetAsgForInstance(instance AwsInstanceRef) *asg
- func (m *AwsManager) GetAsgNodes(ref AwsRef) ([]AwsInstanceRef, error)
- func (m *AwsManager) Refresh() error
- func (m *AwsManager) SetAsgSize(asg *asg, size int) error
- type AwsNodeGroup
- func (ng *AwsNodeGroup) Autoprovisioned() bool
- func (ng *AwsNodeGroup) Belongs(node *apiv1.Node) (bool, error)
- func (ng *AwsNodeGroup) Create() (cloudprovider.NodeGroup, error)
- func (ng *AwsNodeGroup) Debug() string
- func (ng *AwsNodeGroup) DecreaseTargetSize(delta int) error
- func (ng *AwsNodeGroup) Delete() error
- func (ng *AwsNodeGroup) DeleteNodes(nodes []*apiv1.Node) error
- func (ng *AwsNodeGroup) Exist() bool
- func (ng *AwsNodeGroup) Id() string
- func (ng *AwsNodeGroup) IncreaseSize(delta int) error
- func (ng *AwsNodeGroup) MaxSize() int
- func (ng *AwsNodeGroup) MinSize() int
- func (ng *AwsNodeGroup) Nodes() ([]cloudprovider.Instance, error)
- func (ng *AwsNodeGroup) TargetSize() (int, error)
- func (ng *AwsNodeGroup) TemplateNodeInfo() (*schedulernodeinfo.NodeInfo, error)
- type AwsRef
Constants ¶
const ( // ProviderName is the cloud provider name for AWS ProviderName = "aws" // GPULabel is the label added to nodes with GPU resource. GPULabel = "k8s.amazonaws.com/accelerator" )
Variables ¶
var InstanceTypes = map[string]*instanceType{}/* 220 elements not displayed */
InstanceTypes is a map of ec2 resources
Functions ¶
func BuildAWS ¶
func BuildAWS(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildAWS builds AWS cloud provider, manager etc.
func BuildAwsCloudProvider ¶
func BuildAwsCloudProvider(awsManager *AwsManager, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
BuildAwsCloudProvider builds CloudProvider implementation for AWS.
Types ¶
type AwsInstanceRef ¶
AwsInstanceRef contains a reference to an instance in the AWS world.
func AwsRefFromProviderId ¶
func AwsRefFromProviderId(id string) (*AwsInstanceRef, error)
AwsRefFromProviderId creates InstanceConfig object from provider id which must be in format: aws:///zone/name
type AwsManager ¶
type AwsManager struct {
// contains filtered or unexported fields
}
AwsManager is handles aws communication and data caching.
func CreateAwsManager ¶
func CreateAwsManager(configReader io.Reader, discoveryOpts cloudprovider.NodeGroupDiscoveryOptions) (*AwsManager, error)
CreateAwsManager constructs awsManager object.
func (*AwsManager) DeleteInstances ¶
func (m *AwsManager) DeleteInstances(instances []*AwsInstanceRef) error
DeleteInstances deletes the given instances. All instances must be controlled by the same ASG.
func (*AwsManager) GetAsgForInstance ¶
func (m *AwsManager) GetAsgForInstance(instance AwsInstanceRef) *asg
GetAsgForInstance returns AsgConfig of the given Instance
func (*AwsManager) GetAsgNodes ¶
func (m *AwsManager) GetAsgNodes(ref AwsRef) ([]AwsInstanceRef, error)
GetAsgNodes returns Asg nodes.
func (*AwsManager) Refresh ¶
func (m *AwsManager) Refresh() error
Refresh is called before every main loop and can be used to dynamically update cloud provider state. In particular the list of node groups returned by NodeGroups can change as a result of CloudProvider.Refresh().
func (*AwsManager) SetAsgSize ¶
func (m *AwsManager) SetAsgSize(asg *asg, size int) error
SetAsgSize sets ASG size.
type AwsNodeGroup ¶
type AwsNodeGroup struct {
// contains filtered or unexported fields
}
AwsNodeGroup implements NodeGroup interface.
func (*AwsNodeGroup) Autoprovisioned ¶
func (ng *AwsNodeGroup) Autoprovisioned() bool
Autoprovisioned returns true if the node group is autoprovisioned.
func (*AwsNodeGroup) Belongs ¶
func (ng *AwsNodeGroup) Belongs(node *apiv1.Node) (bool, error)
Belongs returns true if the given node belongs to the NodeGroup.
func (*AwsNodeGroup) Create ¶
func (ng *AwsNodeGroup) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side.
func (*AwsNodeGroup) Debug ¶
func (ng *AwsNodeGroup) Debug() string
Debug returns a debug string for the Asg.
func (*AwsNodeGroup) DecreaseTargetSize ¶
func (ng *AwsNodeGroup) DecreaseTargetSize(delta int) 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 if the size when there is an option to just decrease the target.
func (*AwsNodeGroup) Delete ¶
func (ng *AwsNodeGroup) Delete() error
Delete deletes the node group on the cloud provider side. This will be executed only for autoprovisioned node groups, once their size drops to 0.
func (*AwsNodeGroup) DeleteNodes ¶
func (ng *AwsNodeGroup) DeleteNodes(nodes []*apiv1.Node) error
DeleteNodes deletes the nodes from the group.
func (*AwsNodeGroup) Exist ¶
func (ng *AwsNodeGroup) Exist() bool
Exist checks if the node group really exists on the cloud provider side. Allows to tell the theoretical node group from the real one.
func (*AwsNodeGroup) IncreaseSize ¶
func (ng *AwsNodeGroup) IncreaseSize(delta int) error
IncreaseSize increases Asg size
func (*AwsNodeGroup) MaxSize ¶
func (ng *AwsNodeGroup) MaxSize() int
MaxSize returns maximum size of the node group.
func (*AwsNodeGroup) MinSize ¶
func (ng *AwsNodeGroup) MinSize() int
MinSize returns minimum size of the node group.
func (*AwsNodeGroup) Nodes ¶
func (ng *AwsNodeGroup) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group.
func (*AwsNodeGroup) TargetSize ¶
func (ng *AwsNodeGroup) TargetSize() (int, error)
TargetSize returns the current TARGET size of the node group. It is possible that the number is different from the number of nodes registered in Kubernetes.
func (*AwsNodeGroup) TemplateNodeInfo ¶
func (ng *AwsNodeGroup) TemplateNodeInfo() (*schedulernodeinfo.NodeInfo, error)
TemplateNodeInfo returns a node template for this node group.