GKE Cluster Creation

GKE Cluster Creation

Plans and creates GKE clusters from templates (Autopilot, Standard, GPU) and audits clusters for production readiness, explaining trade-offs before acting.

Skill files2 files

references/

SKILL.md370 lines
1
---
2
name: gke-cluster-creation
3
description: >-
4
Plans and executes GKE cluster creation, provisioning, and production
5
readiness audits using pre-defined templates (Autopilot, Standard Regional,
6
GPU/AI Inference, AI Hypercompute). Use when creating GKE clusters,
7
provisioning GKE environments, selecting cluster modes, or auditing GKE
8
clusters. Don't use for application onboarding or deployment configuration
9
(use gke-app-onboarding instead).
10
metadata:
11
version: "1.0.2"
12
category: Containers
13
---
14
15
# GKE Cluster Creation
16
17
This reference guides creating Google Kubernetes Engine (GKE) clusters by
18
providing a set of best-practice templates and guiding through mode selection
19
and customization. The **golden path Autopilot** configuration is the default
20
for all new clusters.
21
22
> **MCP Tools:** `list_clusters`, `create_cluster`, `get_cluster`,
23
> `list_operations`, `get_operation`
24
25
## Attribution
26
27
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
28
MUST read [Usage Attribution](references/attribution.md). For commands executed
29
directly in the terminal (never in generated scripts, Terraform, or user code),
30
prefix `gcloud` with
31
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-cluster-creation)"`
32
and append `agent-skills/1.0 (skill:gke-cluster-creation)` to `User-Agent`
33
headers.
34
35
## Workflow
36
37
1. **Discover context**: Use `list_clusters` to see existing clusters. Use
38
`gcloud config get-value project` if project unknown.
39
2. **Gather inputs**: `project_id`, `location` (region or zone),
40
`cluster_name`, environment type. If missing essential details, ask the user
41
before taking action.
42
3. **Select mode & explain trade-offs**: If the user hasn't specified a
43
template or mode, present the available templates (e.g., Autopilot, Standard
44
Regional, GPU Inference, AI Hypercompute) and explain key trade-offs (Cost
45
vs. Availability, Autopilot vs. Standard node management).
46
4. **Configure networking**: auto-create subnet (default) or bring-your-own.
47
5. **Review golden path settings**: present the default configuration block
48
(`gcloud` command or `create_cluster` JSON payload) and confirm with the
49
user before creation.
50
6. **Create**: Use MCP `create_cluster` tool or `gcloud` CLI.
51
7. **Track**: Use `get_operation` to monitor creation progress.
52
8. **Verify**: Use `get_cluster` with `readMask="*"` to confirm golden path
53
settings applied.
54
55
## Mode Selection
56
57
| Criteria | Autopilot (Golden Path) | Standard |
58
| ------------------ | ------------------------- | ------------------------- |
59
| Node management | Google-managed | Self-managed |
60
| Pricing | Pay per pod resource | Pay per node (VM) |
61
: : request : :
62
| Node customization | Via ComputeClasses | Full control |
63
| DaemonSets | Allowed (with | Full control |
64
: : restrictions) : :
65
| GPU/TPU | Supported via | Supported via node pools |
66
: : ComputeClasses : :
67
| Best for | Most production workloads | Kernel tuning, custom OS, |
68
: : : privileged workloads :
69
70
> **Rule**: Default to Autopilot unless the customer has a specific requirement
71
> that Autopilot cannot satisfy.
72
73
## Best Practices
74
75
When guiding the user or generating configurations, adhere to these GKE best
76
practices:
77
78
### Security & Networking
79
80
1. **Private Clusters**: Default to private clusters (`enablePrivateNodes:
81
true`) with a private control plane and restricted public endpoints
82
(`enable-master-authorized-networks`) to minimize attack surface.
83
2. **VPC-Native Networking**: Use VPC-native clusters (`useIpAliases: true` /
84
`--enable-ip-alias`) to enable alias IP ranges and pod-level firewall rules.
85
3. **Workload Identity**: Prefer Workload Identity (`workloadPool:
86
<PROJECT_ID>.svc.id.goog`) for securely granting GKE workloads access to
87
Google Cloud services instead of static service account keys.
88
4. **Shielded GKE Nodes**: Enable Shielded GKE Nodes
89
(`--enable-shielded-nodes`, `--enable-secure-boot`) against rootkits and
90
bootkits.
91
5. **Least Privilege (RBAC)**: Institute strict Role-Based Access Control
92
limits (`--no-enable-insecure-binding-system-authenticated`,
93
`--no-enable-insecure-binding-system-unauthenticated`).
94
95
### Cost Optimization
96
97
1. **Autoscaling**: Enable Cluster Autoscaler and Horizontal/Vertical Pod
98
Autoscaler (`--enable-autoscaling`, `--enable-vertical-pod-autoscaling`) to
99
adjust resources based on demand.
100
2. **Right-Sizing & Spot VMs**: Choose appropriate machine types and node
101
counts. Consider Spot VMs (`--spot`) for fault-tolerant, non-critical batch
102
or inference workloads.
103
104
### High Availability & Reliability
105
106
1. **Regional Clusters**: Use Regional Clusters for production environments to
107
ensure control plane replication across multiple zones (`--region` instead
108
of `--zone`). *Note: Standard regional creates nodes across 3 zones by
109
default.*
110
2. **Pod Disruption Budgets**: Recommend setting Pod Disruption Budgets for
111
application stability during node maintenance.
112
3. **Release Channels**: Subscribe to a release channel (`REGULAR` or `STABLE`)
113
for automated, safer cluster upgrades.
114
115
## Templates
116
117
### 1. Golden Path Autopilot (Production)
118
119
This is the default. All settings match
120
`../gke-golden-path/assets/golden-path-autopilot.yaml`.
121
122
**Via gcloud:**
123
124
```bash
125
gcloud container clusters create-auto <CLUSTER_NAME> \
126
--region <REGION> \
127
--project <PROJECT_ID> \
128
--release-channel regular \
129
--enable-private-nodes \
130
--enable-master-authorized-networks \
131
--enable-dns-access \
132
--enable-secret-manager \
133
--secret-manager-rotation-interval=120s \
134
--no-enable-insecure-binding-system-authenticated \
135
--no-enable-insecure-binding-system-unauthenticated \
136
--monitoring=SYSTEM,API_SERVER,SCHEDULER,CONTROLLER_MANAGER,STORAGE,POD,DEPLOYMENT,STATEFULSET,DAEMONSET,HPA,CADVISOR,KUBELET,DCGM \
137
--quiet
138
```
139
140
**Via MCP (`create_cluster`):**
141
142
```json
143
{
144
"parent": "projects/<PROJECT_ID>/locations/<REGION>",
145
"cluster": {
146
"name": "<CLUSTER_NAME>",
147
"autopilot": { "enabled": true },
148
"privateClusterConfig": { "enablePrivateNodes": true },
149
"masterAuthorizedNetworksConfig": {
150
"privateEndpointEnforcementEnabled": true
151
},
152
"releaseChannel": { "channel": "REGULAR" },
153
"secretManagerConfig": {
154
"enabled": true,
155
"rotationConfig": { "enabled": true, "rotationInterval": "120s" }
156
},
157
"rbacBindingConfig": {
158
"enableInsecureBindingSystemAuthenticated": false,
159
"enableInsecureBindingSystemUnauthenticated": false
160
}
161
}
162
}
163
```
164
165
### 2. Autopilot Dev/Test
166
167
Relaxes some golden path defaults for cost savings and easier access in
168
non-production.
169
170
**Via gcloud:**
171
172
```bash
173
gcloud container clusters create-auto <CLUSTER_NAME> \
174
--region <REGION> \
175
--project <PROJECT_ID> \
176
--release-channel rapid \
177
--quiet
178
```
179
180
**Via MCP (`create_cluster`):**
181
182
```json
183
{
184
"parent": "projects/<PROJECT_ID>/locations/<REGION>",
185
"cluster": {
186
"name": "<CLUSTER_NAME>",
187
"autopilot": { "enabled": true },
188
"releaseChannel": { "channel": "RAPID" }
189
}
190
}
191
```
192
193
> **Warning**: This does not apply golden path security hardening. Suitable for
194
> dev/test only.
195
196
### 3. Standard Regional (High Availability / Custom Requirements)
197
198
Best when Autopilot cannot be used (e.g., custom kernel tuning, specific node OS
199
requirements). Creates 3 nodes across zones by default.
200
201
**Via gcloud:**
202
203
```bash
204
gcloud container clusters create <CLUSTER_NAME> \
205
--region <REGION> \
206
--project <PROJECT_ID> \
207
--num-nodes 3 \
208
--machine-type e2-standard-4 \
209
--disk-type pd-balanced \
210
--enable-autoscaling --min-nodes 1 --max-nodes 10 \
211
--enable-shielded-nodes --enable-secure-boot \
212
--workload-pool=<PROJECT_ID>.svc.id.goog \
213
--enable-private-nodes \
214
--enable-master-authorized-networks \
215
--enable-vertical-pod-autoscaling \
216
--enable-dataplane-v2 \
217
--release-channel regular \
218
--quiet
219
```
220
221
**Via MCP (`create_cluster`):**
222
223
```json
224
{
225
"parent": "projects/<PROJECT_ID>/locations/<REGION>",
226
"cluster": {
227
"name": "<CLUSTER_NAME>",
228
"initialNodeCount": 3,
229
"nodeConfig": {
230
"machineType": "e2-standard-4",
231
"diskType": "pd-balanced",
232
"diskSizeGb": 100,
233
"oauthScopes": ["https://www.googleapis.com/auth/cloud-platform"],
234
"shieldedInstanceConfig": {
235
"enableSecureBoot": true,
236
"enableIntegrityMonitoring": true
237
},
238
"workloadMetadataConfig": {
239
"mode": "GKE_METADATA"
240
}
241
},
242
"privateClusterConfig": { "enablePrivateNodes": true },
243
"releaseChannel": { "channel": "REGULAR" },
244
"workloadIdentityConfig": {
245
"workloadPool": "<PROJECT_ID>.svc.id.goog"
246
}
247
}
248
}
249
```
250
251
### 4. GPU Inference & AI Workloads (L4 / ComputeClass)
252
253
Best for: AI/ML Inference, small model serving. Can be provisioned via
254
Autopilot + ComputeClass or via Standard node pool with `g2-standard-4`
255
(`nvidia-l4`). *Note: Requires `g2-standard-4` quota.*
256
257
**Autopilot ComputeClass / GIQ approach:**
258
259
```bash
260
# 1. Create golden path cluster (same as template 1)
261
gcloud container clusters create-auto <CLUSTER_NAME> \
262
--region <REGION> --project <PROJECT_ID> \
263
--enable-private-nodes --enable-master-authorized-networks \
264
--enable-dns-access --enable-secret-manager --no-enable-insecure-binding-system-authenticated --no-enable-insecure-binding-system-unauthenticated \
265
--quiet
266
267
# 2. Apply GPU ComputeClass (see gke-compute-classes.md)
268
kubectl apply -f gpu-compute-class.yaml
269
270
# 3. Or use GIQ for inference (see gke-inference.md)
271
gcloud container ai profiles manifests create \
272
--model=gemma-2-9b-it --model-server=vllm --accelerator-type=nvidia-l4 --quiet > inference.yaml
273
kubectl apply -f inference.yaml
274
```
275
276
**Standard Node Pool approach via MCP (`create_cluster`):**
277
278
```json
279
{
280
"parent": "projects/<PROJECT_ID>/locations/<REGION>",
281
"cluster": {
282
"name": "<CLUSTER_NAME>",
283
"initialNodeCount": 1,
284
"nodeConfig": {
285
"machineType": "g2-standard-4",
286
"accelerators": [
287
{
288
"acceleratorCount": "1",
289
"acceleratorType": "nvidia-l4"
290
}
291
],
292
"diskSizeGb": 100,
293
"oauthScopes": ["https://www.googleapis.com/auth/cloud-platform"]
294
}
295
}
296
}
297
```
298
299
### 5. AI Hypercompute (A3 HighGPU / Large Model Serving)
300
301
Best for: Large-scale LLM / AI model training and hypercompute inference. *Note:
302
High hourly cost and strict quota requirements (`a3-highgpu-8g` /
303
`nvidia-h100-80gb-hbm3`).*
304
305
**Via gcloud:**
306
307
```bash
308
gcloud container clusters create <CLUSTER_NAME> \
309
--region <REGION> \
310
--project <PROJECT_ID> \
311
--num-nodes 1 \
312
--machine-type a3-highgpu-8g \
313
--accelerator type=nvidia-h100-80gb-hbm3,count=8 \
314
--disk-size 200 \
315
--scopes https://www.googleapis.com/auth/cloud-platform \
316
--workload-pool=<PROJECT_ID>.svc.id.goog \
317
--release-channel regular \
318
--quiet
319
```
320
321
**Via MCP (`create_cluster`):**
322
323
```json
324
{
325
"parent": "projects/<PROJECT_ID>/locations/<REGION>",
326
"cluster": {
327
"name": "<CLUSTER_NAME>",
328
"initialNodeCount": 1,
329
"nodeConfig": {
330
"machineType": "a3-highgpu-8g",
331
"accelerators": [
332
{
333
"acceleratorCount": "8",
334
"acceleratorType": "nvidia-h100-80gb-hbm3"
335
}
336
],
337
"diskSizeGb": 200,
338
"oauthScopes": ["https://www.googleapis.com/auth/cloud-platform"]
339
}
340
}
341
}
342
```
343
344
## Instructions
345
346
- **ALWAYS** ask for `project_id` if not in context.
347
- **ALWAYS** ask for `region` (or location).
348
- **ALWAYS** ask for a unique `cluster_name`.
349
- **DEFAULT** to golden path Autopilot unless customer specifies otherwise or
350
has custom node/kernel/hypercompute requirements.
351
- **ALWAYS WARN** when deviating to GKE Standard, highlighting that it
352
deviates from the golden path and explaining the added
353
operational/management overhead (manually managing node pools, upgrades, and
354
autoscaling).
355
- **EXPLAIN TRADE-OFFS** when presenting templates or mode choices to the user
356
if they haven't specified one (e.g., Autopilot vs Standard, Cost vs
357
Availability).
358
- **PRESENT THE CONFIGURATION** block (`gcloud` command or JSON payload) and
359
ask for confirmation before calling any creation tool.
360
- **WARN** about Day-0 decisions (networking, private nodes) that are hard to
361
change later.
362
- **WARN** explicitly about cost and quota requirements when the user selects
363
GPU (`g2-standard-4`, `a3-highgpu-8g`), TPU, or multi-region/regional
364
clusters (`--region` defaults to 3 zones).
365
- When using MCP `create_cluster`, the `cluster.name` parameter should be the
366
**short name** (e.g., `my-cluster`), not the full resource path
367
(`projects/<PROJECT_ID>/locations/<REGION>/clusters/<CLUSTER_NAME>`). The
368
`parent` parameter defines the scope
369
(`projects/<PROJECT_ID>/locations/<REGION>`).
370

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…