fbpx

Kubernetes is an open source system brought by Google to easily manage containerized applications across multiple hosts. It provides deployment scheduling, workload and resource usage optimization, as well as easy scaling. Kubernetes groups your containers into logical units, called pods, to make their management and discovery much simpler.

Managing a Kubernetes cluster while keeping costs down can be quite a challenge, especially when it comes to heterogeneous environments made up of different instance types, and sizes. To increase the cluster’s efficiency, choosing the right instance size and type for a specific workload, as well as utilizing Spot Instances requires some management overhead.

To address those needs, Spotinst allows users to integrate Kubernetes Clusters in one of two ways:

  1. SaaS – Connect your cluster to the Spotinst autoscaler service over the internet.
  2. In-Cluster – Run the Spotinst Kubernetes autoscaler as a pod inside your Kubernetes cluster.

Before you start using this integration, please make sure to have:

  • An active Spotinst account (Sign Up)
  • Kubernetes Cluster
Where Elastigroup meets Kubernetes – How It Works:
  1. Create a new Elastigroup
  2. Provide Kubernetes user data script (under the Compute tab)
  3. In the 3rd party integration section (under the Compute tab) choose Kubernetes
  4. Choose one of the two integration methods:  SaaS / In-Cluster
  5.  – For SaaS: Add your K8s Master Host and Token
    – For In-Cluster: Follow the instructions provided in our documentation and input a “cluster identifier”
  6. Press Validate to make sure the connection is made successfully
  7. Create The Elastigroup

  • For security reasons, we highly recommend using the principle of least privilege when configuring security groups.
  • Please ensure that your K8s master security group has the Spotinst IP range whitelisted: Spotinst Whitelist IPs

That’s it! Your newly created Elastigroup has been integrated with your K8s cluster and is now managing the provisioning of EC2 instances.

 

Handling Instance Failures

Running K8s on Spotinst Elastigroup provides a production-grade resilient service that makes efficient use of EC2 Spot resources within the K8s cluster. By utilizing prediction algorithms and monitoring services, Elastigroup preemptively provisions EC2 instances and identifies instance failures within the K8s cluster. Spotinst Elastigroup also provisions new instances in parallel as failures occur. Elastigroup communicates with the K8s master to mark ‘bad’ instances as “Unscheduled”  {“spec”:{“unschedulable”:true}}” in order to drain existing running pods and reschedule them on different hosts across the cluster.