Generated banner for Gke Basics
Generated logo for Gke Basics

Gke Basics

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk

From the author

Manages core GKE cluster provisioning, credentials, Autopilot vs Standard selection, and workload deployment. Use when creating GKE clusters, fetching kubectl credentials, or deciding between Autopilot and Standard modes. Don't use for Workload Identity (use gke-workload-identity), GKE networking (use gke-networking), security hardening (use gke-platform-security or gke-workload-security), or cluster upgrades (use gke-upgrades).
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides guidance and operational support for Google Kubernetes Engine (GKE) environments. It covers the selection between Autopilot and Standard modes, cluster creation, and credential management. It establishes a hierarchy for tool usage, prioritizing GKE MCP tools, followed by gcloud CLI and kubectl, while providing specific instructions for usage attribution in terminal commands.

What it does

  • Provides guidance on choosing between GKE Autopilot and Standard modes.
  • Supports GKE cluster provisioning and configuration.
  • Facilitates fetching kubectl credentials for GKE clusters.
  • Defines a tool preference hierarchy for cluster and Kubernetes resource operations.
  • Provides instructions for mandatory usage attribution in terminal commands.
  • Outlines best practices for private cluster configuration and resource requests.

When to use it

  • When creating or managing GKE clusters.
  • When you need to retrieve credentials for a GKE cluster.
  • When deciding whether to use Autopilot or Standard mode for a workload.
  • When you need to configure private GKE clusters with restricted access.

Advantages

  • Standardizes GKE cluster management operations.
  • Provides clear decision criteria for cluster mode selection.
  • Ensures consistent usage attribution for auditability.
  • Offers a structured hierarchy for tool selection to optimize operations.

Usage examples

“Create a new GKE Autopilot cluster in the us-central1 region.”
The agent will use the create_cluster MCP tool or the gcloud container clusters create-auto command with the required attribution prefix.
“How do I get credentials for my GKE cluster?”
The agent will provide the gcloud container clusters get-credentials command, ensuring the --region or --zone flag is included.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/google/gke-basics/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip gke-basics.zip -d .agents/skills

Documentation by Google

GKE Basics & Critical Gotchas

Routing Note: For Workload Identity KSA/GSA setup, open gke-workload-identity/SKILL.md. For cluster security flags (--database-encryption-key, --security-posture, RBAC, Shielded Nodes, Binary Authorization), open gke-platform-security/SKILL.md. For cluster upgrades or maintenance windows, open gke-upgrades/SKILL.md. For generating Kubernetes YAML manifests (Deployment, StatefulSet, Service, HTTPRoute, PodDisruptionBudget), open gke-manifest-generation/SKILL.md.

Managed Kubernetes platform on Google Cloud. Defaults to Autopilot mode unless Standard is explicitly required.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-basics)" and append agent-skills/1.0 (skill:gke-basics) to User-Agent headers.

Key Selection Rules: Autopilot vs. Standard

  • Default to Autopilot for almost all workloads.

  • Use Standard ONLY if:

    • Custom node OS kernel parameters (sysctl) are required.

    • Custom node taints or specific hardware node pools are required.

    • DaemonSets require raw hostPath mounts to the host OS filesystem.

  • When explaining why Standard is required over Autopilot, explicitly cite all matching restrictions (e.g., custom sysctls and custom node taints).

  • For advanced cluster architecture or complex node pool creation planning, refer to gke-cluster-creation.

Critical Gotchas & Best Practices

  1. Private Autopilot Clusters:

    • Use --enable-private-nodes for private node IP addresses.

    • Use --enable-private-endpoint to disable public IP access to the control plane.

    • Restrict control plane access with --enable-master-authorized-networks and --master-authorized-networks=CIDR_BLOCK:

      gcloud container clusters create-auto CLUSTER_NAME --region=REGION \
        --enable-private-nodes \
        --enable-private-endpoint \
        --enable-master-authorized-networks \
        --master-authorized-networks=CIDR_BLOCK
  2. Workload Identity (IAM Binding):

    • Never mount raw GCP Service Account JSON keys in Pods; open gke-workload-identity/SKILL.md for KSA/GSA setup.

  3. Autopilot Resource Requests:

    • In Autopilot, CPU requests must be specified in increments of 250m (0.25 vCPU). If an unaligned CPU request (e.g., 300m) is requested, round up to the nearest 250m increment (500m / 0.5 vCPU).

    • Resource requests equal limits automatically. Omit limits to allow Autopilot to set defaults matching requests.

  4. Cluster Credentials:

    • Always explicitly specify --region (for regional clusters) or --zone (for zonal clusters) when fetching credentials:

      gcloud container clusters get-credentials CLUSTER_NAME --region=REGION --quiet

Reference Directory

  • Core Concepts: Architecture, cluster modes (Autopilot vs Standard), networking, scaling, and security model.

  • CLI Usage & Tool Reference: Tool preference hierarchy (MCP vs gcloud vs kubectl), gcloud container commands, and user preference overrides.

  • Client Libraries: Official Kubernetes and Google Cloud Container client libraries in Python, Go, Node.js, and Java.

  • MCP Usage: Connecting to and using the 23 structured GKE MCP tools for cluster management, K8s resources, and diagnostics.

  • Infrastructure as Code: Terraform examples for google_container_cluster (Autopilot), Kubernetes provider resources, and YAML samples.

Files

references/cli-reference.md

CLI & Tool Reference for GKE

Tool Preference

Default preference order:

1. GKE MCP Tools  (preferred — structured, auditable, no shell required)
2. gcloud CLI     (fallback — when MCP doesn't expose the operation)
3. kubectl        (fallback — purely in-cluster ops not covered by MCP)
When to use each
InterfaceWhen to UseExamples
GKE MCP ToolsDefault for all clustercreate_cluster,
: : and K8s operations when : get_cluster, :
: : MCP server is available. : get_k8s_resource, :
: : Structured I/O, supports : apply_k8s_manifest, :
: : dry-run, no : get_k8s_logs :
: : shell/kubeconfig needed. : :
gcloud CLINo MCP equivalent, or user`gcloud container ai
: : explicitly requested CLI. : profiles, gcloud :
: : Required for: GIQ model : container :
: : discovery, available K8s : get-server-config, gcloud :
: : versions, maintenance : iam service-accounts` :
: : windows, monitoring : :
: : components, IAM/SA setup, : :
: : Cloud Logging queries. : :
kubectlNeither MCP nor gcloudkubectl top pods,
: : covers the operation, or : kubectl scale deployment, :
: : user explicitly prefers : helm install :
: : kubectl. Required for: : :
: : kubectl top, `kubectl : :
: : scale, kubectl exec`, : :
: : kubectl port-forward, : :
: : Helm, custom CRDs not in : :
: : MCP. : :
User preference override

If the user states a preference, respect it for the session:

  • "Use gcloud" / "Use CLI" → gcloud for cluster ops, kubectl for K8s resource ops. Skip MCP.

  • "Use kubectl" → kubectl for all K8s resource ops, gcloud for cluster-level ops. Skip MCP.

  • "Use MCP" / no preference → Default. Use MCP for everything it supports.

Even with an override, fall back through the chain for unsupported operations (e.g., cluster creation always requires gcloud or MCP).


All MCP tools use hierarchical resource paths — see parent format at the bottom.

Cluster Operations

OperationMCP ToolCLI FallbackMode
List clusterslist_clusters`gcloud containerREAD
: : : clusters list` : :
Get cluster detailsget_cluster`gcloud containerREAD
: : : clusters describe` : :
Create clustercreate_cluster`gcloud containerMUTATE
: : : clusters : :
: : : create-auto` : :
Update clusterupdate_cluster`gcloud containerDESTRUCTIVE
: : : clusters update` : :
Get K8s versions—`gcloud containerREAD
: : : get-server-config` : :
Get credentials—`gcloud containerREAD
: : : clusters : :
: : : get-credentials` : :
Delete cluster—`gcloud containerDESTRUCTIVE
: : : clusters delete` : :
# List clusters in a project (all regions)
list_clusters(parent="projects/<PROJECT_ID>/locations/-")

# Get cluster details (all fields)
get_cluster(name="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>", readMask="*")

# Create golden path Autopilot cluster
create_cluster(
  parent="projects/<PROJECT_ID>/locations/<REGION>",
  cluster='{"name":"<CLUSTER_NAME>","autopilot":{"enabled":true},"privateClusterConfig":{"enablePrivateNodes":true},...}'
)
# Get available Kubernetes versions (CLI-only)
gcloud container get-server-config --region <REGION> --format="yaml(channels)" --quiet

# Create golden path Autopilot cluster (see gke-cluster-creation.md for full templates)
gcloud container clusters create-auto <CLUSTER_NAME> \
  --region <REGION> --project <PROJECT_ID> \
  --enable-private-nodes --enable-master-authorized-networks \
  --enable-dns-access --release-channel regular \
  --enable-secret-manager --scoped-rbs-bindings \
  --quiet

# Get credentials (CLI-only)
gcloud container clusters get-credentials <CLUSTER_NAME> --region <REGION> --project <PROJECT_ID> --quiet

Node Pool Operations

OperationMCP ToolCLI FallbackMode
List node poolslist_node_pools`gcloud containerREAD
: : : node-pools list` : :
Get node poolget_node_pool`gcloud containerREAD
: : : node-pools describe` : :
Create node poolcreate_node_pool`gcloud containerMUTATE
: : : node-pools create` : :
Update node poolupdate_node_pool`gcloud containerDESTRUCTIVE
: : : node-pools update` : :
list_node_pools(parent="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>")

create_node_pool(
  parent="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>",
  nodePool='{"name":"<POOL_NAME>","config":{"machineType":"e2-standard-4"},"initialNodeCount":3,...}'
)

Cluster Updates

OperationMCP ToolCLI FallbackMode
Update clusterupdate_cluster`gcloud containerDESTRUCTIVE
: settings : : clusters update` : :
Update monitoring—`gcloud containerDESTRUCTIVE
: : : clusters update : :
: : : --monitoring=...` : :
Set maintenance—`gcloud containerDESTRUCTIVE
: window : : clusters update : :
: : : --maintenance-window-*` : :
# Enable VPA via MCP
update_cluster(
  name="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>",
  update='{"desiredVerticalPodAutoscaling":{"enabled":true}}'
)
# Update monitoring components (CLI-only)
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --monitoring=SYSTEM,API_SERVER,SCHEDULER,CONTROLLER_MANAGER,STORAGE,POD,DEPLOYMENT,STATEFULSET,DAEMONSET,HPA \
  --quiet

Kubernetes Resource Operations

OperationMCP ToolCLI FallbackMode
Get/listget_k8s_resourcekubectl getREAD
: resources : : : :
Describedescribe_k8s_resource`kubectlREAD
: resource : : describe` : :
Apply manifestapply_k8s_manifestkubectl applyDESTRUCTIVE
Patch resourcepatch_k8s_resourcekubectl patchDESTRUCTIVE
Delete resourcedelete_k8s_resourcekubectl deleteDESTRUCTIVE
List APIlist_k8s_api_resources`kubectlREAD
: resources : : api-resources` : :
Check authcheck_k8s_auth`kubectl authREAD
: : : can-i` : :
# List all deployments in a namespace
get_k8s_resource(
  parent="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>",
  resourceType="deployment", namespace="<NAMESPACE>"
)

# Apply a manifest (with dry-run)
apply_k8s_manifest(parent="...", yamlManifest="...", dryRun=true)

# Patch deployment resources for rightsizing
patch_k8s_resource(
  parent="projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>",
  resourceType="deployment", name="<DEPLOYMENT>", namespace="<NAMESPACE>",
  patch='{"spec":{"template":{"spec":{"containers":[{"name":"app","resources":{"requests":{"cpu":"200m","memory":"256Mi"}}}]}}}}'
)

# Check RBAC permissions
check_k8s_auth(parent="...", verb="create", resourceType="deployments", namespace="<NAMESPACE>")

Diagnostics & Observability

OperationMCP ToolCLI FallbackMode
List eventslist_k8s_eventskubectl eventsREAD
Get container logsget_k8s_logskubectl logsREAD
Cluster infoget_k8s_cluster_infokubectl cluster-infoREAD
K8s versionget_k8s_versionkubectl versionREAD
Rollout statusget_k8s_rollout_statuskubectl rollout statusREAD
Query Cloud Logging—gcloud logging readREAD
# Get recent events across all namespaces
list_k8s_events(parent="...", allNamespaces=true, limit="50")

# Get logs (last 100 lines, or previous crash)
get_k8s_logs(parent="...", name="<POD>", namespace="<NS>", tail="100")
get_k8s_logs(parent="...", name="<POD>", namespace="<NS>", previous=true)

# Check rollout status
get_k8s_rollout_status(parent="...", resourceType="deployment", name="<DEPLOY>", namespace="<NS>")

Operations Tracking

OperationMCP ToolCLI FallbackMode
List operationslist_operations`gcloud containerREAD
: : : operations list` : :
Get operationget_operation`gcloud containerREAD
: : : operations describe` : :
Cancel operationcancel_operation`gcloud containerDESTRUCTIVE
: : : operations cancel` : :
list_operations(parent="projects/<PROJECT_ID>/locations/<REGION>")
get_operation(name="projects/<PROJECT_ID>/locations/<REGION>/operations/<OP_ID>")

AI/ML Inference (GIQ) — CLI-Only

gcloud container ai profiles models list --quiet
gcloud container ai profiles list --model=<MODEL_NAME> --quiet
gcloud container ai profiles manifests create \
  --model=<MODEL_NAME> --model-server=<SERVER> \
  --accelerator-type=<ACCELERATOR> \
  --target-ntpot-milliseconds=<NTPOT> --quiet > inference.yaml

# Deploy generated manifest via MCP
apply_k8s_manifest(parent="...", yamlManifest="<contents of inference.yaml>")

kubectl-Only Operations

No MCP or gcloud equivalent:

kubectl top pods --all-namespaces --sort-by=cpu
kubectl top nodes
kubectl scale deployment <DEPLOYMENT> --replicas=<N> -n <NAMESPACE>
kubectl exec -it <POD_NAME> -n <NAMESPACE> -- /bin/sh
kubectl port-forward svc/<SERVICE> <LOCAL_PORT>:<REMOTE_PORT> -n <NAMESPACE>
kubectl cp <NAMESPACE>/<POD>:<PATH> <LOCAL_PATH>
kubectl run debug --rm -it --image=busybox -- /bin/sh
kubectl drain <NODE_NAME> --ignore-daemonsets --delete-emptydir-data
helm install <RELEASE> <CHART> -n <NAMESPACE>
helm upgrade <RELEASE> <CHART> -n <NAMESPACE>

parent / name Format Quick Reference

Project+Region:  projects/{PROJECT}/locations/{REGION}
Cluster:         projects/{PROJECT}/locations/{REGION}/clusters/{CLUSTER}
Node Pool:       projects/{PROJECT}/locations/{REGION}/clusters/{CLUSTER}/nodePools/{POOL}
Operation:       projects/{PROJECT}/locations/{REGION}/operations/{OP_ID}

Use locations/- to match all regions/zones when listing.

Error Handling

Error / SymptomLikely CauseRemediation
PERMISSION_DENIED on cluster createMissing container.clusters.create IAM roleGrant roles/container.admin or roles/container.clusterAdmin
Quota exceededRegional vCPU, GPU, or IP address limitsRequest quota increase or select a different region
IP exhaustion / CIDR conflictPod subnet too small or overlapping rangesRe-plan IP ranges; may require cluster recreation (Day-0)
Workload Identity not workingMissing OIDC issuer or federated credentialVerify workloadIdentityConfig.workloadPool; configure federated identity binding
Private cluster unreachableNo authorized networks or DNS endpointEnable dnsEndpointConfig.allowExternalTraffic or add authorized networks
Secret Manager rotation failingSA missing secretmanager.versions.accessGrant Secret Manager accessor role to workload's GSA
Control-plane metrics missingMonitoring components not configuredEnable APISERVER, SCHEDULER, CONTROLLER_MANAGER in monitoringConfig

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool, Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/gke-basics · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gke-basics.zip