exoscale

package
v0.0.0-...-883fa4f Latest Latest
Warning

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

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

README

Cluster Autoscaler for Exoscale

The Cluster Autoscaler (CA) for Exoscale scales worker nodes running in Exoscale SKS Nodepools or Instance Pools.

Configuration

Authenticating to the Exoscale API

Note: the following guide assumes you have the permissions to create resources in the kube-system namespace of the target Kubernetes cluster.

In order to interact with the Exoscale API, the Exoscale CA must be configured with API credentials. This can be achieved using Kubernetes Secrets, by exposing those as container environment variables.

We provide a convenience script that generates and applies a k8s manifest declaring Exoscale API credentials as a k8s Secret in your cluster from your local shell environment variables: once created, this Secret can be used in the CA Deployment.

First, start by exporting the Exoscale API credentials (we recommend that you create dedicated API credentials using the Exoscale IAM service) to provide to the CA in your shell, as well as the zone the target Kubernetes cluster is located in:

export EXOSCALE_API_KEY="EXOxxxxxxxxxxxxxxxxxxxxxxxx"
export EXOSCALE_API_SECRET="xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export EXOSCALE_ZONE="ch-gva-2"

Next, run the following command from the same shell:

./examples/generate-secret.sh

Next, ensure that the exoscale-api-credentials Secret has been created successfully by running the following command:

kubectl get secret --namespace kube-system exoscale-api-credentials

Finally, a EXOSCALE_ZONE variable must be set to the target Kubernetes cluster zone along with the API credentials in the CA Deployment shell environment.

You can restrict API operation your IAM key can perform:

  • When deploying the Cluster Autoscaler in SKS, your can restrict your IAM access key to these API operations :
evict-sks-nodepool-members
get-instance
get-instance-pool
get-operation
get-quota
list-sks-clusters
scale-sks-nodepool
  • When deploying the Cluster Autoscaler in an unmanaged cluster, the cluster needs to have nodes belonging to at least an instance-pool. In this case, you can rather restrict your IAM key to these API operations:
evict-instance-pool-members
get-instance
get-instance-pool
get-operation
get-quota
scale-instance-pool
Optional configuration

By default, all nodepools in the k8s cluster are considered for scaling. The flag --nodes=<min>:<max>:<nodepool-name> may be specified to limit the minimum and maximum size of a particular nodepool.

Deployment

Helm

See the Helm Chart README.

Manifest

To deploy the CA on your Kubernetes cluster, you can use the manifest provided as example:

kubectl apply -f ./examples/cluster-autoscaler-run-on-control-plane.yaml

This manifest contains a deployment which is designed to schedule the CA Pod on control-plane nodes. If you want to deploy the CA Pod on regular Nodes (not on the control-plane) or in SKS, you can use this manifest instead:

kubectl apply -f ./examples/cluster-autoscaler.yaml

⚠️ Important Notes

  • The minimum and maximum node group size of particular nodepools may be specified via the --nodes flag, if omitted (default), the minimum is 1 and maximum is computed based on the current Compute instances limit of the Exoscale account the Cluster Autoscaler is running in.
  • The Instance Pool candidate for scaling is determined based on the Compute instance the Kubernetes node is running on, depending on cluster resource constraining events emitted by the Kubernetes scheduler.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExoscale

BuildExoscale builds the Exoscale cloud provider.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles Exoscale communication and data caching of node groups (Instance Pools).

func (*Manager) Refresh

func (m *Manager) Refresh() error

Refresh refreshes the cache holding the node groups. This is called by the CA based on the `--scan-interval`. By default it's 10 seconds.

Directories

Path Synopsis
internal
github.com/exoscale/egoscale/v2
Package v2 is the new Exoscale client API binding.
Package v2 is the new Exoscale client API binding.
github.com/exoscale/egoscale/v2/api
Package api implements low-level primitives for interacting with the Exoscale API.
Package api implements low-level primitives for interacting with the Exoscale API.
github.com/exoscale/egoscale/v2/oapi
Package oapi provides primitives to interact with the openapi HTTP API.
Package oapi provides primitives to interact with the openapi HTTP API.
github.com/exoscale/egoscale/version
Package version stores the current version of the egoscale package.
Package version stores the current version of the egoscale package.
github.com/gofrs/uuid
Package uuid provides implementations of the Universally Unique Identifier (UUID), as specified in RFC-4122 and DCE 1.1.
Package uuid provides implementations of the Universally Unique Identifier (UUID), as specified in RFC-4122 and DCE 1.1.
k8s.io/klog
Package klog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package klog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.

Jump to

Keyboard shortcuts

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