6 Mart 2022 Pazar

Cluster Autoscaler (CA) - Yeni Worker Node Ekler/Siler

Giriş
Açıklaması şöyle
Manually adding and removing capacity from the Kubernetes cluster can significantly drive up the cluster management costs and engineering toil. Cluster Autoscaler automates adding and removing worker nodes to the cluster to meet the desired capacity. CA works nicely in conjunction with the HPA. As soon as HPA starts approaching the compute resources limit, CA can calculate the number of nodes to satisfy the shortage and add new nodes to the cluster. Also, when CA determines that nodes have been underutilized for an extended period, it can reschedule the pods to other nodes and remove the underutilized nodes from the cluster.

The implementation of Cluster Autoscaler varies with the cloud providers. Some cloud providers such as Azure and AWS support Cluster API. Cluster API uses its Kubernetes operator to manage cluster infrastructure. The Cluster Autoscaler offloads the operation to update the node count to the Cluster API controller. Cluster autoscaling can be helpful if you consider the following before implementing it:
  1. Ensure that you understand how your application will behave under load and remove the bottlenecks that prevent the application from scaling horizontally.
  2. Know the upper scaling limit that the cloud provider might enforce.
  3. Understand the speed at which the cluster can scale when the need arises.
Cluster Autoscaler Ne Zaman Devreye Girer?
Açıklaması şöyle
Let’s first review how the Kubernetes Cluster Autoscaler (CA) works.

The autoscaler doesn’t scale on memory or CPU.

Instead, it reacts to events and checks for any unschedulable Pods every 10 seconds.

A pod is unschedulable when the scheduler cannot find a node that can accommodate it.
Cluster Autoscaler İçin Hazırlık Süresi
Cluster Autoscaler devreye girinceye kadar biraz zaman geçer ancak bu zaman zarfından uygulama baskı altındadır. Bunu çözmek için basit bir teknik var. Bir Place Holder Podd yaratılır. Ona bir Priority atanır. Şöyle yaparız. Kendi Pod'umuzdan bir tane daha gerekince, Place Holder Pod silinir ve kaynakları kendi Pod'umuza tahsis edilir. Place Holder Pod unschedulable olacağı için Cluster Autoscaler devreye girer.
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: overprovisioning
value: -1
globalDefault: false
description: "Priority class used by overprovisioning."





Hiç yorum yok:

Yorum Gönder

Cluster Propotional Autoscaler - ReplicaSet Ekler/Siler

Giriş Açıklaması şöyle CPA aims to horizontally scale the number of Pod replicas based on the cluster’s scale. A common example is DNS ser...