Documentation ¶
Index ¶
- Constants
- func BuildBaiducloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func BuildBaiducloudCloudProvider(manager *BaiducloudManager, ...) (cloudprovider.CloudProvider, error)
- type Asg
- func (asg *Asg) Autoprovisioned() bool
- 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) 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) TargetSize() (int, error)
- func (asg *Asg) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
- type BaiducloudManager
- func (m *BaiducloudManager) GetAsgForInstance(instance *BaiducloudRef) (*Asg, error)
- func (m *BaiducloudManager) GetAsgNodes(asg *Asg) ([]string, error)
- func (m *BaiducloudManager) GetAsgSize(asg *Asg) (int64, error)
- func (m *BaiducloudManager) RegisterAsg(asg *Asg)
- func (m *BaiducloudManager) ScaleDownCluster(instances []string) error
- func (m *BaiducloudManager) ScaleUpCluster(delta int) error
- type BaiducloudRef
- type CloudConfig
Constants ¶
const (
// CceUserAgent is prefix of http header UserAgent
CceUserAgent = "cce-k8s:"
)
const (
// ProviderName is the cloud provider name for baiducloud
ProviderName = "baiducloud"
)
Variables ¶
This section is empty.
Functions ¶
func BuildBaiducloud ¶
func BuildBaiducloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildBaiducloud builds baiducloud cloud provider, manager etc.
func BuildBaiducloudCloudProvider ¶
func BuildBaiducloudCloudProvider(manager *BaiducloudManager, discoveryOpts cloudprovider.NodeGroupDiscoveryOptions, resourceLimiter *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error)
BuildBaiducloudCloudProvider builds CloudProvider implementation for Baiducloud.
Types ¶
type Asg ¶
type Asg struct { BaiducloudRef // contains filtered or unexported fields }
Asg implements NodeGroup interface.
func (*Asg) Autoprovisioned ¶
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 (*Asg) Create ¶
func (asg *Asg) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side. Implementation optional.
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 when there is an option to just decrease the target. Implementation required.
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. Implementation optional.
func (*Asg) 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. Implementation required.
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. Implementation required.
func (*Asg) 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. Implementation required.
func (*Asg) Nodes ¶
func (asg *Asg) 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.
func (*Asg) 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). Implementation required.
func (*Asg) TemplateNodeInfo ¶
func (asg *Asg) TemplateNodeInfo() (*schedulercache.NodeInfo, error)
TemplateNodeInfo returns a schedulercache.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 BaiducloudManager ¶
type BaiducloudManager struct {
// contains filtered or unexported fields
}
BaiducloudManager is handles baiducloud communication and data caching.
func CreateBaiducloudManager ¶
func CreateBaiducloudManager(configReader io.Reader) (*BaiducloudManager, error)
CreateBaiducloudManager constructs baiducloudManager object.
func (*BaiducloudManager) GetAsgForInstance ¶
func (m *BaiducloudManager) GetAsgForInstance(instance *BaiducloudRef) (*Asg, error)
GetAsgForInstance returns AsgConfig of the given Instance
func (*BaiducloudManager) GetAsgNodes ¶
func (m *BaiducloudManager) GetAsgNodes(asg *Asg) ([]string, error)
GetAsgNodes returns Asg nodes.
func (*BaiducloudManager) GetAsgSize ¶
func (m *BaiducloudManager) GetAsgSize(asg *Asg) (int64, error)
GetAsgSize gets asg size.
func (*BaiducloudManager) RegisterAsg ¶
func (m *BaiducloudManager) RegisterAsg(asg *Asg)
RegisterAsg registers asg in in Bce Manager
func (*BaiducloudManager) ScaleDownCluster ¶
func (m *BaiducloudManager) ScaleDownCluster(instances []string) error
ScaleDownCluster gets Scale Set size.
func (*BaiducloudManager) ScaleUpCluster ¶
func (m *BaiducloudManager) ScaleUpCluster(delta int) error
ScaleUpCluster Scale UP cluster
type BaiducloudRef ¶
type BaiducloudRef struct {
Name string
}
BaiducloudRef contains a reference to some entity in baiducloud world.
type CloudConfig ¶
type CloudConfig struct { ClusterID string `json:"ClusterId"` ClusterName string `json:"ClusterName"` AccessKeyID string `json:"AccessKeyID"` SecretAccessKey string `json:"SecretAccessKey"` Region string `json:"Region"` VpcID string `json:"VpcId"` MasterID string `json:"MasterId"` Endpoint string `json:"Endpoint"` NodeIP string `json:"NodeIP"` Debug bool `json:"Debug"` }
CloudConfig cloud config file for baiducloud
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
baiducloud-sdk-go
|
|
bce
Package bce defined a set of core data structure and functions for Baidu Cloud API.
|
Package bce defined a set of core data structure and functions for Baidu Cloud API. |
util
Package util implements a set of util functions.
|
Package util implements a set of util functions. |