Plans, configures, and manages core GKE cluster networking. Covers private clusters, VPC-native configurations, DNS, node egress, Dataplane V2, and IP planning.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-gke-networking-2379c0fe8e63 ,按照其中的说明把「gke-networking」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
This reference covers networking configuration for GKE clusters. The golden path enforces private, VPC-native clusters with Dataplane V2.
MCP Tools:
get_cluster,update_cluster,apply_k8s_manifest,get_k8s_resource
| Setting | Golden Path Value | Day-0/1 | Notes |
|---|---|---|---|
privateClusterConfig.enablePrivateNodes | true | Day-0 | Nodes have no public IPs |
masterAuthorizedNetworksConfig.privateEndpointEnforcementEnabled | true | Day-0 | Control plane only reachable via private endpoint or DNS |
controlPlaneEndpointsConfig.dnsEndpointConfig.allowExternalTraffic | true | Day-0 | Allows DNS-based access from outside VPC |
networkConfig.datapathProvider | ADVANCED_DATAPATH (Dataplane V2) | Day-0 | eBPF-based, built-in Network Policy |
networkConfig.dnsConfig.clusterDns | CLOUD_DNS | Day-0 | Managed DNS, more reliable than kube-dns |
networkConfig.enableIntraNodeVisibility | true | Day-1 | VPC Flow Logs for intra-node traffic |
ipAllocationPolicy.autoIpamConfig.enabled | true | Day-0 | Automatic IP range management |
ipAllocationPolicy.createSubnetwork | true | Day-0 | Auto-create dedicated subnet |
defaultMaxPodsConstraint.maxPodsPerNode | 48 | Day-0 | Conservative default; 110 for high density |
The golden path creates a private cluster. Users access it via:
allowExternalTraffic: true enables access via
the cluster's DNS endpoint from outside the VPC. No VPN required.masterAuthorizedNetworksConfig for IP-based access control.# Access private cluster via DNS endpoint (golden path default)
gcloud container clusters get-credentials {cluster_name} \
--region {region} --dns-endpoint \
--quiet
# Access via private endpoint (from within VPC)
gcloud container clusters get-credentials {cluster_name} \
--region {region} --internal-ip \
--quiet
If the customer has existing network infrastructure:
gcloud container clusters create-auto {cluster_name} \
--region {region} \
--network {vpc_name} \
--subnetwork {subnet_name} \
--cluster-secondary-range-name {pod_range} \
--services-secondary-range-name {svc_range} \
--enable-private-nodes \
--enable-master-authorized-networks \
--quiet
Day-0 Warning: VPC, subnet, and IP ranges cannot be changed after cluster creation.
VPC-native clusters route traffic natively using GCP Alias IP ranges. Key benefits to cover:
| Resource | Golden Path | Notes |
|---|---|---|
| Pod CIDR | /17 (auto) | ~32K pod IPs; size based on maxPodsPerNode |
| Service CIDR | /20 (auto) | ~4K service IPs |
| Node subnet | auto-created | /20 recommended for growth |
| Max pods/node | 48 | Each node gets a /25 pod range; set to 110 |
| : : : for /24 per node : |
Pod CIDR sizing rule of thumb:
maxPodsPerNode=48 -> each node uses a /25 (128 IPs) from pod CIDRmaxPodsPerNode=110 -> each node uses a /24 (256 IPs) from pod CIDRDataplane V2 (golden path) provides built-in Network Policy enforcement — no additional addon needed. Apply default-deny per namespace, then allow specific flows.
See the
gke-workload-securityskill for default-deny policy and thegke-multitenancyskill for per-team allow policies.