Ends in
00
hrs
00
mins
00
secs
SHOP NOW

💝 48-Hour Valentine's Sale Extension! Get 30% OFF Any Reviewer. Use coupon code: VDAYSALE2026 & 5% OFF Store Credits/Gift Cards

Back to Course

GCP PlayCloud Labs

0% Complete
0/0 Steps
  1. GCP PlayCloud Labs
  2. Guided Lab: How to Launch a GCP Compute Engine Linux Instance
  3. Guided Lab: Creating a VM Using Instance Templates
  4. Guided Lab: Creating and Managing Instance Groups in Compute Engine
  5. Guided Lab: Creating a Spot VM Instance
  6. Guided Lab: Configuring Shielded VM Options
  7. Guided Lab: Exploring Instance Metadata in Google Cloud
  8. Guided Lab: Vertically Scaling a VM Instance
  9. Guided Lab: Setting up a Web Server on a VM Instance
  10. Guided Lab: Using Startup Scripts in GCP VM Instances
  11. Guided Lab: Creating a Custom Image from a VM Instance with Web Server in Google Cloud
  12. Guided Lab: Creating VM Snapshots and Restoring a VM from a Snapshot
  13. Guided Lab: Setting Up and Managing a Database on a VM Instance
  14. Guided Lab: Installing WordPress on an Ubuntu VM Instance with LEMP Stack
  15. Guided Lab: Deploying a LAMP Stack on a Compute Engine VM
  16. Guided Lab: Reserving or Promoting a Static IP Address for a VM Instance
  17. Guided Lab: SSH Access to GCP VM Instance from Local Machine using SSH Key Pair
  18. Guided Lab: Guarding Your VM with Deletion Protection
  19. Guided Lab: Setting Up a Linux Bastion Host on GCP
  20. Guided Lab: Creating a Cloud Storage Bucket
  21. Guided Lab: Uploading, Organizing, and Managing Objects in Cloud Storage
  22. Guided Lab: Exploring Google Cloud Storage Classes
  23. Guided Lab: Hosting a Static Website in Google Cloud Storage Bucket
  24. Guided Lab: Protecting Data on Cloud Storage Bucket Against Accidental Delete and Overwrite Using Object Versioning
  25. Guided Lab: Using Cloud Storage Lifecycle Rules to Automate Object Management
  26. Guided Lab: Managing Cloud Storage Buckets via SSH Commands
  27. Guided Lab: Creating a Cloud SQL Instance
  28. Guided Lab: Running SQL Commands in Cloud SQL Studio
  29. Guided Lab: Creating and Restoring Cloud SQL Backups
  30. Guided Lab: Integrating Cloud SQL Database instance with a VM instance
  31. Guided Lab: Connecting Cloud SQL Database with MySQL Workbench (Local)
  32. Guided Lab: Guarding Your Cloud SQL Instances with Deletion Protection
  33. Guided Lab: Creating a Cloud NAT Gateway
  34. Guided Lab: Creating a Google Kubernetes Engine (GKE) Cluster
  35. Guided Lab: Connecting to a Kubernetes Engine Cluster
  36. Guided Lab: Deploying a Simple Web Application on GKE
  37. Guided Lab: Creating a Custom Virtual Private Cloud (VPC)
  38. Guided Lab: Establishing VPC Peering for Secure Cross‑Network Communication
  39. Guided Lab: Configuring Firewall Rules to Secure and Access a VM
  40. Guided Lab: Creating an Application Load Balancer
  41. Guided Lab: Creating a Network Load Balancer
Lesson 36 of 41
In Progress

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-world application is <pending>. Wait for a few minutes, then enter again kubectl get services until 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.

Skip to content