本頁面中的部分或全部資訊可能不適用於 Trusted Cloud by S3NS。
將應用程式部署至 aarch64、AMD64 或混合架構的 GKE 叢集
根據預設,Skaffold 會自動偵測目標叢集的架構,並建構與工作站架構相符的映像檔,即使目標叢集的架構是混合型 (x86 和 Arm) 也一樣。
您也可以選擇在 IDE 中新增環境變數,或是在 skaffold.yaml
檔案中新增參數,指定要建構的平台,這樣做可覆寫 Skaffold 的自動偵測功能。
如果您想在建構映像檔時覆寫 Skaffold 的自動偵測功能,可以透過下列方式指定要為哪個平台建構映像檔:
下列清單列出 IDE 環境變數欄位中 SKAFFOLD_PLATFORM
環境變數的可能值。您也可以在 CLI 的 --platform
標記或 skaffold.yaml
檔案的 platforms
參數中使用這些值:
x86 |
Arm |
amd64 |
aarch64 |
linux/amd64 |
linux/aarch64 |
將環境變數新增至 IDE 設定
如要將環境變數新增至 Cloud Code 設定,請按照下列步驟操作:
在 IDE 中,依序按一下「Run」 >「Edit Configurations」。
在「Run」分頁中,於「Advanced Settings」片段下方的「Environment variables」欄位中,輸入環境變數。
例如:SKAFFOLD_PLATFORM=linux/aarch64
這會覆寫 Skaffold 的自動偵測功能,並建構您指定的映像檔類型。skaffold.yaml
檔案則維持不變。
如要指定要為哪個平台建構映像檔,請將 platforms
參數新增至 skaffold.yaml
檔案:
build:
platforms: ["linux/aarch64"]
artifacts:
- image: example
如要進一步瞭解 Cloud Code 支援的 Arm 和混合架構 GKE 叢集,請參閱「Arm 支援」。
取得支援
如要在 IntelliJ IDE 中提交意見回饋或回報問題,請依序前往「Tools」
>「Cloud Code」
>「Help / About」
>「Submit feedback or report an issue」
,即可在
GitHub 上回報問題。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-15 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-15 (世界標準時間)。"],[[["Skaffold automatically detects the target cluster's architecture and builds a matching image, even in mixed-architecture environments."],["You can override Skaffold's automatic architecture detection by using the `SKAFFOLD_PLATFORM` environment variable in your IDE configurations."],["Alternatively, you can specify the build platform directly in your `skaffold.yaml` file using the `platforms` parameter."],["The `SKAFFOLD_PLATFORM` environment variable, `--platform` flag, or `platforms` parameter can be set to values like `amd64`, `linux/amd64`, `aarch64`, or `linux/aarch64` to define the desired architecture."]]],[]]