Back to blog
Jul 05, 2024
2 min read

AutoPilot with GKE

AutoPilot with GKE is Google Cloud's solution for running a fully managed Kubernetes environment. It takes the complexity out of managing your Kubernetes clusters, allowing you to focus on what really matters - your applications

In the Google Cloud console navigation menu, click Kubernetes Engine.

img01

On the Create an Autopilot cluster page, do the following:

  • In the Name field, enter my-autopilot-cluster.
  • In the Region field, select us-central1.
  • Click Create.

img02

This operation might take some time to complete.

To open Cloud Shell, click Cloud Shell button

img03

This operation might take some time to complete.

Clone the sample app from GitHub:

git clone https://github.com/GoogleCloudPlatform/microservices-demo.git

Open the directory with the sample code on Cloud Shell Editor:

cloudshell workspace microservices-demo

This operation might take some time to complete.

img03

To add a GKE cluster, do the following:

  • In the View menu, click Command Palette. img04

  • Enter add cluster, and then click Add a Cluster to the KubeConfig. img05

  • Select Google Kubernetes Engine. img06

This operation might take some time to complete.

Once available, select my-autopilot-cluster us-central1. img07

You new GKE cluster appears in the Clusters section. To check the status of your cluster, click Bell button. img08

In the Terminal menu, select New Terminal. img09

Deploy the application to your cluster:

kubectl apply -f ./release/kubernetes-manifests.yaml

The output is similar to the following:

deployment.apps/adservice created
service/adservice created

img10

In the integrated terminal, get the external IP address of the service:

kubectl get services

Record the external IP address for the frontend-external Service. You need it later.

You might need to wait several minutes before the service’s external IP address populates. If the application’s external IP is pending, run kubectl get services again. img11

In a web browser, enter the address for your application: http://EXTERNAL-IP

Replace EXTERNAL-IP with the external IP address copied in the previous step. You have successfully deployed a sample app to GKE in Autopilot. img12