A Site Reliability Engineering team maintains a Google Kubernetes Engine (GKE) cluster hosted in a custom Virtual Private Cloud (VPC) named `corp-vpc` in the `us-east1` region. An existing Cloud NAT gateway named `nat-gateway-us-east1` configured on Cloud Router `nat-router` currently handles egress traffic, but was initially deployed using the `--nat-primary-subnet-ip-ranges` flag. After adding a new secondary IP range for GKE Pods on `subnet-analytics`, traffic originating from Pods in this secondary range fails to reach external services. Which command should the engineer execute to enable Internet egress for the secondary IP range while preserving existing NAT functionality?
- gcloud compute routers nats update nat-gateway-us-east1 --router=nat-router --region=us-east1 --nat-all-subnet-ip-rangesCevap
- Bgcloud compute nats update nat-gateway-us-east1 --region=us-east1 --nat-all-subnet-ip-ranges
- CConfigure an internal HTTP(S) load balancer with nat-gateway-us-east1 as a backend service to translate secondary range traffic
- DExpand the primary CIDR block of subnet-analytics to encompass the secondary range so Cloud NAT automatically includes it
Cevap
Execute `gcloud compute routers nats update nat-gateway-us-east1 --router=nat-router --region=us-east1 --nat-all-subnet-ip-ranges` to update the Cloud NAT gateway to include all primary and secondary subnet IP ranges.
Executing `gcloud compute routers nats update` with `--nat-all-subnet-ip-ranges` reconfigures the existing Cloud NAT gateway on the designated Cloud Router so that all primary and secondary subnet IP ranges in the region (including GKE Pod ranges) are allocated source NAT addresses for internet egress.
Adım Adım Çözüm
Anahtar Kavram
Managing Cloud NAT egress policies for secondary subnet IP ranges via gcloud CLI