- NAME
-
- gcloud beta compute backend-services add-backend - add a backend to a backend service
- SYNOPSIS
-
-
gcloud beta compute backend-services add-backendBACKEND_SERVICE_NAME([ --instance-group=INSTANCE_GROUP:--instance-group-region=INSTANCE_GROUP_REGION|--instance-group-zone=INSTANCE_GROUP_ZONE]| [ --network-endpoint-group=NETWORK_ENDPOINT_GROUP:--global-network-endpoint-group|--network-endpoint-group-zone=NETWORK_ENDPOINT_GROUP_ZONE])[ --balancing-mode=BALANCING_MODE][ --capacity-scaler=CAPACITY_SCALER][ --description=DESCRIPTION][ --failover][ --max-utilization=MAX_UTILIZATION][ --global| --region=REGION][ --max-connections=MAX_CONNECTIONS| --max-connections-per-endpoint=MAX_CONNECTIONS_PER_ENDPOINT| --max-connections-per-instance=MAX_CONNECTIONS_PER_INSTANCE| --max-rate=MAX_RATE| --max-rate-per-endpoint=MAX_RATE_PER_ENDPOINT| --max-rate-per-instance=MAX_RATE_PER_INSTANCE][ GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(BETA)gcloud beta compute backend-services add-backendis used to add a backend to a backend service. A backend is a group of tasks that can handle requests sent to a backend service. Currently, the group of tasks can be one or more Google Compute Engine virtual machine instances grouped together using an instance group or network endpoint group.Traffic is first spread evenly across all virtual machines or network endpoints in the group. When the group is full, traffic is sent to the next nearest group(s) that still have remaining capacity.
To modify the parameters of a backend after it has been added to the backend service, use
gcloud compute backend-services update-backendorgcloud compute backend-services edit. - POSITIONAL ARGUMENTS
-
BACKEND_SERVICE_NAME- Name of the backend service to operate on.
- REQUIRED FLAGS
-
-
Exactly one of these must be specified:
-
Instance Group
--instance-group=INSTANCE_GROUP- Name of the instance group to add to the backend service. For details on valid instance names, refer to the criteria documented under the field 'name' at: https://cloud.google.com/compute/docs/reference/rest/v1/instances This flag must be specified if any of the other arguments in this group are specified.
-
At most one of these may be specified:
--instance-group-region=INSTANCE_GROUP_REGION-
Region of the instance group to add to the backend service. If not specified,
you may be prompted to select a region.
To avoid prompting when this flag is omitted, you can set the
property:compute/region$ gcloud config set compute/region REGION
A list of regions can be fetched by running:
$ gcloud compute regions list
To unset the property, run:
$ gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION --instance-group-zone=INSTANCE_GROUP_ZONE-
Zone of the instance group to add to the backend service. If not specified and
the
property isn't set, you may be prompted to select a zone.compute/zoneTo avoid prompting when this flag is omitted, you can set the
property:compute/zone$ gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
$ gcloud compute zones list
To unset the property, run:
$ gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
-
Network Endpoint Group
--network-endpoint-group=NETWORK_ENDPOINT_GROUP- Name of the network endpoint group to add to the backend service. This flag must be specified if any of the other arguments in this group are specified.
-
At most one of these may be specified:
--global-network-endpoint-group- If set, the network endpoint group is global.
--network-endpoint-group-zone=NETWORK_ENDPOINT_GROUP_ZONE-
Zone of the network endpoint group to add to the backend service. If not
specified and the
property isn't set, you may be prompted to select a zone.compute/zoneTo avoid prompting when this flag is omitted, you can set the
property:compute/zone$ gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
$ gcloud compute zones list
To unset the property, run:
$ gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
-
Instance Group
-
Exactly one of these must be specified:
- OPTIONAL FLAGS
-
--balancing-mode=BALANCING_MODE-
Defines the strategy for balancing load.
This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
BALANCING_MODEmust be one of:CONNECTION-
Available if the backend service's load balancing scheme is either
INTERNALorEXTERNAL. Available if the backend service's protocol is one ofSSL,TCP, orUDP.Spreads load based on how many concurrent connections the backend can handle.
For backend services with --load-balancing-scheme `EXTERNAL`, you must specify exactly one of these additional parameters: `--max-connections`, `--max-connections-per-instance`, or `--max-connections-per-endpoint`.
For backend services where `--load-balancing-scheme` is `INTERNAL`, you must omit all of these parameters.
RATE-
Available if the backend service's load balancing scheme is
INTERNAL_MANAGED,INTERNAL_SELF_MANAGED, orEXTERNAL. Available if the backend service's protocol is one of HTTP, HTTPS, or HTTP/2.Spreads load based on how many HTTP requests per second (RPS) the backend can handle.
You must specify exactly one of these additional parameters: `--max-rate`, `--max-rate-per-instance`, or `--max-rate-per-endpoint`.
UTILIZATION-
Available if the backend service's load balancing scheme is
INTERNAL_MANAGED,INTERNAL_SELF_MANAGED, orEXTERNAL. Available only for managed or unmanaged instance group backends.Spreads load based on the CPU utilization of instances in a backend instance group.
The following additional parameters may be specified: `--max-utilization`, `--max-rate`, `--max-rate-per-instance`, `--max-connections`, `--max-connections-per-instance`. For valid combinations, see `--max-utilization`.
--capacity-scaler=CAPACITY_SCALER-
A setting that applies to all balancing modes. This value is multiplied by the
balancing mode value to set the current max usage of the instance group.
Acceptable values are
0.0(0%) through1.0(100%). Setting this value to0.0(0%) drains the backend service. Note that draining a backend service only prevents new connections to instances in the group. All existing connections are allowed to continue until they close by normal means. This cannot be used for internal load balancing.This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
--description=DESCRIPTION- An optional, textual description for the backend.
--failover- Designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. Not compatible with the --global flag
--max-utilization=MAX_UTILIZATION-
Defines the maximum target for average utilization of the backend instance in
the backend instance group. Acceptable values are
0.0(0%) through1.0(100%). Available for all backend service protocols, with--balancing-mode=UTILIZATION.For backend services that use SSL, TCP, or UDP protocols, the following configuration options are supported:
- no additional parameter
-
only
--max-utilization -
only
--max-connections(except for regional managed instance groups) -
only
--max-connections-per-instance -
both
--max-utilizationand--max-connections(except for regional managed instance groups) -
both
--max-utilizationand--max-connections-per-instance
-max-connectionsand--max-connections-per-instanceare the same as for --balancing-mode=CONNECTION. If one is used with--max-utilization, instances are considered at capacity when either maximum utilization or maximum connections is reached.For backend services that use HTTP, HTTPS, or HTTP/2 protocols, the following configuration options are supported:
- no additional parameter
-
only
--max-utilization -
only
--max-rate(except for regional managed instance groups) -
only
--max-rate-per-instance -
both
--max-utilizationand--max-rate(except for regional managed instance groups) -
both
--max-utilizationand--max-rate-per-instance
--max-rateand--max-rate-per-instanceare the same as for --balancing-mode=RATE. If one is used in conjunction with--max-utilization, instances are considered at capacity wheneithermaximum utilization or the maximum rate is reached.-
At most one of these may be specified:
--global- If set, the backend service is global.
--region=REGION-
Region of the backend service to operate on. Overrides the default
compute/regionproperty value for this command invocation.
-
At most one of these may be specified:
--max-connections=MAX_CONNECTIONS-
Maximum concurrent connections that the backend can handle. Valid for network
endpoint group and instance group backends (except for regional managed instance
groups).
This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
--max-connections-per-endpoint=MAX_CONNECTIONS_PER_ENDPOINT-
Only valid for network endpoint group backends. Defines a maximum number of
connections per endpoint if all endpoints are healthy. When one or more
endpoints are unhealthy, an effective maximum number of connections per healthy
endpoint is calculated by multiplying
MAX_CONNECTIONS_PER_ENDPOINTby the number of endpoints in the network endpoint group, then dividing by the number of healthy endpoints.This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
--max-connections-per-instance=MAX_CONNECTIONS_PER_INSTANCE-
Only valid for instance group backends. Defines a maximum number of concurrent
connections per instance if all instances in the instance group are healthy.
When one or more instances are unhealthy, an effective maximum number of
connections per healthy instance is calculated by multiplying
MAX_CONNECTIONS_PER_INSTANCEby the number of instances in the instance group, then dividing by the number of healthy instances. --max-rate=MAX_RATE-
Maximum number of HTTP requests per second (RPS) that the backend can handle.
Valid for network endpoint group and instance group backends (except for
regional managed instance groups). Must not be defined if the backend is a
managed instance group using load balancing-based autoscaling.
This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
--max-rate-per-endpoint=MAX_RATE_PER_ENDPOINT-
Only valid for network endpoint group backends. Defines a maximum number of HTTP
requests per second (RPS) per endpoint if all endpoints are healthy. When one or
more endpoints are unhealthy, an effective maximum rate per healthy endpoint is
calculated by multiplying
MAX_RATE_PER_ENDPOINTby the number of endpoints in the network endpoint group, then dividing by the number of healthy endpoints.This cannot be used when the endpoint type of an attached network endpoint group is INTERNET_IP_PORT or INTERNET_FQDN_PORT.
--max-rate-per-instance=MAX_RATE_PER_INSTANCE-
Only valid for instance group backends. Defines a maximum number of HTTP
requests per second (RPS) per instance if all instances in the instance group
are healthy. When one or more instances are unhealthy, an effective maximum RPS
per healthy instance is calculated by multiplying
MAX_RATE_PER_INSTANCEby the number of instances in the instance group, then dividing by the number of healthy instances. This parameter is compatible with managed instance group backends that use autoscaling based on load balancing.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands: --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account,
--log-http, --project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run
$ gcloud helpfor details. - NOTES
-
This command is currently in BETA and may change without notice. These variants
are also available:
$ gcloud compute backend-services add-backend $ gcloud alpha compute backend-services add-backend
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-02-04.


