KASLIN FIELDS: Today, we'll talk about one
aspect of running your applications in Kubernetes,
autoscaling.
As the popularity of Kubernetes has grown,
the community isn't the only thing that's scaled up.
You also need to think about how your applications will scale.
Today, we'll look at autoscaling your applications in GKE.
I'm Kaslin Fields, and I'm a Developer Advocate here
at Google Cloud, where I focus on Google Kubernetes Engine,
or GKE, as well as open-source Kubernetes.
And today, we're going to take a closer look at the autoscaling
capabilities of GKE.
[MUSIC PLAYING]
At some point, you've probably been in a situation
where you've had to think about bin packing.
Bin packing is the concept of packing items
inside a confined space in order to use the space most
efficiently.
The same concept applies when you're running applications
on infrastructure.
You want to use your infrastructure resources
you're paying for, such as CPU and memory,
as efficiently as possible.
For example, here's a diagram showing a Google Cloud N1
standard 16 compute instance with 16 vCPUs and 64 gigs
of memory.
The boxes coming from the bottom left of the graph
represent workloads.
You can see that around 12.5 vCPU of the 16 vCPU
and 28.5 gigabytes out of the 64 gigabytes
are utilized by these workloads.
This means that there are about 3 vCPU and over 30 gigabytes
of RAM on this machine that are not being utilized.
Running machines that use these resources more efficiently
would help you to optimize your cost,
but figuring out which workloads will be run on which machines,
and thus managing the utilization of your resources,
can be quite challenging.
Wouldn't it be easier if the platform you're
running your application on could simply
detect its required resource utilization
and adjust accordingly?
This is the concept behind autoscaling.
When using Google Kubernetes Engine,
there are four types, or dimensions,
of autoscaling that you should consider--
Horizontal Pod Autoscaling, or HPA, Vertical Pod Autoscaling,
or VPA, Cluster Autoscaler, CA, and Node Auto Provisioner,
or NAP.
This diagram illustrates these scalability dimensions.
On the top, you'll see autoscalers
that relate to scaling your workloads or Kubernetes pods.
On the bottom, you'll see autoscalers
that relate to scaling your infrastructure or nodes.
The horizontal pod autoscaler and cluster autoscaler,
which are both on the left of the diagram,
both deal with increasing or decreasing
the number of something.
In the case of HPA, that would mean
increasing the number of pods running your workload
to meet demand, or potentially decreasing
the number of pods running your workload when demand is low.
The cluster autoscaler can be configured
to increase the number of nodes in your cluster to meet demand
or, conversely, to reduce the number of nodes in your cluster
so you're using your resources most efficiently during times
of low demand.
On the right side of the diagram are
autoscalers which change the size of something.
The Vertical Pod Autoscaler, or VPA, on the top
can help you set the best resource requests and limits
for the workloads you're running in Kubernetes pods.
The node autoprovisioner on the bottom
can select Compute instance sizes
in order to most efficiently pack your workloads based
on resource utilization.
Together, these four dimensions of autoscaling
provide tools that enable you to run both the infrastructure
of your workloads, as well as the workloads themselves,
on your Google Kubernetes Engine clusters efficiently,
with minimal configuration as your clusters needs change.
It's also important to mention that Google Kubernetes
Engine recently introduced a new type of autoscaler
called the multidimensional pod autoscaler.
As the name implies, the new tool
combines the capabilities of the horizontal and vertical pod
autoscalers in order to provide a more
streamlined and easier-to-use method
to optimize the efficiency of your workloads running on GKE.
Your usage of these FOUR autoscaling dimensions
will be a little different depending
on whether you're using Google Kubernetes Engine in a Standard
or Autopilot mode.
We dive deeper into the differences between these modes
in GKE Essentials--
Cluster Modes.
Be sure to check out that video for more details.
While these various types of autoscalers
can save you time and cost, configuring and understanding
all of the autoscalers is still quite a bit to remember.
GKE Autopilot mode provides a more hands-off approach
by configuring the infrastructure components
of cluster autoscaling for you.
This means that when running Autopilot mode GKE clusters,
you would want to focus on configuring
any of the pod autoscaling options,
and you would not need to worry about the cluster autoscaler
dimensions.
These autoscaling tools can help make your work easier
and more efficient.
They can also help you optimize your costs
so that you're using the resources you're paying for
most efficiently.
Here are some additional resources
which you can find in the description
below that can help you learn more
about optimizing your costs on Google Kubernetes Engine.
The four dimensions of autoscaling
in Google Kubernetes Engine play an important role
when configuring your workloads to run
efficiently on Kubernetes.
With the concepts discussed in this video,
we're confident you'll be on your way
to building a GKE cluster that suits your needs.
You can get started with GKE by visiting the Google Cloud
Console and checking out the links below.
And stay tuned for our next videos, where we dive deeper
into GKE topics.
[MUSIC PLAYING]