This document explains how to plan and design your cluster by prompting Gemini.
Compute Advisor is an AI-powered interface in the Google Cloud console, powered by Gemini, that helps you evaluate hardware options, estimate deployment costs, and view recommended configurations for your clusters. To tailor its recommendations, Gemini evaluates your Google Cloud project by checking your quota limits, existing reservations, committed use discounts (CUDs), default region and zone, and any resource location constraints. By using Gemini to help with your planning, you can reach an optimal configuration for your workload before you create or modify a GKE cluster.
To learn more about the components that you must configure before or when you create a GKE cluster, see GKE overview.
Limitations
When you prompt Gemini in the Google Cloud console, you can't create, modify, or delete resources by using Gemini.
Before you begin
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
Required roles
To get the permissions that
you need to access and prompt Gemini,
ask your administrator to grant you the
Kubernetes Engine Cluster Viewer (roles/container.clusterViewer) IAM role on the project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to access and prompt Gemini. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to access and prompt Gemini:
-
To view a list of clusters:
container.clusters.list
You might also be able to get these permissions with custom roles or other predefined roles.
Access Gemini in the Google Cloud console
To access Gemini in the Google Cloud console, complete the following steps:
In the Google Cloud console, go to the Overview page.
In the Design your infrastructure with Compute Advisor section, you can view the following:
The UI elements that are displayed in the preceding screenshot are the following:
Quick-action prompt cards: a set of cards that each contain a sample prompt. If you click a card, then Google Cloud console automatically populates the prompt box with the sample prompt.
Prompt box: this field lets you enter and submit prompts. To submit a prompt, click Submit prompt.
View previous conversations: this feature lets you view the details of a past conversation and resume it, or delete conversations if you no longer need them.
Conversation history side panel: shows your recent chats. This panel is visible only after you start prompting from the Overview page. You can interact with this panel as follows:
To start a new conversation, click New chat.
To resume a recent conversation, in the Recent chats section, click the conversation.
To view a list of all your conversations, click View all. On the My history page, you can view the details of a past conversation and resume it, or delete conversations if you no longer need them.
Prompt Gemini
After you submit a prompt, Gemini starts to generate a response. A pane appears and Google Cloud console displays the response to your prompt in the pane, as shown in the following screenshot:
Based on your prompt, the response pane includes the following elements:
Contextual grounding: Gemini automatically evaluates your project context to deliver highly tailored recommendations, including quota limits, existing reservations, CUDs, your default region and zone, and any resource location constraints.
Interactive code snippets: Gemini generates gcloud commands, REST API methods, or Terraform resources. You can copy and paste these code snippets or run them in Cloud Shell.
Visual canvas: Gemini organizes recommendations into structured tables and side-by-side comparisons. This view helps you evaluate product features and architectural approaches. It also provides an implementation plan for your use case.
The following sections outline the best practices for writing prompts, and example prompts that you can use before you create or modify a GKE cluster.
Best practices for prompting
To get the most accurate and actionable recommendations from Gemini, we recommend that you structure your prompts in the same way that you would do a code block. This approach guides the generative AI by using clear parameter declarations, role definitions, specific instructions, and explicit output formats.
When you prompt Gemini, consider the following best practices:
Focus on design and planning: we recommend that you don't prompt Gemini for troubleshooting GKE cluster errors. To resolve these errors, see instead Troubleshoot GKE.
Specify a persona or role: declare a target role or persona, such as an IT administrator, AI researcher, or platform engineer, for Gemini to adopt. This approach guides the tone, depth, and expertise level of the resulting recommendations.
Provide explicit, numbered instructions: break your objective down into concrete, step-by-step questions or tasks. This approach structures the Gemini's reasoning process and helps ensure that Gemini addresses all of your requirements.
Define a specific output format: explicitly state how you want the recommendation to be formatted, such as a walkthrough explanation, a Markdown comparison table, or a ready-to-use gcloud code block.
Leverage automatic context grounding: you don't need to include your default region or zone, available quotas, CUDs, or resource location constraints into your prompt. Gemini can access this information in your Google Cloud project.
Iteratively refine your designs: you can modify or expand the response that Gemini generated by sending new prompts. For example, you can ask the assistant to add networking recommendations to your deployment plan or modify the storage requirements without starting a new conversation.
Example prompts
The following are examples of prompts that you can use to help you design and optimize your GKE cluster:
Cluster topology and node pool configuration: to determine the optimal GKE mode, machine types, and node pool configurations for a workload, use a prompt like the following:
Act as a cloud architect. I need to design a GKE cluster topology for a scalable microservices application that requires both GPU nodes for AI inference and CPU nodes for general-purpose APIs. Please provide the following: 1. A comparison of running this workload on GKE Autopilot versus GKE Standard. 2. Recommendations for GKE machine types for the GPU node pool. 3. The optimal autoscaling and auto-provisioning settings. Format the comparison as a Markdown table, and provide the cluster creation steps as a ready-to-use gcloud CLI command.Provisioning model and cost optimization: to evaluate provisioning models and optimize resource utilization for batch processing workloads, use a prompt like the following:
Act as an IT administrator. I need to design a cost-optimized GKE cluster to run large-scale batch processing workloads that are fault-tolerant. Please provide the following: 1. A cost and reliability comparison of using Spot VMs versus standard VMs in GKE node pools. 2. An explanation of how to configure Kueue for queueing training jobs. 3. A manifest snippet configuration to deploy the workloads onto Spot VM nodes. Format the comparison as a Markdown table, and provide the manifest as a ready-to-use code block.