Documentation ¶
Index ¶
- Constants
- func BuildAliCloudProvider(manager *AliCloudManager, ...) (cloudprovider.CloudProvider, error)
- func BuildAlicloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- type AliCloudManager
- func (m *AliCloudManager) DeleteInstances(instanceIds []string) error
- func (m *AliCloudManager) GetAsgForInstance(instanceId string) (*Asg, error)
- func (m *AliCloudManager) GetAsgNodes(sg *Asg) ([]string, error)
- func (m *AliCloudManager) GetAsgSize(asgConfig *Asg) (int64, error)
- func (m *AliCloudManager) RegisterAsg(asg *Asg)
- func (m *AliCloudManager) SetAsgSize(asg *Asg, size int64) error
- type AliRef
- type Asg
- func (asg *Asg) AtomicIncreaseSize(delta int) error
- func (asg *Asg) Autoprovisioned() bool
- func (asg *Asg) Belongs(node *apiv1.Node) (bool, error)
- func (asg *Asg) Create() (cloudprovider.NodeGroup, error)
- func (asg *Asg) Debug() string
- func (asg *Asg) DecreaseTargetSize(delta int) error
- func (asg *Asg) Delete() error
- func (asg *Asg) DeleteNodes(nodes []*apiv1.Node) error
- func (asg *Asg) Exist() bool
- func (asg *Asg) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (asg *Asg) Id() string
- func (asg *Asg) IncreaseSize(delta int) error
- func (asg *Asg) MaxSize() int
- func (asg *Asg) MinSize() int
- func (asg *Asg) Nodes() ([]cloudprovider.Instance, error)
- func (asg *Asg) RegionId() string
- func (asg *Asg) TargetSize() (int, error)
- func (asg *Asg) TemplateNodeInfo() (*framework.NodeInfo, error)
Constants ¶
const (
// GPULabel is the label added to nodes with GPU resource.
GPULabel = "aliyun.accelerator/nvidia_name"
)
const ( //ResourceGPU GPU resource type ResourceGPU apiv1.ResourceName = "nvidia.com/gpu" )
Variables ¶
This section is empty.
Functions ¶
func BuildAliCloudProvider ¶
func BuildAliCloudProvider(manager *AliCloudManager, discoveryOpts cloudprovider.NodeGroupDiscoveryOptions, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
BuildAliCloudProvider builds CloudProvider implementation for AliCloud.
func BuildAlicloud ¶
func BuildAlicloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildAlicloud returns alicloud provider
Types ¶
type AliCloudManager ¶
type AliCloudManager struct {
// contains filtered or unexported fields
}
AliCloudManager handles alicloud service communication.
func CreateAliCloudManager ¶
func CreateAliCloudManager(configReader io.Reader) (*AliCloudManager, error)
CreateAliCloudManager constructs aliCloudManager object.
func (*AliCloudManager) DeleteInstances ¶
func (m *AliCloudManager) DeleteInstances(instanceIds []string) error
DeleteInstances deletes the given instances. All instances must be controlled by the same ASG.
func (*AliCloudManager) GetAsgForInstance ¶
func (m *AliCloudManager) GetAsgForInstance(instanceId string) (*Asg, error)
GetAsgForInstance returns AsgConfig of the given Instance
func (*AliCloudManager) GetAsgNodes ¶
func (m *AliCloudManager) GetAsgNodes(sg *Asg) ([]string, error)
GetAsgNodes returns Asg nodes.
func (*AliCloudManager) GetAsgSize ¶
func (m *AliCloudManager) GetAsgSize(asgConfig *Asg) (int64, error)
GetAsgSize gets ASG size.
func (*AliCloudManager) RegisterAsg ¶
func (m *AliCloudManager) RegisterAsg(asg *Asg)
RegisterAsg registers asg in AliCloud Manager.
func (*AliCloudManager) SetAsgSize ¶
func (m *AliCloudManager) SetAsgSize(asg *Asg, size int64) error
SetAsgSize sets ASG size.
type Asg ¶
type Asg struct {
// contains filtered or unexported fields
}
Asg implements NodeGroup interface.
func (*Asg) AtomicIncreaseSize ¶
AtomicIncreaseSize is not implemented.
func (*Asg) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned.
func (*Asg) Create ¶
func (asg *Asg) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side.
func (*Asg) 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 if the size when there is an option to just decrease the target.
func (*Asg) Delete ¶
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 (*Asg) DeleteNodes ¶
DeleteNodes deletes the nodes from the group.
func (*Asg) Exist ¶
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 (*Asg) GetOptions ¶
func (asg *Asg) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular NodeGroup. Returning a nil will result in using default options.
func (*Asg) IncreaseSize ¶
IncreaseSize increases Asg size
func (*Asg) Nodes ¶
func (asg *Asg) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group.
func (*Asg) TargetSize ¶
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.