실습 설정 안내 및 요구사항
계정과 진행 상황을 보호하세요. 이 실습을 실행하려면 항상 시크릿 브라우저 창과 실습 사용자 인증 정보를 사용하세요.

Pod Deployment in GKE Infrastructure

실습 30분 universal_currency_alt 크레딧 1개
info 이 실습에는 학습을 지원하는 AI 도구가 통합되어 있을 수 있습니다.
이 콘텐츠는 아직 휴대기기에 최적화되지 않음
최상의 경험을 위해 데스크톱 컴퓨터에서 이메일로 전송된 링크를 사용하여 방문하세요.

GSP488

Google Cloud self-paced labs logo

Overview

A GKE Pod is the smallest deployable unit in Google Kubernetes Engine (GKE) and Kubernetes overall. It represents a single instance of a running process in a GKE cluster. Pods are designed to be temporary and disposable. If a Pod fails (due to a crash or Node failure), Kubernetes typically deletes it and creates a new Pod to replace it, rather than repairing the old one.

A Pod typically holds one primary application container (e.g., a web server, a database). It may also hold optional sidecar containers that perform auxiliary tasks like logging, monitoring, or acting as proxies for the main application container.

What you'll learn or Objectives

  • Create the minimal GKE infrastructure.
  • Deploy a simple, single-container Pod.
  • Verify the deployment.
  • Delete the cluster.

Setup and requirements

Before you click the Start Lab button

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 are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. 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.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Activate Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

  1. Click Activate Cloud Shell Activate Cloud Shell icon at the top of the Google Cloud console.

  2. Click through the following windows:

    • Continue through the Cloud Shell information window.
    • Authorize Cloud Shell to use your credentials to make Google Cloud API calls.

When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:

Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

  1. (Optional) You can list the active account name with this command:
gcloud auth list
  1. Click Authorize.

Output:

ACTIVE: * ACCOUNT: {{{user_0.username | "ACCOUNT"}}} To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (Optional) You can list the project ID with this command:
gcloud config list project

Output:

[core] project = {{{project_0.project_id | "PROJECT_ID"}}} Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.

Set the Compute Zone

In Cloud Shell set the default compute zone for your cluster:

gcloud config set compute/zone {{{project_0.default_zone | ZONE}}}

Task 1. Create a GKE cluster

  1. Create a small cluster named my-cluster:
gcloud container clusters create my-cluster

This command provisions the Control Plane and a default number of worker Nodes (VMs) in your specified zone. This can take several minutes to complete.

  1. Once the cluster is ready, GKE automatically configures kubectl (the Kubernetes command-line tool) to point to your new cluster. You can verify the connection by running the following:
kubectl get nodes

You should see your Nodes listed with a Ready status.

Click Check my progress to verify your performed task. Create a GKE cluster

Task 2. Deploying and interacting with a Pod

Now that the infrastructure is ready, you will deploy a basic Pod running an Nginx web server.

Create the Pod configuration file

  1. A Pod is defined using a YAML manifest file. Use the Cloud Shell editor or nano to create a file named nginx-pod.yaml:
nano nginx-pod.yaml
  1. Paste the following YAML content into the file:
apiVersion: v1 kind: Pod metadata: name: nginx-test-pod labels: app: nginx spec: containers: - name: nginx-container image: nginx:latest ports: - containerPort: 80

This manifest declares a Pod with the name nginx-test-pod. It instructs Kubernetes to run one container based on the public nginx:latest image and expose port 80 internally within the Pod.

  1. Save and exit the editor (CTRL+O, then ENTER, then CTRL+X if using nano).

  2. To deploy your manifest, execute the following command:

kubectl apply -f ./nginx-pod.yaml Note: You may need to wait a few minutes for the pod deployment to complete and the status change to running.

Click Check my progress to verify your performed task. Create and deploy the Pod configuration file

Task 3. Interact with the Pod

  1. First, check the status of the newly created Pod:
kubectl get pods
  1. Since Pods are assigned private cluster IPs, you can use port-forwarding to temporarily access the Nginx web page from the Cloud Shell environment:
kubectl port-forward nginx-test-pod 8080:80

This command maps local Cloud Shell port 8080 to Pod port 80.

  1. Leave this command running in the current terminal tab. You will open a second Cloud Shell tab in the next step.

Task 4. Test the application

  1. Open a new Cloud Shell tab by clicking the + button next to the current tab. Use curl to access the Nginx server through the forwarded port:
curl http://localhost:8080
  1. You should receive the default Nginx welcome HTML page, confirming the Pod is running and serving content.

Task 4. Cleanup

In a production environment, you should delete unused clusters to stop incurring charges. Practice doing that now.

  1. In your primary Cloud Shell tab (where you ran the cluster creation command), stop the port-forwarding (if still running) with CTRL+C.

  2. Then, delete the cluster by running the following:

gcloud container clusters delete my-cluster --zone {{{project_0.default_zone|ZONE}}}
  1. Type Y to confirm. This will clean up all associated resources (Nodes, Pods, etc.).

Click Check my progress to verify your performed task. Delete the cluster

Congratulations!

You have learned how the GKE cluster provides the managed computing environment, while the Pod runs the actual application code within that environment. This foundational knowledge is crucial for moving on to more complex, production-ready deployments.

Next Steps / Learn more

Add links to product documentation or other areas of interest here

Google Cloud training and certification

...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: September 29, 2025

Lab Last Tested: September 29, 2025

Copyright 2025 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.

시작하기 전에

  1. 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
  2. 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
  3. 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.

시크릿 브라우징 사용

  1. 실습에 입력한 사용자 이름비밀번호를 복사합니다.
  2. 비공개 모드에서 콘솔 열기를 클릭합니다.

콘솔에 로그인

    실습 사용자 인증 정보를 사용하여
  1. 로그인합니다. 다른 사용자 인증 정보를 사용하면 오류가 발생하거나 요금이 부과될 수 있습니다.
  2. 약관에 동의하고 리소스 복구 페이지를 건너뜁니다.
  3. 실습을 완료했거나 다시 시작하려고 하는 경우가 아니면 실습 종료를 클릭하지 마세요. 이 버튼을 클릭하면 작업 내용이 지워지고 프로젝트가 삭제됩니다.

현재 이 콘텐츠를 이용할 수 없습니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

감사합니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

한 번에 실습 1개만 가능

모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.

시크릿 브라우징을 사용하여 실습 실행하기

이 실습을 실행하는 가장 좋은 방법은 시크릿 모드 또는 시크릿 브라우저 창을 사용하는 것입니다. 개인 계정과 학생 계정 간의 충돌로 개인 계정에 추가 요금이 발생하는 일을 방지해 줍니다.