
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 end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Enable Gemini and grant IAM roles
/ 5
Deploy GKE Autopilot cluster
/ 5
Deploy a sample nginx workload
/ 5
Gemini for Google Cloud is an always-on AI collaborator that provides help to users of all skill levels where they need it. In this lab, you will learn how to use Gemini, an AI-powered collaborator in Google Cloud, to to create, test, and modify a Google Kubernetes Engine (GKE) cluster in Autopilot mode.
In this lab, you will learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
You will first enable Gemini in your Google Cloud project and configure the necessary permissions for your Google Cloud Qwiklabs user account.
Click on the Cloud Shell icon () in the top-right corner of the Google Cloud console toolbar.
To set your project ID and region environment variables, run the following commands:
Click Authorize if prompted.
Enable the Cloud AI Companion API for Gemini:
Adding these roles lets the user use Gemini assistance.
Click Check my progress to verify the objective.
In this task, you use the Google Cloud console and Cloud Shell to deploy GKE clusters.
For the following example, consider that you are an infrastructure admin who is responsible for setting up infrastructure for a team developing a web application. The organization at large has standardized on containers and Kubernetes, so the team wants to understand how to run their web application on Kubernetes in Google Cloud. The team also wants to understand how to do so with as little infrastructure management overhead as possible.
In this case, you have the existing GKE cluster running a set of microservices that make up an ecommerce web app. With Gemini assistance, you will now identify areas to improve.
Return to your tab with the Google Cloud console.
Refresh the Google Cloud console page.
Click on the Gemini icon () in the top-right corner of the Google Cloud console toolbar.
Click the Start Chatting button.
Enter the following prompt:
Gemini should respond with something similar to the following:
From the information that Gemini has provided, it looks like a GKE autopilot cluster will meet our needs.
In this task, you prompt Gemini on how to deploy a GKE Autopliot cluster.
Gemini responds with the instructions for creating a cluster using the Google Cloud console and instructions for creating a cluster using the Google Cloud CLI.
Gemini should respond with something similar to the following:
The command is copied to Cloud Shell.
Enter
to run the command.When provisioning is complete, the Kubernetes Engine > Clusters page looks like this screenshot:
You can scroll down the page to view more details.
Click Check my progress to verify the objective.
Now that you have created a GKE cluster in Autopilot mode, you now decide you would like to test running a sample web application similar to the web application your team will run on this infrastructure. Internally, you see that you have the following container image from Google us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0 bookmarked for testing a containerized web application:
Gemini will respond with something similar to:
Run the kubectl command in the Cloud Shell.
In the Gemini pane, enter the following prompt, and then click Send:
Gemini should respond with something similar to the following:
While providing more context is always helpful, notice how Gemini was able to pull the deployment name hello-server from the conversation history without it being included in the prompt.
In Cloud Shell, run the command provided by Gemini.
Now you want to see if the web server is running and serving requests properly. To view your deployed application, you need to retrieve the external IP address from the Kubernetes service you created.
Enter the following prompt:
Gemini should respond with something similar to the following:
After a few minutes, the above kubectl command will yield the result in an output similar to:
You should see the hello-app running in the tab.
Click Check my progress to verify the objective.
When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
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.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one