PRESENTER: We covered monitoring GKE infrastructure and services
in the previous episode.
But GKE is not the only place you can run containers
in Google Cloud.
Today, we'll look at three options for running containers,
and how to instrument each one for observability,
with Cloud Operations.
Welcome to Engineering for Reliability with Google Cloud.
Let's start by reviewing your options
for running containers in Google Cloud
and how you might choose between them.
Your first option is, of course, GKE, or Google Kubernetes
Engine.
It's a great way to deploy, scale, and manage
Kubernetes clusters in the Cloud and use them to orchestrate
your container workloads.
GKE is the industry's first fully managed Kubernetes
service, and it implements the full Kubernetes API,
four-way autoscaling, release channels,
and multicluster support.
Your second option is Cloud Run, either as a fully managed
serverless offering or on GKE clusters.
Cloud Run abstracts away infrastructure management
by automatically scaling up and down from zero,
and almost instantaneously by responding to incoming traffic.
And Cloud Run only charges you for the exact resources
you use.
Your third option is Anthos.
It's a managed application platform
that extends Google Cloud Services and engineering
practices to your environment so you can modernize apps
faster and establish operational consistency across them.
With so many options, how do you choose?
GKE is a fantastic option if you prefer to manage and operate
Kubernetes clusters directly, or need that level of control
over your infrastructure.
GKE is also great because of its Google Cloud marketplace
integration, which lets you access
enterprise-ready containerized solutions
with pre-built deployment templates, portability,
simplified licensing, and consolidated billing.
Cloud Run is a great choice as a fully serverless platform.
It makes app development and deployment simple and fast,
and it's fully integrated with Cloud Code, Cloud Build, Cloud
monitoring, and Cloud Logging for a complete end-to-end
developer experience.
Finally, Anthos is the right choice for many enterprises
where hybrid or multi-cloud is a reality.
It lets you extend the best of Google Cloud
to your environments, no matter where they are, so you
can modernize apps and establish operational consistency
across infrastructure.
Now that you understand your options,
let's have a look at how to instrument your services
running on them to send telemetry
to Cloud Operations for a consistent approach
to observability.
Let's start with GKE.
We've covered much of this in previous episodes,
but let's have a look at how to get visibility
into both the infrastructure and your services.
Let's start by inspecting our cluster.
Here, we can confirm that we have both system and workload
logging enabled, and monitoring enabled for the cluster.
This means that we'll get logs from our containers and cluster
infrastructure, and infrastructure metrics
ingested automatically.
Let's head over to monitoring and have a look.
We'll start at the GKE dashboard.
Here, we can see information about our clusters,
their nodes, and the workloads and services
running on them, even down to the pod and container level.
We can select a specific workload
to get information about it.
Here, we can see if it's generating any alerts, metrics
that show its health and behavior,
and the logs it's generating.
In this case, the workload is a deployment.
If we want to know what pods or containers are running
in this deployment, we can filter the entire dashboard
by that resource.
We can then see the actual container running our workload,
and get its metrics and even container logs.
Note that workloads on GKE do not
have automatic tracing enabled.
Have a look at our previous episode
on distributed tracing with OpenTelemetry
if this is something you need.
GKE is well integrated with Cloud Operations,
and makes it easy to monitor and observe
both your infrastructure and services.
Now, let's have a look at managing services on Cloud Run.
From the project dashboard, let's go to the product menu
and select Cloud Run.
Cloud Run home page shows all services
running in the project.
When we select our service, the metrics tab
will show some of the key performance indicators
like request count, broken MR response code class,
and latency, with 50th, 95th, and 99th percentile latencies
automatically calculated.
Metrics that we would want to use as Service Level
Indicators, or SLIs, are created for us right out of the box.
We can switch to the logs tab to see the logs for our service,
and even view them in the log's Explorer.
Here, we can analyze and query logs
from our Cloud Run service using queries, the field
Explorer, or the histogram.
You can review our previous episode
on Cloud Logging for more details if you like.
Back on the metrics screen, we can also open Cloud Trace
and go directly to the list of traces for our service.
We can select a trace and see detailed information
for that request, including total latency
and any dependencies our service might have.
This is how container applications running
in Cloud Run are automatically instrumented
to send metrics, logs, and traces to Cloud Operations.
Finally, let's have a look at how Anthos clusters are
integrated with Cloud Operations to provide visibility
into the infrastructure, no matter where it's running,
and your services.
From the project dashboard, let's go to GKE clusters.
Here, we have two clusters running on GKE in the Cloud
and another cluster managed by Anthos.
Let's have a look at how we can start
to visualize the health of the cluster and the workloads
running on it.
Our first dashboard shows us the status of the control plane,
including the availability of the API server, scheduler,
and controller manager.
We can also see the status of the infrastructure,
and understand how our nodes are using CPU, memory,
and disk resources.
Finally, we can look at the status of the actual workloads
running in our Anthos cluster, by understanding metrics
like container CPU, memory usage, restarts,
and network traffic.
To understand more about what's happening with our container
workloads, we can go to logging and look at logs Explorer.
Here, we can look at Kubernetes container logs
and filter them through just the logs being
emitted by services running in the Anthos-managed cluster.
We can scroll down and select a specific pod or container
we're actually interested in.
For example, if we want to get the logs being generated
by our front end, we can select that as the pod name to filter
the logs to just those.
This is how Cloud Operations can help
you visualize metrics and analyze logs being
emitted by your container workloads
running on an Anthos cluster.
Thanks for joining me today.
We covered your options for running containers
in Google Cloud, and how to observe both the infrastructure
and your services for each one.
I hope this helps you run more reliable container services,
and keep your users happy.
Thanks so much for watching.
Don't forget to Like and Subscribe
so you never miss out on more Engineering for Reliability
with Google Cloud.
See you soon.