Google Kubernetes Engine — Autopilot
Google Kubernetes Engine (GKE) was the first managed Kubernetes service in the cloud. It provides an industry leading 15k nodes support and takes care of lot of operational overhead itself. The operational overhead includes Control plane provisioning and management, Worker Node creation, OS patching and Node upgrades. However till now, Worker Node management and Node pool specification & configuration was still user’s responsibility.
This meant that users had to deal with configuring node pools (number of nodes, machine types etc.) apart from running their own applications on GKE.
Table Of Content
- Introducing GKE Autopilot
- Managed yet Flexible
- Pod level SLA and Billing
- Demo
- Conclusion
Introducing GKE Autopilot
Recently, Google introduced GKE Autopilot, which ups the ante by taking away the node management overhead from the user.
With Autopilot, user just needs to provide the application configuration and GKE will take care of provisioning the cluster based off of that.
- GKE will provision compute resources based on the resource needs provided in Pod specs.
- GKE automatically decides what node size should be provisioned based on the application spec.
- The provisioned clusters have standard security best practices applied to them automatically, which further enhances the security posture.
Managed yet Flexible
Even when everything is managed, users still have control over maintenance windows and PodDisruptionBudget
to control how and when the maintenance of the nodes occurs.
Pod level SLA and Billing
In addition to GKE’s SLA on hosts and the control plane, Autopilot also includes an SLA on Pods — a first. The billing also happens on Pod level rather than host level.
- The billing happens for per second vCPU, memory and disk used.
- There is an SLA of 99.9% uptime for Autopilot pods in multiple zones.
With details out of the way, lets jump straight to the demo.
Demo
Open up the Cloud Console and go to Kubernetes Engine. Click on Create
.
This time you’ll be greeted by an option to choose between Standard
and Autopilot
.
For purpose of this demo, we’ll choose Autopilot. Click on Configure
. You’ll notice that we have to configure far less properties as compared to a Standard cluster. Google cheekily boasts all the features of an Autopilot cluster right on the creation screen.
We have to provide Name and Region and we are good to go.
We can however, configure the networking options as well if we wish to. Click on Networking Options
and it will show the configurable properties.
In the Advanced Settings you can configure Maintenance Window, Cluster Metadata and Labels as well.
Once everything is filled, hit Create
and wait for cluster creation to complete.
You can see that the currently Total vCPUs
and Total memory
are 0. That’s because there is nothing deployed on the cluster yet.
Next, we’ll deploy Google’s Kubernetes sample application. But first, lets connect to this cluster. You can connect to it via UI or via gcloud
command line from an authenticated machine.
via Cloud Console
This will open up cloud shell, with cloud command pre-populated.
via gcloud
command line
gcloud container clusters get-credentials autopilot-cluster-1 --region us-central1 --project <PROJECT-ID>
Next, lets clone the sample application repository from Github and deploy the application.
git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/guestbook
kubectl apply -f .
You’ll see the deployments and services created.
Once deployed lets see if pods are up.
kubectl get pods
You should now also see Total vCPUs
and Total Memory
are populated on the cluster page.
This deployment creates an external load balancer service. Get all services to get the external IP of the load balancer.
kubectl get services
Go to the EXTERNAL-IP
that you see and you’ll set the UI loading up.
Conclusion
As we saw with the demo, we had to do a lot less configuration for GKE Autopilot cluster and GKE automatically provisioned underlying compute based on the workload’s requirements.
Autopilot is a great feature for enterprises looking to quickly deploy their applications on GKE without the headache of calculating optimum size of node pool and machine types.
And that’s how you create an Autopilot cluster and deploy workloads on it.
If you find any issues in the code or have any question in general, feel free to drop a comment.
Till then Happy Coding! :)