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
Private Autopilot Clusters:
Workload Identity (IAM Binding):
- Never mount raw GCP Service Account JSON keys in Pods; open
gke-workload-identity/SKILL.md for KSA/GSA setup.
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.
Cluster Credentials:
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.
1---2name: gke-basics-23metadata:4 source: https://skillmd.com/skills/google/gke-basics-25 version: "1.1.2"6 category: Containers7description: >-8 Manages core GKE cluster provisioning, credentials, Autopilot vs Standard selection,9 and workload deployment. Use when creating GKE clusters, fetching kubectl credentials,10 or deciding between Autopilot and Standard modes. Don't use for Workload Identity11 (use gke-workload-identity), GKE networking (use gke-networking), security hardening12 (use gke-platform-security or gke-workload-security), or cluster upgrades (use gke-upgrades).13---1415# GKE Basics & Critical Gotchas1617> **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`.1819Managed Kubernetes platform on Google Cloud. Defaults to Autopilot mode unless Standard is explicitly required.2021## Attribution2223**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you24MUST read [Usage Attribution](references/attribution.md). For commands executed25directly in the terminal (never in generated scripts, Terraform, or user code),26prefix `gcloud` with27`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-basics)"`28and append `agent-skills/1.0 (skill:gke-basics)` to `User-Agent` headers.2930## Key Selection Rules: Autopilot vs. Standard3132* **Default to Autopilot** for almost all workloads.33* **Use Standard ONLY if:**34 * Custom node OS kernel parameters (`sysctl`) are required.35 * Custom node taints or specific hardware node pools are required.36 * DaemonSets require raw `hostPath` mounts to the host OS filesystem.37* When explaining why Standard is required over Autopilot, explicitly cite all matching restrictions (e.g., custom sysctls and custom node taints).38* *For advanced cluster architecture or complex node pool creation planning, refer to `gke-cluster-creation`.*3940## Critical Gotchas & Best Practices41421. **Private Autopilot Clusters:**43 * Use `--enable-private-nodes` for private node IP addresses.44 * Use `--enable-private-endpoint` to disable public IP access to the control plane.45 * Restrict control plane access with `--enable-master-authorized-networks` and `--master-authorized-networks=CIDR_BLOCK`:46 ```bash47 gcloud container clusters create-auto CLUSTER_NAME --region=REGION \48 --enable-private-nodes \49 --enable-private-endpoint \50 --enable-master-authorized-networks \51 --master-authorized-networks=CIDR_BLOCK52 ```53542. **Workload Identity (IAM Binding):**55 * Never mount raw GCP Service Account JSON keys in Pods; open `gke-workload-identity/SKILL.md` for KSA/GSA setup.56573. **Autopilot Resource Requests:**58 * 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).59 * Resource requests equal limits automatically. Omit `limits` to allow Autopilot to set defaults matching `requests`.60614. **Cluster Credentials:**62 * Always explicitly specify `--region` (for regional clusters) or `--zone` (for zonal clusters) when fetching credentials:63 ```bash64 gcloud container clusters get-credentials CLUSTER_NAME --region=REGION --quiet65 ```6667## Reference Directory6869- [Core Concepts](references/core-concepts.md): Architecture, cluster modes (Autopilot vs Standard), networking, scaling, and security model.7071- [CLI Usage & Tool Reference](references/cli-reference.md): Tool preference hierarchy (MCP vs gcloud vs kubectl), `gcloud container` commands, and user preference overrides.7273- [Client Libraries](references/client-library-usage.md): Official Kubernetes and Google Cloud Container client libraries in Python, Go, Node.js, and Java.7475- [MCP Usage](references/mcp-usage.md): Connecting to and using the 23 structured GKE MCP tools for cluster management, K8s resources, and diagnostics.7677- [Infrastructure as Code](references/iac-usage.md): Terraform examples for `google_container_cluster` (Autopilot), Kubernetes provider resources, and YAML samples.