Documentation ¶
Index ¶
- func BuildVolcengine(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func StringSliceInGroupsOf(arr []string, num int64) [][]string
- 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) TargetSize() (int, error)
- func (asg *AutoScalingGroup) TemplateNodeInfo() (*framework.NodeInfo, error)
- type AutoScalingService
- type EcsService
- type VolcengineManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVolcengine ¶
func BuildVolcengine(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildVolcengine builds CloudProvider implementation for Volcengine
func StringSliceInGroupsOf ¶
StringSliceInGroupsOf split arr into num parts
Types ¶
type AutoScalingGroup ¶
type AutoScalingGroup struct {
// contains filtered or unexported fields
}
AutoScalingGroup represents a Volcengine '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.
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. Implementation optional.
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) 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.
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 { GetScalingGroupById(groupId string) (*autoscaling.ScalingGroupForDescribeScalingGroupsOutput, error) ListScalingInstancesByGroupId(groupId string) ([]*autoscaling.ScalingInstanceForDescribeScalingInstancesOutput, error) GetScalingConfigurationById(configurationId string) (*autoscaling.ScalingConfigurationForDescribeScalingConfigurationsOutput, error) RemoveInstances(groupId string, instanceIds []string) error SetAsgTargetSize(groupId string, targetSize int) error SetAsgDesireCapacity(groupId string, desireCapacity int) error }
AutoScalingService is the interface for volcengine auto-scaling service
type EcsService ¶
type EcsService interface {
GetInstanceTypeById(instanceTypeId string) (*ecs.InstanceTypeForDescribeInstanceTypesOutput, error)
}
EcsService represents the ECS interfaces
type VolcengineManager ¶
type VolcengineManager interface { // RegisterAsg registers the given ASG with the manager. RegisterAsg(asg *AutoScalingGroup) // GetAsgForInstance returns the ASG of the given instance. GetAsgForInstance(instanceId string) (*AutoScalingGroup, error) // GetAsgById returns the ASG of the given id. GetAsgById(id string) (*AutoScalingGroup, error) // GetAsgDesireCapacity returns the desired capacity of the given ASG. GetAsgDesireCapacity(asgId string) (int, error) // SetAsgTargetSize sets the target size of the given ASG. SetAsgTargetSize(asgId string, targetSize int) error // DeleteScalingInstances deletes the given instances from the given ASG. DeleteScalingInstances(asgId string, instanceIds []string) error // GetAsgNodes returns the scaling instance ids of the given ASG. GetAsgNodes(asgId string) ([]cloudprovider.Instance, error) // SetAsgDesireCapacity sets the desired capacity of the given ASG. SetAsgDesireCapacity(groupId string, desireCapacity int) error // contains filtered or unexported methods }
VolcengineManager define the interface that implements Cloud Provider and Node Group
func CreateVolcengineManager ¶
func CreateVolcengineManager(cloudConfig *cloudConfig) (VolcengineManager, error)
CreateVolcengineManager returns the VolcengineManager interface implementation
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
volc-sdk-golang
|
|
volcengine-go-sdk
|
|
private/protocol/json/jsonutil
Package jsonutil provides JSON serialization of VOLCSTACK requests and responses.
|
Package jsonutil provides JSON serialization of VOLCSTACK requests and responses. |
private/protocol/query
Package query provides serialization of VOLCSTACK volcenginequery requests, and responses.
|
Package query provides serialization of VOLCSTACK volcenginequery requests, and responses. |
private/protocol/rest
Package rest provides RESTFUL serialization of VOLCSTACK requests and responses.
|
Package rest provides RESTFUL serialization of VOLCSTACK requests and responses. |
private/protocol/xml/xmlutil
Package xmlutil Package xml util provides XML serialization of VOLCSTACK requests and responses.
|
Package xmlutil Package xml util provides XML serialization of VOLCSTACK requests and responses. |
service/autoscaling
Package autoscalingiface provides an interface to enable mocking the AUTO_SCALING service client for testing your code.
|
Package autoscalingiface provides an interface to enable mocking the AUTO_SCALING service client for testing your code. |
service/ecs
Package ecsiface provides an interface to enable mocking the ECS service client for testing your code.
|
Package ecsiface provides an interface to enable mocking the ECS service client for testing your code. |
volcengine
Package volcengine provides core functionality for making requests to volcengine services.
|
Package volcengine provides core functionality for making requests to volcengine services. |
volcengine/credentials
Package credentials provides credential retrieval and management
|
Package credentials provides credential retrieval and management |
volcengine/defaults
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
|
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers. |
volcengine/volcengineerr
Package volcengineerr represents API error interface accessors for the SDK.
|
Package volcengineerr represents API error interface accessors for the SDK. |