Descheduler on AWS EKS and Azure Kubernetes Services.

In Kubernetes, the process of binding pending pods to nodes is performed as scheduling, and it is carried out by a component of Kubernetes called kube-scheduler.

As Kubernetes clusters are very dynamic and their state changes over time, there may be desire to move already running pods to some other nodes for various reasons:

  • Some nodes are under or over utilized.
  • The original scheduling decision no longer holds true as taints or labels are added to or removed from nodes, causing the pod/node affinity requirements to be unsatisfied
  • Some nodes failed and their pods moved to other nodes.
  • Clusters add new nodes

Descheduler

What is Descheduler? Descheduler relies on default scheduler and deletes nodes when they are no longer needed. It saves your resources utilization and significantly reduces your spendings.

Why do we need Descheduler?

Kubernetes users relied primarily on the Kubernetes Cluster Autoscaler (CAS) to dynamically adjust the compute capacity of their clusters or Cloud provider autoscaler solution like Amazon EC2 Auto Scaling groups. Using Descheduler you don’t need to create dozens of node groups to achieve the flexibility and diversity. It consolidates instance orchestration responsibilities within a single system, which is simpler, more stable and cluster-aware.

The Descheduler can be run as a JobCronJob, or Deployment inside of a k8s cluster. It runs multiple times without needing user intervention. The descheduler pod is run as a critical pod in the kube-system namespace to avoid being evicted by itself or by the kubelet.

Descheduler made up a set of plugins which implements a different strategies for pod scheduling/descheduling:

Name Description
RemoveDuplicates This strategy plugin makes sure that there is only one pod associated with a ReplicaSet (RS), ReplicationController (RC), StatefulSet, or Job running on the same node.The remaining duplicate pods are evicted for better spreading of pods in a cluster.
LowNodeUtilization This strategy identifies underutilized nodes and evicts pods, if possible, from other nodes, hoping that the system will schedule the recreation of evicted pods on these underutilized nodes.
HighNodeUtilization This strategy identifies underutilized nodes and evicts pods from them, aiming to schedule the pods compactly into fewer nodes.
RemovePodsHavingTooManyRestarts This strategy ensures that the system removes pods with too many restarts from nodes. For example, if a pod with EBS/PD cannot attach the volume or disk to the instance, the system re-schedules the pod to other nodes.
PodLifeTime This strategy evicts pods that are older than maxPodLifeTimeSeconds.
RemoveFailedPods This strategy evicts pods that are in failed status phase.

EKS alternative

Karpenter is an open-source cluster autoscaler that automatically provisions new nodes in response to unschedulable pods. Karpenter evaluates the aggregate resource requirements of the pending pods and chooses the optimal instance type to run them. It will automatically scale-in or terminate instances that don’t have any non-daemonset pods to reduce waste. It also supports a consolidation feature which will actively move pods around and either delete or replace nodes with cheaper versions to reduce cluster cost.

Karpenter is not as tightly coupled to Kubernetes versions (as CAS is) and doesn’t require you to jump between AWS and Kubernetes APIs.The system addresses the challenges of Cluster Autoscaler by simplifying the processes to:

  • Provision nodes based on workload requirements.
  • Create diverse node configurations by instance type, using flexible workload provisioner options. Instead of managing many specific custom node groups, Karpenter could let you manage diverse workload capacity with a single, flexible provisioner.
  • Achieve improved pod scheduling at scale by quickly launching nodes and scheduling pods.

AKS alternative

Karpenter is pretty good solution for cloud native infrastructure but it does support only EKS cluster for now. The AKS Karpenter Provider enables node autoprovisioning using Karpenter on your AKS cluster.

The API for AKS Karpenter Provider is currently alpha (v1alpha2).

Karpenter provider for AKS is an official open-source node provisioning project built for Kubernetes by Azure team. It improves the efficiency and cost of running workloads on Kubernetes clusters by:

  • Watching for pods that the Kubernetes scheduler has marked as unschedulable.
  • Evaluating scheduling constraints (resource requests, nodeselectors, affinities, tolerations, and topology spread constraints) requested by the pods.
  • Provisioning nodes that meet the requirements of the pods.
  • Nodes are removed by the system when they are no longer needed.

Hope you like the post. Please follow our previous Kubernetes topic here. Subscribe to our newsletter or follow us on Twitter and LinkedIn.

Save your privacy, bean ethical!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

Choose the best plan for your enterprise

Enterprise

* Contact Us for full list of features

Feautures

Authentication strategies:
Storage
Search engines integration:
Analytics:
Development: