GCP PlayCloud Labs
-
GCP PlayCloud Labs
-
Guided Lab: How to Launch a GCP Compute Engine Linux Instance
-
Guided Lab: Creating a VM Using Instance Templates
-
Guided Lab: Creating and Managing Instance Groups in Compute Engine
-
Guided Lab: Creating a Spot VM Instance
-
Guided Lab: Configuring Shielded VM Options
-
Guided Lab: Exploring Instance Metadata in Google Cloud
-
Guided Lab: Vertically Scaling a VM Instance
-
Guided Lab: Setting up a Web Server on a VM Instance
-
Guided Lab: Using Startup Scripts in GCP VM Instances
-
Guided Lab: Creating a Custom Image from a VM Instance with Web Server in Google Cloud
-
Guided Lab: Creating VM Snapshots and Restoring a VM from a Snapshot
-
Guided Lab: Setting Up and Managing a Database on a VM Instance
-
Guided Lab: Installing WordPress on an Ubuntu VM Instance with LEMP Stack
-
Guided Lab: Deploying a LAMP Stack on a Compute Engine VM
-
Guided Lab: Reserving or Promoting a Static IP Address for a VM Instance
-
Guided Lab: SSH Access to GCP VM Instance from Local Machine using SSH Key Pair
-
Guided Lab: Guarding Your VM with Deletion Protection
-
Guided Lab: Setting Up a Linux Bastion Host on GCP
-
Guided Lab: Creating a Cloud Storage Bucket
-
Guided Lab: Uploading, Organizing, and Managing Objects in Cloud Storage
-
Guided Lab: Exploring Google Cloud Storage Classes
-
Guided Lab: Hosting a Static Website in Google Cloud Storage Bucket
-
Guided Lab: Protecting Data on Cloud Storage Bucket Against Accidental Delete and Overwrite Using Object Versioning
-
Guided Lab: Using Cloud Storage Lifecycle Rules to Automate Object Management
-
Guided Lab: Managing Cloud Storage Buckets via SSH Commands
-
Guided Lab: Creating a Cloud SQL Instance
-
Guided Lab: Running SQL Commands in Cloud SQL Studio
-
Guided Lab: Creating and Restoring Cloud SQL Backups
-
Guided Lab: Integrating Cloud SQL Database instance with a VM instance
-
Guided Lab: Connecting Cloud SQL Database with MySQL Workbench (Local)
-
Guided Lab: Guarding Your Cloud SQL Instances with Deletion Protection
-
Guided Lab: Creating a Cloud NAT Gateway
-
Guided Lab: Creating a Google Kubernetes Engine (GKE) Cluster
-
Guided Lab: Connecting to a Kubernetes Engine Cluster
-
Guided Lab: Deploying a Simple Web Application on GKE
-
Guided Lab: Creating a Custom Virtual Private Cloud (VPC)
-
Guided Lab: Establishing VPC Peering for Secure Cross‑Network Communication
-
Guided Lab: Configuring Firewall Rules to Secure and Access a VM
-
Guided Lab: Creating an Application Load Balancer
-
Guided Lab: Creating a Network Load Balancer
Guided Lab: Deploying a Simple Web Application on GKE
Description
Google Kubernetes Engine (GKE) allows you to run containerized applications in a managed Kubernetes environment. One of the best ways to understand how Kubernetes works is by deploying a simple application and observing how it runs inside a cluster.
In this guided lab, you’ll deploy a basic Hello World web application to an existing GKE cluster. You’ll create a Kubernetes Deployment to run the container and expose it using a Service so it can be accessed from a web browser. This lab provides hands-on experience with core Kubernetes concepts such as pods, deployments, and services.
Prerequisites
This lab assumes you have already created a Google Kubernetes Engine (GKE) cluster and are familiar with its basic components.
If you find any gaps in your knowledge, consider taking the following labs:
Objectives
In this lab, you will:
- Deploy a simple Hello World container to a GKE cluster
- Create a Kubernetes Deployment to manage the application
- Expose the application using a Service
- Access the application from a web browser
Lab Steps
Navigating to a GKE Cluster
1. In the Google Cloud console, go to the unified search bar at the top.
2. Type “Kubernetes” and select Kubernetes Engine from the results.

3. Click Clusters to view the list of available GKE clusters. Select the cluster that you want to connect to.

Connecting to the GKE Cluster
1. On the cluster details page, click Connect at the top of the page.

2. In the connection dialog, choose Run in Cloud Shell

3. You will be prompted to authorize Cloud Shell. Click Authorize, then enter the username and password of the account you are currently using.

4. Run the command to configure your local environment with the cluster’s credentials, allowing kubectl to access and manage the GKE cluster.

Deploying the Hello World Application
1. In Cloud Shell, deploy a simple Hello World container using the following command:
kubectl create deployment hello-world --image=gcr.io/google-samples/hello-app:1.0
2. Verify that the Deployment was created successfully:
kubectl get deployments
3. Verify that the pod is running:
kubectl get pods

Exposing and Accessing the Application
1. Expose the Deployment using a LoadBalancer Service:
kubectl expose deployment hello-world --type=LoadBalancer --port 8080
2. Verify that the Service was created:
kubectl get services
3. Wait a few minutes for an EXTERNAL-IP address to be assigned.
- Here, you can see initially that the EXTERNAL-IP address for the
hello-worldapplication is <pending>. Wait for a few minutes, then enter againkubectl get servicesuntil it has an assigned value on EXTERNAL-IP.

4. Once the external IP is available, copy the IP address from the Service output.

5. Open a new browser tab and paste the IP address, followed by port 8080.
<EXTERNAL-IP>:8080
- You should see a Hello World message displayed in the browser, confirming that the application is running successfully on GKE.

Well done! You’ve successfully deployed a simple Hello World web application to your Google Kubernetes Engine cluster and exposed it for external access. This guided lab helps you understand the basic workflow of deploying and running containerized applications on GKE. You can use the same deployment and service concepts covered in this lab to build and run more complex applications with multiple components. In future guided labs, we’ll build on this foundation by updating applications, scaling workloads, and exploring Kubernetes features such as self-healing, monitoring, and networking.