Documentation ¶
Index ¶
- Constants
- func BuildHuaweiCloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- type AutoScalingGroup
- func (asg *AutoScalingGroup) AtomicIncreaseSize(delta int) error
- func (asg *AutoScalingGroup) Autoprovisioned() bool
- func (asg *AutoScalingGroup) Create() (cloudprovider.NodeGroup, error)
- func (asg *AutoScalingGroup) Debug() string
- func (asg *AutoScalingGroup) DecreaseTargetSize(delta int) error
- func (asg *AutoScalingGroup) Delete() error
- func (asg *AutoScalingGroup) DeleteNodes(nodes []*apiv1.Node) error
- func (asg *AutoScalingGroup) Exist() bool
- func (asg *AutoScalingGroup) ForceDeleteNodes(nodes []*apiv1.Node) error
- func (asg *AutoScalingGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (asg *AutoScalingGroup) Id() string
- func (asg *AutoScalingGroup) IncreaseSize(delta int) error
- func (asg *AutoScalingGroup) MaxSize() int
- func (asg *AutoScalingGroup) MinSize() int
- func (asg *AutoScalingGroup) Nodes() ([]cloudprovider.Instance, error)
- func (asg *AutoScalingGroup) String() string
- func (asg *AutoScalingGroup) TargetSize() (int, error)
- func (asg *AutoScalingGroup) TemplateNodeInfo() (*framework.NodeInfo, error)
- type AutoScalingService
- type CloudConfig
- type CloudServiceManager
- type ElasticCloudServerService
Constants ¶
const (
// GPULabel is the label added to nodes with GPU resource.
GPULabel = "cloud.google.com/gke-accelerator"
)
Variables ¶
This section is empty.
Functions ¶
func BuildHuaweiCloud ¶
func BuildHuaweiCloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildHuaweiCloud is called by the autoscaler/cluster-autoscaler/builder to build a huaweicloud cloud provider.
Types ¶
type AutoScalingGroup ¶
type AutoScalingGroup struct {
// contains filtered or unexported fields
}
AutoScalingGroup represents a HuaweiCloud's 'Auto Scaling Group' which also can be treated as a node group.
func (*AutoScalingGroup) AtomicIncreaseSize ¶
func (asg *AutoScalingGroup) AtomicIncreaseSize(delta int) error
AtomicIncreaseSize is not implemented.
func (*AutoScalingGroup) Autoprovisioned ¶
func (asg *AutoScalingGroup) Autoprovisioned() bool
Autoprovisioned returns true if the node group is autoprovisioned. An autoprovisioned group was created by CA and can be deleted when scaled to 0.
Always return false because the node group should maintained by user.
func (*AutoScalingGroup) Create ¶
func (asg *AutoScalingGroup) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side. Implementation optional.
func (*AutoScalingGroup) Debug ¶
func (asg *AutoScalingGroup) Debug() string
Debug returns a string containing all information regarding this node group.
func (*AutoScalingGroup) DecreaseTargetSize ¶
func (asg *AutoScalingGroup) 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 when there is an option to just decrease the target. Implementation required.
func (*AutoScalingGroup) Delete ¶
func (asg *AutoScalingGroup) 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. Implementation optional.
func (*AutoScalingGroup) DeleteNodes ¶
func (asg *AutoScalingGroup) DeleteNodes(nodes []*apiv1.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. Implementation required.
func (*AutoScalingGroup) Exist ¶
func (asg *AutoScalingGroup) 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. Implementation required.
func (*AutoScalingGroup) ForceDeleteNodes ¶
func (asg *AutoScalingGroup) ForceDeleteNodes(nodes []*apiv1.Node) error
ForceDeleteNodes deletes nodes from the group regardless of constraints.
func (*AutoScalingGroup) GetOptions ¶
func (asg *AutoScalingGroup) 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 (*AutoScalingGroup) Id ¶
func (asg *AutoScalingGroup) Id() string
Id returns an unique identifier of the node group.
func (*AutoScalingGroup) IncreaseSize ¶
func (asg *AutoScalingGroup) IncreaseSize(delta int) 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. Implementation required.
func (*AutoScalingGroup) MaxSize ¶
func (asg *AutoScalingGroup) MaxSize() int
MaxSize returns maximum size of the node group.
func (*AutoScalingGroup) MinSize ¶
func (asg *AutoScalingGroup) MinSize() int
MinSize returns minimum size of the node group.
func (*AutoScalingGroup) Nodes ¶
func (asg *AutoScalingGroup) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group. It is required that Instance objects returned by this method have Id field set. Other fields are optional. This list should include also instances that might have not become a kubernetes node yet.
func (*AutoScalingGroup) String ¶
func (asg *AutoScalingGroup) String() string
String dumps current groups meta data.
func (*AutoScalingGroup) TargetSize ¶
func (asg *AutoScalingGroup) TargetSize() (int, error)
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). Implementation required.
Target size is desire instance number of the auto scaling group, and not equal to current instance number if the auto scaling group is in increasing or decreasing process.
func (*AutoScalingGroup) TemplateNodeInfo ¶
func (asg *AutoScalingGroup) TemplateNodeInfo() (*framework.NodeInfo, error)
TemplateNodeInfo returns a framework.NodeInfo structure of an empty (as if just started) node. This will be used in scale-up simulations to predict what would a new node look like if a node group was expanded. The returned NodeInfo is expected to have a fully populated Node object, with all of the labels, capacity and allocatable information as well as all pods that are started on the node by default, using manifest (most likely only kube-proxy). Implementation optional.
type AutoScalingService ¶
type AutoScalingService interface { // ListScalingGroups list all scaling groups. ListScalingGroups() ([]AutoScalingGroup, error) // GetDesireInstanceNumber gets the desire instance number of specific auto scaling group. GetDesireInstanceNumber(groupID string) (int, error) // GetInstances gets the instances in an auto scaling group. GetInstances(groupID string) ([]cloudprovider.Instance, error) // IncreaseSizeInstance increases the instance number of specific auto scaling group. // The delta should be non-negative. // IncreaseSizeInstance wait until instance number is updated. IncreaseSizeInstance(groupID string, delta int) error // GetAsgForInstance returns auto scaling group for the given instance. GetAsgForInstance(instanceID string) (*AutoScalingGroup, error) // RegisterAsg registers auto scaling group to manager RegisterAsg(asg *AutoScalingGroup) // DeleteScalingInstances is used to delete instances from auto scaling group by instanceIDs. DeleteScalingInstances(groupID string, instanceIds []string) error // contains filtered or unexported methods }
AutoScalingService represents the auto scaling service interfaces. It should contains all request against auto scaling service.
type CloudConfig ¶
type CloudConfig struct { Global struct { ECSEndpoint string `gcfg:"ecs-endpoint"` ASEndpoint string `gcfg:"as-endpoint"` ProjectID string `gcfg:"project-id"` AccessKey string `gcfg:"access-key"` SecretKey string `gcfg:"secret-key"` } }
CloudConfig is the cloud config file for huaweicloud.
type CloudServiceManager ¶
type CloudServiceManager interface { // ElasticCloudServerService represents the elastic cloud server interfaces. ElasticCloudServerService // AutoScalingService represents the auto scaling service interfaces. AutoScalingService }
CloudServiceManager represents the cloud service interfaces. It should contains all requests against cloud services.
type ElasticCloudServerService ¶
type ElasticCloudServerService interface { // DeleteServers deletes a group of server by ID. DeleteServers(serverIDs []string) error }
ElasticCloudServerService represents the elastic cloud server interfaces. It should contains all request against elastic cloud server service.