Kubernetes Cluster Over-Provisioning: Proactive App Scaling

Need of a cluster overprovisioning

To overcome the problem, we thought of implementing the below solutions

  1. Fix the number of extra nodes in the cluster
  2. Make use of pod-priority-preemption

Fix the number of extra nodes in the cluster

Make use of pod-priority-preemption

Introduction to Horizontal Cluster Proportional Autoscaler

Scaling with over-provisioning: what happens under the hood

  1. Load hits the cluster
  2. Kubernetes starts scaling application pods horizontally by adding new pods.
  3. Kube-scheduler tries to place newly created application pods but finds insufficient resources.
  4. placeholder-pods (pause pods in our case) gets evicted as it has low priority and application pods get placed.
  5. Application pods gets placed and scaling happens immediately without any delay.
  6. placeholder-pods go in pending state and cannot be scheduled due to insufficient resources.
  7. Cluster autoscaler watches the pending pods and will scale the cluster by adding new nodes in the cluster
  8. Kube-scheduler waits, for instance, to be provisioned, boot, join the cluster, and become ready.
  9. Kube-scheduler notices there is a new node in the cluster where pods can be placed and will schedule placeholder-pods on such nodes.

Implementation

  1. Placeholder-pod (paused-pod) deployment
  2. Cluster proportional autoscaler deployment
  3. Serviceaccount
  4. Clusterrole
  5. Clusterrolebinding
  6. Configmap
  7. Priority class for the paused pods with a priority value of -1

Conclusion

References

  1. https://github.com/kubernetes-sigs/cluster-proportional-autoscaler
  2. https://github.com/kubernetes-sigs/cluster-proportional-autoscaler#horizontal-cluster-proportional-autoscaler-container
  3. https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-configure-overprovisioning-with-cluster-autoscaler
  4. https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
  5. https://www.ianlewis.org/en/almighty-pause-container

--

--

--

I'm Ajit Vedpathak, a dynamic IT professional + loves challenging assignments and leadership challenges + loves playing volleyball.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Find Dividend Paying Stocks with Python

BlueHost Alternative : Top 4 Options for WordPress Hosting

There’s a Gap Between Devs and Kubernetes

Continuous delivery as code with Jenkins DSL — Blend

Improving Perceived Performance of Web Apps

Mobile Development Approaches and Flutter Architecture: FLUTTER PART-I

Complete Data Analytics Solution using ETL Pipeline in Python

Turtle- python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ajit Vedpathak

Ajit Vedpathak

I'm Ajit Vedpathak, a dynamic IT professional + loves challenging assignments and leadership challenges + loves playing volleyball.

More from Medium

AWS open5gs K8S High Availability [part 1]

Helm, AWS IAM Role & Github Actions

How to build a CI CD pipeline in AWS ECR and AWS EKS using Github actions and ArgoCD for Node.js

GitOps CICD using AWS EKS and Github

Single Pod Access Mode for Persistent Volumes on Kubernetes