Question

Difficulty: MediumManaging Networking Resources

An operations engineer needs to update a regional internal HTTP(S) load balancer in Google Cloud. The team has deployed a new managed instance group named `ig-prod-backend` in region `us-central1` and wants to attach it as an additional backend to an existing regional backend service named `be-prod-service` in the same region. Which `gcloud` command should the engineer execute to achieve this configuration?

  1. gcloud compute backend-services add-backend be-prod-service --instance-group=ig-prod-backend --instance-group-region=us-central1 --region=us-central1Answer
  2. B
    gcloud compute backend-services update be-prod-service --instance-group=ig-prod-backend --zone=us-central1-a
  3. C
    gcloud compute target-pools add-instances be-prod-service --instances=ig-prod-backend --region=us-central1
  4. D
    gcloud compute networks subnets update be-prod-service --add-secondary-ranges=ig-prod-backend=10.0.0.0/24 --region=us-central1

Answer

The correct command is `gcloud compute backend-services add-backend be-prod-service --instance-group=ig-prod-backend --instance-group-region=us-central1 --region=us-central1`.
To add an instance group to an existing regional backend service, you must use `gcloud compute backend-services add-backend` along with the `--instance-group`, `--instance-group-region`, and `--region` flags.

Step-by-Step Solution

1
Identify the target resource type and operational action required.
The target resource is a regional backend service (`be-prod-service`) and the action is adding an instance group backend.
Adding a new capacity source to an existing backend service requires the `add-backend` subcommand under `gcloud compute backend-services`.
2
Specify the appropriate scoping and region parameters.
Include `--instance-group=ig-prod-backend`, `--instance-group-region=us-central1`, and `--region=us-central1`.
Regional backend services and regional instance groups require explicit region flags matching their deployment locations.

Key Concept

Managing GCP Backend Services for Load Balancers
Estimated Time:1m 30s
Rate this question