Documentation ¶
Index ¶
- func BuildLinode(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- type GcfgGlobalConfig
- type GcfgNodeGroupConfig
- type NodeGroup
- func (n *NodeGroup) AtomicIncreaseSize(delta int) error
- func (n *NodeGroup) Autoprovisioned() bool
- func (n *NodeGroup) Create() (cloudprovider.NodeGroup, error)
- func (n *NodeGroup) Debug() string
- func (n *NodeGroup) DecreaseTargetSize(delta int) error
- func (n *NodeGroup) Delete() error
- func (n *NodeGroup) DeleteNodes(nodes []*apiv1.Node) error
- func (n *NodeGroup) Exist() bool
- func (n *NodeGroup) ForceDeleteNodes(nodes []*apiv1.Node) error
- func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (n *NodeGroup) Id() string
- func (n *NodeGroup) IncreaseSize(delta int) error
- func (n *NodeGroup) MaxSize() int
- func (n *NodeGroup) MinSize() int
- func (n *NodeGroup) Nodes() ([]cloudprovider.Instance, error)
- func (n *NodeGroup) TargetSize() (int, error)
- func (n *NodeGroup) TemplateNodeInfo() (*framework.NodeInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLinode ¶
func BuildLinode( opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter, ) cloudprovider.CloudProvider
BuildLinode builds the BuildLinode cloud provider.
Types ¶
type GcfgGlobalConfig ¶
type GcfgGlobalConfig struct { ClusterID string `gcfg:"lke-cluster-id"` Token string `gcfg:"linode-token"` DefaultMinSize string `gcfg:"defaut-min-size-per-linode-type"` DefaultMaxSize string `gcfg:"defaut-max-size-per-linode-type"` ExcludedPoolIDs []string `gcfg:"do-not-import-pool-id"` }
GcfgGlobalConfig is the gcfg representation of the global section in the cloud config file for linode.
type GcfgNodeGroupConfig ¶
type GcfgNodeGroupConfig struct { MinSize string `gcfg:"min-size"` MaxSize string `gcfg:"max-size"` }
GcfgNodeGroupConfig is the gcfg representation of the section in the cloud config file to change defaults for a node group.
type NodeGroup ¶
type NodeGroup struct {
// contains filtered or unexported fields
}
NodeGroup implements cloudprovider.NodeGroup interface. NodeGroup contains configuration info and functions to control a set of nodes that have the same capacity and set of labels.
Receivers assume all fields are initialized (i.e. not nil).
We cannot use an LKE pool as node group because LKE does not provide a way to delete a specific linode in a pool, but provides an API to selectively delete a LKE pool. To get around this issue, we build a NodeGroup with multiple LKE pools, each with a single linode in them.
func (*NodeGroup) AtomicIncreaseSize ¶
AtomicIncreaseSize is not implemented.
func (*NodeGroup) 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 (*NodeGroup) Create ¶
func (n *NodeGroup) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side. Implementation optional.
func (*NodeGroup) Debug ¶
Debug returns a string containing all information regarding this node group.
func (*NodeGroup) 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 (*NodeGroup) 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 (*NodeGroup) DeleteNodes ¶
DeleteNodes deletes nodes from this node group (and also increasing the size of the node group with that). 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 (*NodeGroup) 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 (*NodeGroup) ForceDeleteNodes ¶
ForceDeleteNodes deletes nodes from the group regardless of constraints.
func (*NodeGroup) GetOptions ¶
func (n *NodeGroup) 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 (*NodeGroup) 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 (*NodeGroup) Nodes ¶
func (n *NodeGroup) 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 (*NodeGroup) 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 (*NodeGroup) TemplateNodeInfo ¶
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.