
This solution calls for some of Google Cloud’s more heavyweight services. Here are the details of those services.
GKE Autopilot
In Chapter 13, you used Cloud Run as the runtime for your containers. Although Cloud Run is built upon Knative, which is an open source project, it is still a Google-specific implementation.
In this chapter, you will use Google Kubernetes Engine (GKE) Autopilot as the runtime for your container. GKE Autopilot is a fully managed Kubernetes service that is designed to be easy to use. It is a great way to run containers in the cloud without having to worry about the underlying infrastructure while providing more control than is available with Cloud Run.
I like Kubernetes, but I have never been a fan of the learning curve, the complexity of managing a Kubernetes cluster, or more importantly, the cost. Having a GKE cluster running will cost hundreds of dollars per month even when it is not hosting any applications.
It would be easy to spend several chapters introducing Kubernetes alone, as it is a complex subject. However, GKE Autopilot is a great way to get the power and benefits of Kubernetes without the complexity. It will always be useful to know how Kubernetes works, but in the case of GKE Autopilot, it is not essential. For now, it is enough to know that Kubernetes runs one or more containers in a unit called a pod on a cluster of machines. GKE Autopilot is more cost-effective, as you pay on a per-pod basis rather than for several machines or “nodes” in Kubernetes terminology, as you would with a traditional cluster. The cluster supports autoscaling of the machines in it to match what is required at any time. This means that you only pay for the pods that are running, not the entire cluster.
GKE Autopilot is a Google-specific service, but it is built on the open source projects from Kubernetes and Istio service mesh, which are the same building blocks as other public and private clouds. This means that you can use the same container images and very similar configuration to deploy to other Kubernetes platforms, such as Amazon EKS, Azure AKS, or even IBM Cloud IKS, for that matter. This is a great way to build applications that can be deployed to multiple clouds.
Cloud SQL
Previously, you used Cloud SQL for PostgreSQL as the database for your application. This is still a good choice, as every other public cloud provider has a similar managed PostgreSQL offering. There are also many options for running a third-party distribution of PostgreSQL on-premises or on the Kubernetes cluster itself. This means that the database is cloud-agnostic and how it is provided is not a cause for concern. However, there is a limitation to how well it can scale.