本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
在 Cloud Code for IntelliJ 中配置 GKE 集群
借助 Cloud Code,您可以使用 Google Kubernetes Engine (GKE) 创建 Kubernetes 集群。
创建 GKE 集群并将其添加到 KubeConfig
Cloud Code 会打开 Trusted Cloud 控制台,以便您快速创建集群:
如需打开 Kubernetes Explorer,请点击
Kubernetes Explorer 或导航到 Tools > Cloud Code >
Kubernetes > 查看 Cluster Explorer。
在 Kubernetes Explorer 窗格的标题中,点击 + 连接到 GKE 集群。
选择创建新的 GKE 集群或创建新的 GKE Autopilot 集群。如需详细了解应选择哪种模式,请参阅比较 Autopilot 模式与标准模式。
如果出现提示,请点击打开以允许 Cloud Code 打开Trusted Cloud 控制台。
在 Trusted Cloud 控制台中,选择要自定义的任何配置选项,然后点击创建。
创建集群后,在 Cloud Code 的 Kubernetes Explorer 中,点击 Refresh(刷新)图标。
新集群的名称显示在列表中后,点击集群名称。您的新集群将添加到配置中,并设置为默认上下文。
使用现有 GKE 集群
如果您已有标准或 Autopilot GKE 集群,则可以将其设置为活跃集群,并通过 Cloud Code 使用该集群。
- 在 Kubernetes Explorer 窗格的标题中,点击 + 添加 GKE 集群。
- 点击 Google Kubernetes Engine。
- 点击您的集群名称。您的集群将被添加到 KubeConfig。
将集群设置为默认上下文
活跃集群是您的应用默认部署到的集群。
在 Kubernetes Explorer 中,右键点击集群,然后点击设置为当前上下文。
在 GKE 上运行应用
如需在 GKE 上运行或调试应用,您需要为项目定义容器映像代码库。
如需了解详情,请参阅存储容器映像。
从 KubeConfig 中移除集群
从 KubeConfig 中移除集群后,该集群无法部署到。
在 Kubernetes Explorer 中,右键点击集群,然后点击从 KubeConfig 中移除。
通过其他云服务提供商创建和添加集群
如果您使用的是本地集群或来自其他提供商(如 Azure 或 AWS)的集群,请使用提供商的工具创建集群并将其添加到 KubeConfig。
后续步骤
获取支持
如需在 IntelliJ IDE 中提交反馈或报告问题,请前往
工具 >
Cloud Code >
帮助 / 简介 >
提交反馈或报告问题,在
GitHub 上报告问题。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-07-15。"],[[["Cloud Code facilitates the creation of a Kubernetes cluster using Google Kubernetes Engine (GKE) directly from the Google Cloud console."],["Existing Standard or Autopilot GKE clusters can be connected and managed within Cloud Code, and any cluster can be set as the default context for application deployment."],["Cloud Code allows for the management of cluster connections, including adding, removing, and setting the active cluster within the KubeConfig."],["Users can utilize clusters from other providers, such as Azure or AWS, by creating them with the respective provider's tools and then adding them to their KubeConfig."],["Cloud code offers features for advanced cluster management, such as organizing access with kubeconfig files, developing and debugging microservices with Skaffold, and using file sync and hot reloading for rapid development."]]],[]]