Elastigroup will work with a designated pod inside your Kubernetes cluster that will report constant updates about the clusters’ condition via a one-way link.
Using that information, the Elastigroup will scale the cluster up or down according to the overall nodes utilization and your pods’ needs.
In order to create this connection between your k8s cluster and Elastigroup, you will need to implement a small configuration change on both the k8s cluster side and the Elastigroup side as instructed below;
k8s cluster configuration
In order to run the Spotinst in-cluster autoscaler, you’ll need to run the following controller application in your k8s cluster
This controller needs parameters
spotinst.token– The Spotinst access token (can be generated from the Spotinst console / API)
spotinst.account– The spotinst account Id (Learn more about Accounts and Organizations)
spotinst.cluster-identifier– This identifier should be identical to the
clusterIdentifierthat was configured on the Elastigroup. (should be matched with the Elastigroup parameter thirdPartiesIntegration.kubernetes.clusterIdentifier )
Installing The Controller
1. Create a yaml file
configMap.yaml with the following parameters;
- kind: ConfigMap
- apiVersion: v1
- name: spotinst-kubernetes-cluster-controller-config
- namespace: kube-system
- spotinst.token: <TOKEN>
- spotinst.account: <ACCOUNT_ID>
- spotinst.cluster-identifier: <IDENTIFIER>
2. Load the parameters into the cluster config
- kubectl apply -f configMap.yaml
3. Install the controller and its dependencies
In case you are using K8s version 1.9.X and above, use the following:
- kubectl apply -f https://s3.amazonaws.com/spotinst-public/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller-ga.yaml
Else, install using:
- kubectl apply -f http://spotinst-public.s3.amazonaws.com/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller.yaml
- Please make sure to always download the yaml file from Spotinst s3 bucket as we keep updating it.
spotinst-kubernetes-cluster-controller is now installed and should be reporting its heartbeat to the relevant Spotinst Elastigroup.
Once you’ve installed the controller you can complete the Elastigroup configuration with the instructions here.