Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you restart it, you'll have to start from the beginning.
- Click Start lab to begin
Clone the Repository
/ 20
Add cluster to the KubeConfig
/ 20
Deploy the App
/ 20
Test the App
/ 20
Delete App from cluster
/ 20
Google Kubernetes Engine (GKE) Autopilot is a new managed mode of operation in which Google creates, sizes, and automatically scales on your behalf the physical infrastructure needed to run your application workloads.
In this lab, you get hands-on practice containerizing an application and deploying it to an GKE Autopilot cluster using a Kubernetes configuration and commands.
On GKE your compute infrastructure consists of nodes based on individual compute instances.
A group of nodes is called a cluster.
Powering GKE is Kubernetes, an open source cluster orchestration platform that is heavily influenced by over fifteen years of Google's experience running production workloads in containers.
Kubernetes draws on the same design principles for running popular Google services at global scale to provide:
With GKE Autopilot, you reap the benefits of Google's ability to optimize and configure a cluster using best practices for high availability and security, monitor the health of the cluster, and recalculate the cluster capacity needed to run your workloads at any given moment.
GKE Autopilot liberates you, the developer, to focus on application development, and not operational maintenance. You're still using Kubernetes to run the mission-critical mix of stateless and stateful services your application requires.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
An integrated development environment (IDE) with the Cloud Code extension has already been set up to easily deploy workloads to a GKE cluster. This lab is using Cloud Code to access Google Cloud products and services. You can view information about your cluster resources from the editor or via the command line.
Copy the IDE
URL from the Lab details panel.
Paste it into a new browser window:
The first task is to clone a repo with the code to be run. Retrieve the source code under version control to begin the lab.
In your Cloud Code environment, select the Source Control button from the sidebar.
Click the Clone Repository button.
Paste the following GitHub repository into the prompted search bar:
Click Clone from URL in the dropdown list under the search bar.
Click OK to confirm the location.
Yes I trust the Authors
.
When prompted to open the folder of the repo, click Open.
Click Check my progress to verify the objective.
GKE Autopilot has been pre-provisioned within the lab. In this section, you will update the environment KubeConfig to point to the cluster. Once the update is complete, you can then commence the deployment of the demo application.
Visit the Navigation Menu and select Terminal > New Terminal.
kubectl
and custom Kubernetes clients contain provider-specific code to manage authentication between the client and Google Kubernetes Engine.
Starting with v1.26, this code will no longer be included as part of the OSS kubectl.gke-gcloud-auth-plugin
, uses the Kubernetes Client-go Credential Plugin mechanism to extend kubectl’s authentication to support GKE.Add the cluster credentials to the local kube-config
Expected output:
Click Check my progress to verify the objective.
Before you can deploy an application, you need a container for that application.
In this environment, you will utilize a skaffold
manifest which builds the web
and vote
containers.
The lab uses artifact registry
to host the container images and then deploys the images using Kubernetes manifests.
Open a terminal, if one is not available
Change to the application folder
Set the region for the deployment
Use skaffold to deploy the source application
Click Check my progress to verify the objective.
Now test that the application is working as specified.
Launch a new terminal to test the application.
Run the command below to verify the web-external
load balancer has been created
Open a new tab in your browser
Enter the IP value returned as a HTTP site
Expected output:
Vote for either TABS or SPACES.
Update the voting app URL as follows:
Example output:
Click Check my progress to verify the objective.
Great job! You now have your voting application deployed to a cluster. GKE Autopilot has taken care of the management of the Kubernetes infrastructure.
Terminate your application by pressing CTRL-C
in the terminal running the application.
Tell Skaffold
to delete the resources
Expected output:
Click Check my progress to verify the objective.
You have just deployed a containerized application to Google Kubernetes Engine! In this lab you have performed the following tasks:
This lab is part of a series of labs called Qwik Starts. These labs are designed to give you some experience with the many features available on Google Cloud. Search for "Qwik Starts" in the Cloud Skills Boost catalog to find the next lab you'd like to take!
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated June 03, 2024
Lab Last Tested June 03, 2024
Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.