GKE Networking

GKE Networking

Plans and configures core GKE cluster networking: private VPC-native clusters, Dataplane V2, DNS, node egress and IP range planning, following golden-path defaults.

Skill files2 files

references/

SKILL.md136 lines
1
---
2
name: gke-networking
3
description: >-
4
Plans, configures, and manages core GKE cluster networking. Covers private
5
clusters, VPC-native configurations, DNS, node egress, Dataplane V2, and
6
IP planning. Use when designing GKE networking layouts, configuring private
7
clusters, setting up Dataplane V2, planning GKE IP ranges, or managing VPC-
8
native cluster modes. Don't use for application ingress, load balancing, or
9
service networking (use gke-service-networking instead).
10
metadata:
11
version: "1.0.1"
12
category: Networking
13
---
14
15
# GKE Networking
16
17
This reference covers networking configuration for GKE clusters. The golden path
18
enforces private, VPC-native clusters with Dataplane V2.
19
20
> **MCP Tools:** `get_cluster`, `update_cluster`, `apply_k8s_manifest`,
21
> `get_k8s_resource`
22
23
## Attribution
24
25
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
26
MUST read [Usage Attribution](references/attribution.md). For commands executed
27
directly in the terminal (never in generated scripts, Terraform, or user code),
28
prefix `gcloud` with
29
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-networking)"`
30
and append `agent-skills/1.0 (skill:gke-networking)` to `User-Agent` headers.
31
32
## Golden Path Networking Defaults
33
34
Setting | Golden Path Value | Day-0/1 | Notes
35
-------------------------------------------------------------------- | ---------------------------------- | ------- | -----
36
`privateClusterConfig.enablePrivateNodes` | `true` | Day-0 | Nodes have no public IPs
37
`masterAuthorizedNetworksConfig.privateEndpointEnforcementEnabled` | `true` | Day-0 | Control plane only reachable via private endpoint or DNS
38
`controlPlaneEndpointsConfig.dnsEndpointConfig.allowExternalTraffic` | `true` | Day-0 | Allows DNS-based access from outside VPC
39
`networkConfig.datapathProvider` | `ADVANCED_DATAPATH` (Dataplane V2) | Day-0 | eBPF-based, built-in Network Policy
40
`networkConfig.dnsConfig.clusterDns` | `CLOUD_DNS` | Day-0 | Managed DNS, more reliable than kube-dns
41
`networkConfig.enableIntraNodeVisibility` | `true` | Day-1 | VPC Flow Logs for intra-node traffic
42
`ipAllocationPolicy.autoIpamConfig.enabled` | `true` | Day-0 | Automatic IP range management
43
`ipAllocationPolicy.createSubnetwork` | `true` | Day-0 | Auto-create dedicated subnet
44
`defaultMaxPodsConstraint.maxPodsPerNode` | `48` | Day-0 | Conservative default; 110 for high density
45
46
## Private Cluster Access Patterns
47
48
The golden path creates a private cluster. Users access it via:
49
50
1. **DNS endpoint (default)**: `allowExternalTraffic: true` enables access via
51
the cluster's DNS endpoint from outside the VPC. No VPN required.
52
2. **Private endpoint**: Direct access from within the VPC or via Cloud
53
VPN/Interconnect.
54
3. **Authorized networks**: Add specific CIDRs to
55
`masterAuthorizedNetworksConfig` for IP-based access control.
56
57
```bash
58
# Access private cluster via DNS endpoint (golden path default)
59
gcloud container clusters get-credentials {cluster_name} \
60
--region {region} --dns-endpoint \
61
--quiet
62
63
# Access via private endpoint (from within VPC)
64
gcloud container clusters get-credentials {cluster_name} \
65
--region {region} --internal-ip \
66
--quiet
67
```
68
69
## Bring-Your-Own VPC/Subnet
70
71
If the customer has existing network infrastructure:
72
73
```bash
74
gcloud container clusters create-auto {cluster_name} \
75
--region {region} \
76
--network {vpc_name} \
77
--subnetwork {subnet_name} \
78
--cluster-secondary-range-name {pod_range} \
79
--services-secondary-range-name {svc_range} \
80
--enable-private-nodes \
81
--enable-master-authorized-networks \
82
--quiet
83
```
84
85
> **Day-0 Warning**: VPC, subnet, and IP ranges cannot be changed after cluster
86
> creation.
87
88
## VPC-Native Mode Benefits
89
90
VPC-native clusters route traffic natively using GCP Alias IP ranges. Key
91
benefits to cover:
92
93
1. **Scalability**: Traffic routes natively inside the VPC, bypassing the need
94
for custom routes and avoiding custom route limit bottlenecks.
95
2. **Direct VPC Integration**: Direct resource integration across GCP networks
96
without complex bridging or routing tunnels.
97
3. **Avoiding IP Exhaustion**: Supports discontiguous IP ranges and optimizes
98
allocation, reducing the risk of exhausting subnet IP ranges.
99
100
## IP Planning
101
102
| Resource | Golden Path | Notes |
103
| ------------- | ------------ | ------------------------------------------ |
104
| Pod CIDR | `/17` (auto) | ~32K pod IPs; size based on maxPodsPerNode |
105
| Service CIDR | `/20` (auto) | ~4K service IPs |
106
| Node subnet | auto-created | /20 recommended for growth |
107
| Max pods/node | 48 | Each node gets a /25 pod range; set to 110 |
108
: : : for /24 per node :
109
110
**Pod CIDR sizing rule of thumb:**
111
112
- `maxPodsPerNode=48` -> each node uses a `/25` (128 IPs) from pod CIDR
113
- `maxPodsPerNode=110` -> each node uses a `/24` (256 IPs) from pod CIDR
114
- Larger maxPodsPerNode = fewer nodes fit in a given CIDR
115
116
## Egress
117
118
- Default: nodes use Cloud NAT for outbound internet access (private nodes
119
have no public IPs) to allow private nodes to reach the internet without
120
public IP exposure.
121
- For static egress IPs: configure Cloud NAT with manual IP allocation to
122
maintain a consistent source IP for external allowlists or partner
123
firewalls.
124
- For restricted egress: route through a firewall appliance via custom routes
125
to inspect and filter outbound traffic according to organization security
126
policies.
127
128
## Network Policy
129
130
Dataplane V2 (golden path) provides built-in Network Policy enforcement — no
131
additional addon needed. Apply default-deny per namespace, then allow specific
132
flows.
133
134
> See the `gke-workload-security` skill for default-deny policy and the
135
> `gke-multitenancy` skill for per-team allow policies.
136

© 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…