cloudstack

package
v0.0.0-...-fd14076 Latest Latest
Warning

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

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

README

Cluster Autoscaler on CloudStack

The cluster autoscaler on CloudStack scales worker nodes within any specified cluster. It runs as a Deployment in your cluster. This README will go over some of the necessary steps required to get the cluster autoscaler up and running.

Requirements

Cluster Autoscaler requires Apache CloudStack 4.16 onward as well as Kubernetes v1.16.0 or greater.

Deployment

The CloudStack kubernetes cluster can be autoscaled via the scaleKubernetesCluster by passing autoscalingenabled=true along with the minsize and maxsize parameters API from 4.16 onwards. eg:

scaleKubernetesCluster id=<cluster-id> autoscalingenabled=true minsize=<minsize> maxsize=<maxsize>

Autoscaling on the cluster can be disabled by passing autoscalingenabled=false. This will delete the deployment and leave the cluster at its current size. eg:

scaleKubernetesCluster id=<cluster-id> autoscalingenabled=false

To manually deploy the cluster autoscaler, please follow the guide below :

To configure API access to your CloudStack management server, you need to create a secret containing a cloud-config that is suitable for your environment.

cloud-config should look like this:

[Global]
api-url = <CloudStack API URL>
api-key = <CloudStack API Key>
secret-key = <CloudStack API Secret>

The access token needs to be able to execute the listKubernetesClusters and scaleKubernetesCluster APIs.

To create the secret, use the following command:

kubectl -n kube-system create secret generic cloudstack-secret --from-file=cloud-config

Finally, to deploy the autoscaler, modify the cluster-autoscaler-standard.yaml with the cluster id, minsize and maxsize located here and execute it

kubectl apply -f cluster-autoscaler-standard.yaml

Common Notes and Gotchas:

  • The automated deployment of the autoscaler will run with the defaults configured here. To change it, alter the file and deploy it again.
  • By default, cluster autoscaler will not terminate nodes running pods in the kube-system namespace. You can override this default behaviour by passing in the --skip-nodes-with-system-pods=false flag.
  • By default, cluster autoscaler will wait 10 minutes between scale down operations, you can adjust this using the --scale-down-delay flag. E.g. --scale-down-delay=5m to decrease the scale down delay to 5 minutes.

Documentation

Index

Constants

View Source
const (
	// GPULabel is the label added to nodes with GPU resource.
	GPULabel = "accelerator"
)

Variables

This section is empty.

Functions

func BuildCloudStack

BuildCloudStack builds CloudProvider implementation for CloudStack

Types

type CSConfig

type CSConfig struct {
	Global struct {
		APIURL      string `gcfg:"api-url"`
		APIKey      string `gcfg:"api-key"`
		SecretKey   string `gcfg:"secret-key"`
		SSLNoVerify bool   `gcfg:"ssl-no-verify"`
		ProjectID   string `gcfg:"project-id"`
		Zone        string `gcfg:"zone"`
	}
}

CSConfig wraps the config for the CloudStack cloud provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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