KASLIN FIELDS: Kubernetes allows you
to focus on the applications that
matter to you by abstracting away clusters
of underlying infrastructure.
But when an application is stateful,
meaning it needs to persist data in some form,
it can be essential to have greater
control over that underlying infrastructure.
Today, we're going to explore tools
for running stateful workloads in GKE.
[MUSIC PLAYING]
First, let's explore what a stateful workload is
in the context of Kubernetes.
To put it simply, a stateful workload
is typically one that stores some form of data
that needs to persist.
Meanwhile, a stateless one does not necessarily store data,
and often could be disrupted for a short time
without major consequence.
From its beginnings, Kubernetes has
been well-suited to managing stateless workloads.
When a workload does not need to maintain state,
it can generally be disrupted and spun back up
with minimal interruption to the service.
Kubernetes is very good at autohealing
these types of use cases.
Generally, when running stateless workloads,
we don't get too attached to any specific instance
of the workload or of the hardware.
If and when a workload fails, Kubernetes will automatically
replace it with a new one.
In the case of stateful workloads,
the workload will have constant data persistent needs
of some sort.
The workload may have significant dependencies
on underlying hardware as it writes data to disk.
These writes may be long-lived, meaning that the workload
cannot simply be disrupted and spun back up.
Any disruption must be handled gracefully
to avoid any potential for data loss.
As a managed Kubernetes service, GKE
provides the normal open source tools
for managing stateful workloads, such as persistent volumes
and persistent volume claims, Pod Disruption Budgets,
or PDBs, and node affinity for ensuring stateful workloads
have access to the hardware they need.
However, there are also a number of considerations
beyond the cluster itself, where GKE
can provide additional help.
For example, cluster backup services,
built in observability, features to ensure
safe upgrades, and the infrastructure
options to make sure your stateful workloads have
the hardware they need.
Let's explore some of these useful tools and features.
Backups are a key consideration for stateful workloads
anywhere.
The backup for GKE service ensures
you can back up your Kubernetes workloads safely.
It provides the ability to backup
not only the persistent volumes containing
the data for your apps running in Kubernetes,
but also the configuration of the GKE cluster itself.
Another important functionality in GKE is upgrades.
GKE has a few upgrade tools that can
help you run stateful workloads with minimal disruption
across upgrades.
The first I'll talk about here is release channels.
The rapid, regular, and stable channels
provide a regular cadence at varying frequencies
to ensure your clusters are getting updated
to maintain supportability.
With the pace of the Kubernetes project,
it can be challenging to both keep up with supported versions
and at the same time ensure minimal disruption from version
changes for your workloads.
Release channels and GKE's related release management
tooling helps you maintain both uptime and supportability.
One important way GKE ensures you can safely
keep your clusters on supported updated GKE versions
is with deprecation insights and recommendations.
When GKE detects that a cluster is using a Kubernetes
feature or API that is deprecated and will be removed
in an upcoming minor version, it pauses any autoupgrades
to that upcoming minor version and provides
recommendations to help you assess and mitigate
potential issues.
A common approach to ensure a smooth transition
during an upgrade is to use a blue-green strategy.
GKE offers native blue-green node pool
upgrade functionality.
A blue-green node pool upgrade will spin up
a full set of new nodes so you can
test workloads on the new version
before completing a node pool upgrade.
Using a blue-green strategy for upgrades
can be particularly helpful in stateful use cases,
where continuity and stability are especially important.
Be sure to check out our video on GKE node pool upgrades
to learn more about the strategies and tools
to help you upgrade your clusters safely.
When it comes to making sure your Kubernetes workloads have
the storage they need, GKE has a number
of options to fulfill a variety of needs.
For NFS, Cloud Filestore can provide persistent storage
for multiple readers and writers.
GKE also provides options for configuring persistent disks
for your cluster, with flexible sizes.
And for those workloads that need high performance
at very low latency, you can configure locally attached SSDs
for the workloads in your GKE clusters.
From backups to upgrades to configuring storage
to suit your needs, GKE provides an ecosystem of solutions
to support the challenges of running stateful workloads
in Kubernetes.
In this video, you learned about what stateful
means for workloads running in Kubernetes,
and about the ecosystem of tools, features, and services
GKE provides to help you run your stateful workload safely.
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.
Stay tuned for our next videos, where
we dive deeper into GKE topics.
[MUSIC PLAYING]