Bobcares

GKE Cluster Autoscaler | A Quick Guide

PDF Header PDF Footer

GKE Cluster Autoscaler improves workload availability while controlling costs. Here, we go over the GKE Cluster Autoscaler in detail, including how it works.

Bobcares responds to all inquiries, large or small, as part of our Google Cloud Platform Support Service.

Let’s take a closer look at GKE Cluster Autoscaler.

GKE Cluster Autoscaler

The cluster autoscaler in GKE automatically resizes the number of nodes in a given node pool based on workload demands. Therefore we only need to specify a minimum and maximum size for the node pool, and the GKE Cluster Autoscaler will do the rest.

 

gke cluster autoscaler

GKE Cluster Autoscaler- Working Principle

Cluster autoscaler operates on a per-node pool basis. By adding or removing VM instances from the underlying Compute Engine Managed Instance Group for the node pool, Cluster autoscaler automatically changes the size of the node pool. The cluster autoscaler takes the scaling decisions. Generally, autoscaler take decisions considering resource requests. It takes action after checking the status of nodes and pods regularly.

If there are not enough nodes in the node pool, pods are unscheduled. Then cluster autoscaler adds maximum nodes of the node pool size.
Cluster autoscaler also removes nodes until the node pool is down to the bare minimum size. This occurs when nodes are underutilized and all pods can be scheduled even with fewer nodes in the node pool. Cluster autoscaler won’t try to scale down a node if there are pods on it that can’t move to other nodes in the cluster. The node will stop if pods can be moved to other nodes but the node cannot be gracefully drained after a timeout period.

GKE Cluster Autoscaler Operating Standards

Cluster autoscaler checks the following while adjusting a node pool:

  • We can restart all replicated pods on some other node even though there is a short interruption.
  • Customers or admins are not manually managing nodes.
  • A single node pool’s nodes share the same labels.
  • Consider the lower cost of node pools containing Spot VMs.
  • After the initial cluster or node pool creation, the labels that were manually added are not recorded.

Zone-Wide Balancing

When scaling up, cluster autoscaler attempts to keep managed instance group sizes balanced if the node pool contains multiple managed instance groups of the same instance type. This can also help to avoid an uneven distribution of managed instance groups across multiple zones of a node pool.

Maximum-Minimum Range of Node Pool

We can set the minimum and maximum size for the node pool in the cluster. Then the GKE cluster autoscaler decides within this range.

Autoscaling Constraints

Each zone has a minimum and a maximum number of nodes if the cluster has nodes in multiple zones. For instance, the below command can autoscale a multi-zonal cluster with six nodes across three zones initially. The minimum is set to one node per zone and a maximum as four nodes per zone:

gcloud container clusters create example-cluster \

  --num-nodes 2 \

--zone us-central1-a \

  --node-locations us-central1-a,us-central1-b,us-central1-f \

  --enable-autoscaling --min-nodes 1 --max-nodes 4

Profiles for Autoscaling

The node removal decision is a balance between the availability and optimization of a resource. To make a better decision, we can choose the autoscaling profile. The profiles available are balanced profile and optimize-utilization profile. The balanced profile is the default one. In order to activate the optimize-utilization profile, use the code as shown below:

gcloud container clusters update CLUSTER_NAME

    --autoscaling-profile optimize-utilization

Disruption and Pod Scheduling

Cluster autoscaler considers scheduling and eviction rules on pods when scaling down. As a result, it prevents the autoscaler from deleting a node.

Drawbacks of GKE Cluster Autoscaler

  • The Limited cluster size of 15,000 nodes and 150,000 pods.
  • Cluster autoscaler does not currently support local persistent volumes.
  • During a scale-up event, cluster autoscaler only balances across zones.
  • Custom scheduling with different filters is not possible.
  • The cluster autoscaler cannot completely scale down, sometimes an extra node remains after scaling down.

[Need an answer to a different question? We can be reached with a single mouse click.]

Conclusion

The GKE Cluster Autoscaler tool grows or shrinks a Kubernetes cluster based on the presence of pending pods and node utilization metrics. Here, our Support team went over the GKE Cluster Autoscaler details.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US
server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF