Google Kubernetes Engine or Cloud Run: which should you use?

Going Deep | A Guide to Reversing Smoke Loader Malware
November 21, 2019
The Good, the Bad and the Ugly in Cybersecurity – Week 47
November 22, 2019
Going Deep | A Guide to Reversing Smoke Loader Malware
November 21, 2019
The Good, the Bad and the Ugly in Cybersecurity – Week 47
November 22, 2019

When it comes to managed Kubernetes services, Google Kubernetes Engine (GKE) is a great choice if you are looking for a hybrid container orchestration platform that offers advanced scalability and configuration flexibility. GKE gives you complete control over every aspect of container orchestration, from networking, to storage, to how you set up observability–in addition to supporting hybrid application use cases. However, if your application does not need that level of cluster configuration and monitoring, then fully managed Cloud Run might be the right solution for you.

Fully managed Cloud Run is an ideal serverless platform for containerized microservices that don’t require advanced Kubernetes features like namespaces, co-location of containers in pods (sidecars) or node allocation and management.

Why Cloud Run?

The managed serverless compute platform Cloud Run provides a number of features and benefits:

  • Easy deployment of microservices. A containerized microservice can be deployed with a single command without requiring any additional service-specific configuration.

  • Simple and unified developer experience. Each microservice is implemented as a Docker image, Cloud Run’s unit of deployment.

  • Scalable serverless execution. A microservice deployed into managed Cloud Run scales automatically based on the number of incoming requests, without having to configure or manage a full-fledged Kubernetes cluster. Managed Cloud Run scales to zero if there are no requests, i.e., uses no resources.

  • Support for code written in any language. Cloud Run is based on containers, so you can write code in any language, using any binary and framework.

Cloud Run is available in two configurations: as a fully managed Google Cloud service, and as Cloud Run for Anthos (this option deploys Cloud Run into Anthos GKE cluster). If you’re already using Anthos, Cloud Run for Anthos can deploy containers into your cluster, allowing access to custom machine types, additional networking support, and GPUs to enhance your Cloud Run services. Both managed Cloud Run services and GKE clusters can be created and managed completely from the console as well as from the command line.

The best part is you can easily change your mind later, switching from managed Cloud Run to Cloud Run for Anthos or vice versa without having to reimplement your service.

A Cloud Run use case

To illustrate these points, let’s take a look at an example use case, a service that adds, updates, deletes and lists addresses.

You can implement this address management service by creating one containerized microservice for each operation. Then, once the images have been created and registered in a container registry, you can deploy them to managed Cloud Run with a single command. After executing four commands (one deployment for each microservice), the service is up and running on a completely serverless platform. The following figure shows the deployment using Cloud Spanner as the underlying database.

Leave a Reply

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