Google Kubernetes Engine — Autopilot

Sushil Kumar
5 min readFeb 25, 2021

--

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.

Source : Google Cloud Tech, YouTube

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

  1. Introducing GKE Autopilot
  2. Managed yet Flexible
  3. Pod level SLA and Billing
  4. Demo
  5. 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.

  1. GKE will provision compute resources based on the resource needs provided in Pod specs.
  2. GKE automatically decides what node size should be provisioned based on the application spec.
  3. 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.

  1. The billing happens for per second vCPU, memory and disk used.
  2. 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 .

Option to choose Standard or Autopilot cluster

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.

Autopilot cluster features

We have to provide Name and Region and we are good to go.

Autopilot Cluster — Basic Settings

We can however, configure the networking options as well if we wish to. Click on Networking Options and it will show the configurable properties.

Autopilot Cluster — Networking Options

In the Advanced Settings you can configure Maintenance Window, Cluster Metadata and Labels as well.

Autopilot Cluster — Advanced Settings

Once everything is filled, hit Create and wait for cluster creation to complete.

Autopilot Cluster in Running state

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

Connect to Autopilot Cluster

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>
Authenticated Cluster

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
Sample Application Running

You should now also see Total vCPUs and Total Memory are populated on the cluster page.

Autopilot Cluster — Scaled up

This deployment creates an external load balancer service. Get all services to get the external IP of the load balancer.

kubectl get services
Services created by Guestbook Application

Go to the EXTERNAL-IP that you see and you’ll set the UI loading up.

Guestbook application deployed on Autopilot Cluster

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! :)

--

--

Sushil Kumar

A polyglot developer with a knack for Distributed systems, Cloud and automation.