In this course, you will learn about some of the more advanced options available when creating a Google Kubernetes Engine cluster.
You will learn the main differences between:
- Standard vs. Autopilot clusters
- Private vs. Public clusters
- Zonal vs. Regional clusters
- Routes-based vs. VPC-native clusters
- GCP Network Engineers
- GCP Security Engineers
- Anyone preparing for a Google Cloud certification (such as the Professional Cloud Network Engineer exam)
- Basic understanding of Kubernetes and GKE
- Some experience building and deploying containers
When creating a GKE cluster, you also need to consider your availability requirements. Eventually, all resources will experience some downtime. Now Kubernetes itself is fairly resilient, and can easily handle losing a node or two. However, what happens when an entire zone goes down? Depending on how your cluster is set up, that might cause a problem. That is why Google offers you the ability to create both Zonal and Regional clusters.
If you are going to be using Autopilot, then your clusters are automatically going to be configured to be Regional. A regional cluster runs in multiple zones. That includes both the control plane and the nodes. So, if one zone goes down, you have replicas of the control plane that can take over. Any nodes that are lost are simply recreated in a working zone. By default, GKE replicates each node pool across three zones in the control plane's region. So you can actually survive the loss of two different zones. And you also can pick specific zones if you wish.
Zonal clusters have only a single copy of the control plane running in a single zone. If that zone goes down, then your cluster becomes unreachable. Now the nodes in a Zonal Cluster can still be spread out over multiple zones. So a Zonal cluster can either be a “single-zone” where the control plane and nodes are all running in the same zone. Or it can be “multi-zone” where the control plane runs in a single zone, and the nodes are spread across multiple zones.
Regional clusters achieve high availability by distributing multiple copies of the control plane across multiple zones. So not only will they stay up when a single zone goes down, but also regional clusters do not go offline during an upgrade. Each zone is upgraded one at a time. For a zonal cluster, this is not the case.
So it might seem to you that regional clusters are always the superior choice. But, there are some good reasons for choosing a zonal cluster. For example, configuration changes are faster on a zonal cluster because they only need to propagate across a single zone. Also, zonal clusters are less expensive.
In general, a regional cluster is usually the best choice for a production environment. And a zonal cluster would be useful for non-critical operations like development or testing.
Ok, so now you understand the basics, let me show you how to set up a Regional and a Zonal cluster. Of course, you need to log into the GCP console and navigate to the GKE page. The easiest way to create a regional cluster is to select Autopilot. Any cluster created by Autopilot is automatically set to regional and you cannot override it. So, if you want to set up a single-zone or multi-zone cluster, you have to choose Standard.
When setting up a Standard cluster, the default is set to zonal. This means you only get one copy of the control plane running in a single zone. You can choose whichever zone you want, but remember if that zone goes down, you will not be able to reach your cluster. Also by default, your nodes are set to run in a single zone, but you can actually distribute them across multiple zones by checking this option. Once I do that, I can select any of the other zones in the same region. So if I want I could actually have nodes running in every zone for this region. However, this is still considered a Zonal cluster, because my control plane is constrained to a single zone. If I change the zone selection here, then I am just moving my control plane around. So in this configuration, I have my control plane running in Zone F and I have my nodes running in both Zone B and Zone F.
Creating a Regional cluster in Standard is pretty simple. Just click on create, then configure, and choose regional here. You will notice that instead of being able to pick a particular zone (A, B, C, etc) you just select an entire region. This cluster will have multiple copies of the control plane spread across multiple zones and thus will be a lot more resilient. Basically, multiple zones would have to fail in order to bring this cluster down. Now if you want to control the default zone that your nodes run in, you can still specify that by clicking here. And you can choose one or multiple zones if you wish.
And that’s it. Now you know how to create both a Regional and a Zonal Cluster.
Daniel began his career as a Software Engineer, focusing mostly on web and mobile development. After twenty years of dealing with insufficient training and fragmented documentation, he decided to use his extensive experience to help the next generation of engineers.
Daniel has spent his most recent years designing and running technical classes for both Amazon and Microsoft. Today at Cloud Academy, he is working on building out an extensive Google Cloud training library.
When he isn’t working or tinkering in his home lab, Daniel enjoys BBQing, target shooting, and watching classic movies.