Cloud Run vs GKE: Which container abstraction is right for your startup?
Tags: cloud, kubernetes, containerapps, startup
Published: 2022-09-02 11:05:02

Google Cloud Platform (GCP) offers three container abstractions (or managed container services) to deploy and manage your applications:

- [Cloud Run](https://cloud.google.com/run/docs/)
- [GKE Standard](https://cloud.google.com/kubernetes-engine/docs/concepts/kubernetes-engine-overview)
- [GKE Autopilot](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview)

Each of the above offers different features and is “managed” to varying degrees. Making them suitable for different applications and teams. This post lists all the differences between them to help you decide which of the three is the most suitable for your application.

## A quick introduction

| Cloud Run                                                                                                                                       | GKE Standard                                                             | GKE Autopilot                                                                     |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| **Fully managed**<br/> All you need to give Cloud Run is a container, and it will take care of deploying, securing, autoscaling and monitoring. | **Managed Kubernetes Control Plane**<br/> You manage the nodes yourself. | **Fully-managed Kubernetes**<br/> Both the Kubernetes Control Plane and the node. |

## Feature comparison

### Deployment

| Features                                          | Cloud Run                                                                      | GKE Standard                                                                                     | GKE Autopilot                                                                                                                  |
| ------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| Automated deployments                             | Managed                                                                        | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/how-to/automated-deployment)      | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/how-to/automated-deployment)                                    |
| HTTP load balancing                               | [Self-managed](https://cloud.google.com/load-balancing/docs/https)             | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/ingress)                 | [Managed](https://cloud.google.com/kubernetes-engine/docs/concepts/ingress)                                                    |
| Language support                                  | All                                                                            | All                                                                                              | All                                                                                                                            |
| Operating system                                  | [List of supported images](https://cloud.google.com/run/docs/deploying#images) | [List of supported images](https://cloud.google.com/kubernetes-engine/docs/concepts/node-images) | Only supports in-house Linux with Containerd (Can’t use Red Hat Enterprise Linux (RHEL), Linux with Docker, or Windows Server) |
| Stateful apps                                     | Not supported                                                                  | Supported                                                                                        | Supported                                                                                                                      |
| Daemon workload type in Kubernetes                | NA                                                                             | [Supported](https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-workloads-overview) | [Supported](https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-workloads-overview)                               |
| Altering or adding new resources in the namespace | NA                                                                             | Supported                                                                                        | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#allowable_resource_ranges)         |

### Nodes and node pools

| Features                                                                                                                                                                                                                                                                                                       | Cloud Run                             | GKE Standard                                                                                                            | GKE Autopilot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Node provisioning, node pools & setting cluster size:<br/>1. Calculating what compute capacity your workload required<br/><br/>2. Choosing the size (CPU + RAM) of your nodes basis the required compute capacity for your workload<br/><br/>3. Choosing the size of your cluster which will house these nodes | Managed                               | Self-managed:<br/>You manually provision additional resources and set the overall cluster size.                         | Managed:<br/>Dynamically provisions resources based on your Pod specification                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Resource requests                                                                                                                                                                                                                                                                                              | Limited granularity of CPU and memory | Flexible CPU and memory sizes                                                                                           | CPU resources must use increments of 0.25 CPUs. Autopilot automatically adjusts your requests to round up to the nearest 250m. For example, if you request 800m CPU, Autopilot adjusts the request to 1000m (1 vCPU).<br/><br/>[The ratio of pod vCPU and memory](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-resource-requests) should be in the range of 1:1 to 1:6.5. If this ratio is outside the allowed range for your selected compute class, Autopilot automatically increases the smaller resource. This impacts small services that will likely be overscaled to match this ratio.<br/><br/>[Limits are set to the same values as requests](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-resource-requests) |
| Pod bursting:<br/>Ability to configure pods to burst into unused capacity on the node                                                                                                                                                                                                                          | Not supported                         | [Supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#allowable_resource_ranges)      | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#no_pod_bursting).<br/>Since all Pods have limits set on requests, resource bursting is not possible. It is important to ensure that your Pod specification defines adequate resources for the resource requests and does not rely on bursting.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Pod affinity and anti-affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)                                                                                                                                                                          | Not supported                         | [Supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#pod_affinity_and_anti-affinity) | [Limited support](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#pod_affinity_and_anti-affinity)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Changing nodes:<br/>Such as changes to the underlying machine type if your workloads have specific compute requirements                                                                                                                                                                                        | Not supported                         | Supported                                                                                                               | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#allowable_resource_ranges)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Node auto-repair]<br/>(https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair): Liveness and Readiness health checks                                                                                                                                                                         | Managed                               | Self-managed                                                                                                            | Managed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Node auto-upgrade](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades)                                                                                                                                                                                                                 | Managed                               | Self-managed                                                                                                            | Managed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Maintenance windows](https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions)                                                                                                                                                                                             | Managed                               | Self-managed                                                                                                            | Managed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Surge upgrades](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies#surge)                                                                                                                                                                                                  | Managed                               | Self-managed                                                                                                            | Managed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### Auto scaling

| Features                                                                                                              | Cloud Run                                                                                                   | GKE Standard  | GKE Autopilot |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | ------------- |
| Scale to 0                                                                                                            | Supported                                                                                                   | Not supported | Supported     |
|                                                                                                                       | Cloud Run automatically scales to the number of container instances needed to handle all incoming requests. |               |               |
| [Node auto-provisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning)               | NA                                                                                                          | Self-managed  | Managed       |
| [Cluster autoscaling](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler)                    | NA                                                                                                          | Self-managed  | Managed       |
| [Horizontal pod autoscaling (HPA)](https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling) | NA                                                                                                          | Self-managed  | Self-managed  |
| [Vertical Pod autoscaling (VPA)](https://cloud.google.com/kubernetes-engine/docs/how-to/vertical-pod-autoscaling)     | NA                                                                                                          | Self-managed  | Self-managed  |

### Networking

| Features             | Cloud Run                                                                     | GKE Standard                                                                                                                                       | GKE Autopilot                                                                                                                                 |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| VPC networks         | [Managed](https://cloud.google.com/run/docs/securing/private-networking)      | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/alias-ips):<br/>VPC-native traffic routing for public and private clusters | [Managed](https://cloud.google.com/kubernetes-engine/docs/concepts/alias-ips):<br/>VPC-native traffic routing for public and private clusters |
| Intranode visibility | NA                                                                            | Self-managed                                                                                                                                       | Managed                                                                                                                                       |
| Private networking   | [Self-managed](https://cloud.google.com/run/docs/securing/private-networking) | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept)                                                   | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept)                                              |
| Cloud NAT            | [Self-managed](https://cloud.google.com/nat/docs/overview)                    | Self-managed                                                                                                                                       | Self-managed                                                                                                                                  |
| Authorized networks  | No supported                                                                  | Self-managed                                                                                                                                       | Self-managed                                                                                                                                  |

### Integrations & add-ons

| Features                                | Cloud Run                                                                  | GKE Standard                                                                                                                   | GKE Autopilot                                                                                                                                                                                      |
| --------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Helm charts                             | Not supported                                                              | [Supported](https://cloud.google.com/blog/products/devops-sre/deploying-a-production-grade-helm-release-on-gke-with-terraform) | Not supported                                                                                                                                                                                      |
| Support for Calico network policy       | NA                                                                         | Supported                                                                                                                      | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#add-ons)                                                                                               |
| Cloud Build integration                 | [Supported](https://cloud.google.com/run/docs/building/containers#builder) | [Supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#add-ons)                               | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#add-ons)                                                                                               |
| Logging                                 | [Managed](https://cloud.google.com/run/docs/logging)                       | [Managed](https://cloud.google.com/stackdriver/docs/solutions/gke#about-skm)                                                   | [Managed](https://cloud.google.com/stackdriver/docs/solutions/gke#about-skm)                                                                                                                       |
| Monitoring                              | Managed                                                                    | Managed                                                                                                                        | Managed                                                                                                                                                                                            |
| External monitoring tools               | Supported                                                                  | Supported                                                                                                                      | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#external_monitoring_tools)<br/> Since most external monitoring tools require access that is restricted |
| Configuring 3rd party storage platforms | Not supported                                                              | Supported                                                                                                                      | Not supported                                                                                                                                                                                      |
| Configuring 3rd party network policies  | Not supported                                                              | Supported                                                                                                                      | Not supported                                                                                                                                                                                      |

### Security

| Features                                                                                                                                                                                                                                                                            | Cloud Run                                                                                                                                                               | GKE Standard                                                                                                                                                                                                    | GKE Autopilot                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Shielded nodes](https://cloud.google.com/kubernetes-engine/docs/how-to/shielded-gke-nodes), [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity), [Secure boot](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) | NA                                                                                                                                                                      | Self-managed                                                                                                                                                                                                    | Managed                                                                                                                                                                                                         |
| [Customer-managed encryption keys (CMEK)](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek)                                                                                                                                                                        | [Self-managed](https://cloud.google.com/run/docs/securing/using-cmek)                                                                                                   | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek)                                                                                                                               | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek)                                                                                                                               |
| Access Control                                                                                                                                                                                                                                                                      | Self-managed: [IAM](https://cloud.google.com/run/docs/securing/managing-access)                                                                                         | Self-managed: [RBAC](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#google-groups-for-gke) & [IAM](https://cloud.google.com/kubernetes-engine/docs/how-to/google-groups-rbac) | Self-Managed: [RBAC](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#google-groups-for-gke) & [IAM](https://cloud.google.com/kubernetes-engine/docs/how-to/google-groups-rbac) |
| [Application-layer secrets encryption](https://cloud.google.com/kubernetes-engine/docs/how-to/encrypting-secrets)                                                                                                                                                                   | [Self-managed](https://cloud.google.com/blog/products/serverless/improving-the-security-of-your-cloud-run-environment)                                                  | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison)                                                                                                          | [Self-managed](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison)                                                                                                          |
| [Container threat detection](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison)                                                                                                                                                                | Not supported: Container Threat Detection supports only [Container-Optimized OS](https://cloud.google.com/kubernetes-engine/docs/concepts/node-images#cos) node images. | Self-managed                                                                                                                                                                                                    | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#ktd)                                                                                                                |
| [Binary authorization](https://cloud.google.com/binary-authorization/docs/overview)                                                                                                                                                                                                 | [Self-managed](https://cloud.google.com/binary-authorization/docs/run/overview)                                                                                         | [Not supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#security)                                                                                                           | [Supported](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison)                                                                                                             |
| SLA                                                                                                                                                                                                                                                                                 | Service SLA                                                                                                                                                             | Control plane SLA                                                                                                                                                                                               | Control plane and pod SLA                                                                                                                                                                                       |

### Other features

| Features         | Cloud Run                                          | GKE Standard                                                                                              | GKE Autopilot                                                                                         |
| ---------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Billing          | Pay per use                                        | Pay per node (CPU, memory, boot disk)Users pay the assigned amount regardless of the node resources used. | Pay per use (CPU, memory, and ephemeral storage)Users pay only for the CPU, memory, and storage used. |
| Interoperability | You can use GKE Standard with or without Cloud Run | You can use GKE Standard with or without Cloud Run                                                        | You cannot convert from Standard clusters to Autopilot clusters or vice versa                         |

## What should you choose?

**Go with Cloud Run when:**

1. You don’t want to use Kubernetes
1. AND you want to run stateless containerized microservices
1. AND app devs are going to manage the build and deploys of your microservices (No ops)
1. AND there are minimal third party dependencies like clickhouse or grafana etc.

**Go with GKE Standard when:**

1.  You need to run your services on Kubernetes
1.  AND you need advanced scalability and configuration flexibility to orchestrate your containers, such as
    1.  Number of containers
    1.  CPU and memory
    1.  Networking
    1.  Observability
    1.  Security
1.  Highly compute-intensive workloads that require high-performance compute platforms
1.  Stateful applications, cronjobs etc.
1.  AND you have a dedicated devops expertise to set up and manage your GKE.

**Go with GKE Autopilot when:**

1.  You do not need the flexibility offered by GKE Standard
1.  AND if your workloads meet [Autopilot constraints](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#limits)
1.  AND you have a dedicated devops expertise to set up and manage your GKE.

In general, use the highest level of abstraction when you're starting out. This enables you to use the most optimal technologies without having to learn them in detail. Over time, as you build your knowledge and as your use-cases become more complex, you can start moving to less abtracted offerings.

---

Argonaut is an orchestration layer above your own cloud account (AWS/GCP). Its developer-experience helps you get started with GKE (standard) deployments offering full flexibility yet simple to use, in minutes. It's fully customizable and quickly integrates with a large ecosystem of third-party tools like Helm-charts, Datadog, Redis, and CloudSQL. [Get started with Argonaut now](https://ship.argonaut.dev).