Lab setup instructions and requirements
Protect your account and progress. Always use a private browser window and lab credentials to run this lab.

部署 Google Kubernetes Engine

Lab 1 hour universal_currency_alt 5 Credits show_chart Introductory
info This lab may incorporate AI tools to support your learning.
This content is not yet optimized for mobile devices.
For the best experience, please visit us on a desktop computer using a link sent by email.

總覽

在本研究室中,利用 Google Cloud 控制台建立 GKE 叢集並部署範例 Pod。

目標

在本研究室中,瞭解如何執行下列工作:

  • 使用 Google Cloud 控制台建立和操控 GKE 叢集
  • 使用 Google Cloud 控制台部署 Pod
  • 使用 Google Cloud 控制台檢查叢集和 Pod

設定研究室

在每個研究室中,您都能在固定時間內免付費建立新的 Google Cloud 專案,並使用一組資源。

  1. 請透過無痕式視窗登入 Qwiklabs。

  2. 請記下研究室的存取時間 (例如 1:15:00),並確保自己能在時間限制內完成作業。
    研究室不提供暫停功能。如有需要,您可以重新開始,但原先的進度恕無法保留。

  3. 準備就緒後,請按一下「Start lab」

  4. 請記下研究室憑證 (使用者名稱密碼),這組資訊將用於登入 Google Cloud 控制台。

  5. 按一下「Open Google Console」

  6. 按一下「Use another account」,然後複製這個研究室的憑證,並貼入提示訊息。
    如果使用其他憑證,系統會顯示錯誤或向您收取費用

  7. 接受條款,然後略過資源復原頁面。

完成初始登入步驟後,就會看到專案資訊主頁。

工作 1:部署 GKE 叢集

您將在這項工作中,使用 Google Cloud 控制台和 Cloud Shell 部署 GKE 叢集。

使用 Google Cloud 控制台部署 GKE 叢集

  1. 在 Google Cloud 控制台的「導覽選單」「導覽選單」圖示 中,依序點選「Kubernetes Engine」>「叢集」

  2. 點選「建立」,開始建立 GKE 叢集。

  3. 點選畫面右上方的「切換為 Standard 叢集」切換作業模式。

  4. 點選「切換為 Standard 叢集」來確認操作。

  5. 檢查控制台使用者介面和控制選項,以變更叢集名稱、叢集位置、Kubernetes 版本、節點數量和節點資源,例如預設節點集區內的機器類型。

可以在跨區域或單一可用區中建立叢集。預設為單一可用區。在區域各處部署時,節點會部署到三個不同的可用區,且部署的節點總數會增加三倍。

  1. 將叢集名稱變更為 standard-cluster-1,並將可用區變更為 。保留所有預設數值,然後按一下「Create」(建立)

叢集開始佈建。

注意:須等待數分鐘才能完成叢集部署作業。

佈建完成後,「Kubernetes Engine」>「叢集」頁面會如螢幕截圖所示:

叢集頁面

點選「Check my progress」來確認目標已達成。 部署 GKE 叢集

  1. 點選叢集名稱 standard-cluster-1,查看叢集的詳細資料。
  2. 向下捲動頁面,查看更多詳細資料。
  3. 在最上方的叢集名稱 (standard-cluster-1) 下,點選「儲存空間」及「節點」分頁標籤,檢視叢集詳細資料。

工作 2:修改 GKE 叢集

使用 Google Cloud 控制台或 Cloud Shell,可以輕鬆修改現有叢集的許多參數。在這項工作中,您會使用 Google Cloud 控制台修改 GKE 叢集的大小。

  1. 在 Google Cloud 控制台的「導覽選單」「導覽選單」圖示 中,依序點選「Kubernetes Engine」>「叢集」>「standard-cluster-1」,然後按一下詳細資料頁面頂端的「節點」
  2. 在「節點集區」部分,點選「default-pool」
  3. 在 Google Cloud 控制台中,點選「節點集區詳細資料」頁面上方的「調整大小」
  4. 將節點數量由 3 改為 4,並點選「調整大小」

位於「節點集區詳細資料」頁面的「調整大小」按鈕

  1. 在 Google Cloud 控制台的「導覽選單」「導覽選單」圖示 中,依序點選「Kubernetes Engine」>「叢集」

作業完成後,依序前往「Kubernetes Engine」>「叢集」頁面,會看到 standard-cluster-1 現在有四個節點。

點選「Check my progress」來確認目標已達成。 修改 GKE 叢集

工作 3:部署範例工作負載

在這項工作中,您將使用 Google Cloud 控制台,部署執行 nginx 網路伺服器的 Pod 做為範例工作負載。

  1. 在 Google Cloud 控制台的「Navigation menu」(導覽選單) (「導覽選單」圖示) 中,依序點選「Kubernetes Engine」>「Workloads」(工作負載)
  2. 點選「Create Deployment」(建立部署作業),隨即會顯示「Create a deployment」(建立部署作業) 精靈。
  3. 點選「Continue」(繼續),接受預設的容器映像檔 nginx:latest。這個映像檔會部署 3 個 Pod,每個 Pod 都具備一個執行最新版 nginx 的容器。
  4. 捲動至視窗底部,點選「部署」按鈕,並將「設定」詳細資料保留預設值。
  5. 部署完成後,畫面將重新整理,並顯示新的 nginx 部署作業詳細資料。

點選「Check my progress」來確認目標已達成。 部署 nginx 示範工作負載

工作 4:在 Google Cloud 控制台中檢視工作負載的詳細資料

在這項工作中,您會直接在 Google Cloud 控制台中查看 GKE 工作負載的詳細資料。

  1. 在 Google Cloud 控制台的「導覽選單」「導覽選單」圖示 中,依序點選「Kubernetes Engine」>「工作負載」
  2. 在 Google Cloud 控制台中,依序前往「Kubernetes Engine」>「工作負載」頁面,然後點選「nginx-1」

這裡會顯示工作負載總覽資訊,包括資源使用率圖表、記錄檔連結、與這項工作負載相關聯的 Pod 詳細資料等。

  1. 在 Google Cloud 控制台中,點選 nginx-1 工作負載的「詳細資料」分頁標籤。這個分頁會顯示更多工作負載的詳細資料,例如 Pod 規格、Pod 備用資源的數量與狀態,以及水平 Pod 自動配置器的詳情。

  2. 點選「修訂版本記錄」分頁標籤。這裡會顯示這項工作負載的修訂版本清單。

  3. 點選「事件」分頁標籤。此分頁會列出與這項工作負載相關聯的事件。

  4. 然後是「YAML」分頁。此分頁提供完整的 YAML 檔案,定義了這項範例工作負載的元件和完整設定。

  5. 還是在 Google Cloud 控制台的 nginx-1 工作負載「詳細資料」分頁中,點選「總覽」分頁標籤,向下捲動至「代管的 Pod」,按一下其中一個 Pod 名稱,查看該 Pod 的詳細資料頁面。

  6. 「Pod 詳細資料」頁面提供 Pod 設定、資源使用率,以及執行 Pod 的節點等資訊。

  7. 在「Pod 詳細資料」頁面中點選「事件」與「記錄檔」分頁標籤,查看事件詳細資料,以及連至 Cloud 作業套件中容器記錄檔的連結。

  8. 點選「YAML」分頁標籤,查看 Pod 設定的詳細 YAML 檔案。

關閉研究室

如果您已完成研究室,請按一下「End Lab」(關閉研究室)。Google Cloud Skills Boost 會移除您使用的資源,並清除所用帳戶。

您可以針對研究室的使用體驗評分。請選取合適的星級評等並提供意見,然後按一下「Submit」(提交)

星級評等代表您的滿意程度:

  • 1 星 = 非常不滿意
  • 2 星 = 不滿意
  • 3 星 = 普通
  • 4 星 = 滿意
  • 5 星 = 非常滿意

如果不想提供意見回饋,您可以直接關閉對話方塊。

如有任何想法、建議或指教,請透過「Support」(支援) 分頁提交。

Copyright 2026 Google LLC 保留所有權利。Google 和 Google 標誌是 Google LLC 的商標,其他公司和產品名稱則有可能是其關聯公司的商標。

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

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

Use private browsing to run the lab

Using an Incognito or private browser window is the best way to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.