scaleway

package
v0.0.0-...-da31dff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

Cluster Autoscaler for Scaleway

The Scaleway Cloud Provider implementation scales nodes on different pools attached to a Kapsule cluster. It can be configured from Scaleway Kapsule API. The cluster pools need to have the option Autoscaling set to true to be managed by the autoscaler.

Configuration

Cluster Autoscaler can be configured with 2 options

Config file

a config file can be passed with the --cloud-config flag.
here is the corresponding JSON schema:

  • cluster_id: Kapsule Cluster Id
  • secret_key: Secret Key used to manage associated Kapsule resources
  • region: Region where the control-plane is runnning
  • api_url: URL to contact Scaleway, defaults to api.scaleway.com
Env variables

The values expected by the autoscaler are the same as above

  • CLUSTER_ID
  • SCW_SECRET_KEY
  • SCW_REGION
  • SCW_API_URL

Notes

k8s nodes are identified through node.Spec.ProviderId, the scaleway node name or id MUST NOT be used.

Documentation

Index

Constants

View Source
const (
	// GPULabel is the label added to GPU nodes
	GPULabel = "k8s.scaleway.com/gpu"
)

Variables

This section is empty.

Functions

func BuildScaleway

BuildScaleway returns CloudProvider implementation for Scaleway.

Types

type NodeGroup

type NodeGroup struct {
	scalewaygo.Client
	// contains filtered or unexported fields
}

NodeGroup implements cloudprovider.NodeGroup interface. it is used to resize a Scaleway Pool which is a group of nodes with the same capacity.

func (*NodeGroup) AtomicIncreaseSize

func (ng *NodeGroup) AtomicIncreaseSize(delta int) error

AtomicIncreaseSize is not implemented.

func (*NodeGroup) Autoprovisioned

func (ng *NodeGroup) Autoprovisioned() bool

Autoprovisioned returns true if the node group is autoprovisioned.

func (*NodeGroup) Create

func (ng *NodeGroup) Create() (cloudprovider.NodeGroup, error)

Create creates the node group on the cloud provider side.

func (*NodeGroup) Debug

func (ng *NodeGroup) Debug() string

Debug returns a string containing all information regarding this node group.

func (*NodeGroup) DecreaseTargetSize

func (ng *NodeGroup) 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.

func (*NodeGroup) Delete

func (ng *NodeGroup) Delete() error

Delete deletes the node group on the cloud provider side.

func (*NodeGroup) DeleteNodes

func (ng *NodeGroup) 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.

func (*NodeGroup) Exist

func (ng *NodeGroup) 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.

func (*NodeGroup) ForceDeleteNodes

func (ng *NodeGroup) ForceDeleteNodes(nodes []*apiv1.Node) error

ForceDeleteNodes deletes nodes from the group regardless of constraints.

func (*NodeGroup) GetOptions

GetOptions returns nil which means 'use defaults options'

func (*NodeGroup) Id

func (ng *NodeGroup) Id() string

Id returns an unique identifier of the node group.

func (*NodeGroup) IncreaseSize

func (ng *NodeGroup) 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.

func (*NodeGroup) MaxSize

func (ng *NodeGroup) MaxSize() int

MaxSize returns maximum size of the node group.

func (*NodeGroup) MinSize

func (ng *NodeGroup) MinSize() int

MinSize returns minimum size of the node group.

func (*NodeGroup) Nodes

func (ng *NodeGroup) Nodes() ([]cloudprovider.Instance, error)

Nodes returns a list of all nodes that belong to this node group.

func (*NodeGroup) TargetSize

func (ng *NodeGroup) 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).

func (*NodeGroup) TemplateNodeInfo

func (ng *NodeGroup) 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).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL