gcloud network-services service-lb-policies create

NAME
gcloud network-services service-lb-policies create - create a service LB policy
SYNOPSIS
gcloud network-services service-lb-policies create(SERVICE_LB_POLICY :--location=LOCATION)[--async][--auto-capacity-drain][--description=DESCRIPTION][--failover-health-threshold=FAILOVER_HEALTH_THRESHOLD][--isolation-config-granularity=ISOLATION_CONFIG_GRANULARITY; default="unspecified"][--isolation-config-mode=ISOLATION_CONFIG_MODE; default="unspecified"][--load-balancing-algorithm=LOAD_BALANCING_ALGORITHM; default="waterfall-by-region"][GCLOUD_WIDE_FLAG]
DESCRIPTION
Create a new service LB policy with the given name.
EXAMPLES
Create a service LB policy with the name 'my-service-lb-policy', load balancingalgorithm 'waterfall-by-region', and location 'global'.
gcloudnetwork-servicesservice-lb-policiescreatemy-service-lb-policy--load-balancing-algorithm=waterfall-by-region--location="global"
POSITIONAL ARGUMENTS
Service lb policy resource - Name of the service LB policy to be created. Thearguments in this group can be used to specify the attributes of this resource.(NOTE) Some attributes are not given arguments in this group but can be set inother ways.

To set theproject attribute:

  • provide the argumentservice_lb_policy on the command line with afully specified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

SERVICE_LB_POLICY
ID of the service lb policy or fully qualified identifier for the service lbpolicy.

To set theservice_lb_policy attribute:

  • provide the argumentservice_lb_policy on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--location=LOCATION
The location Id.

To set thelocation attribute:

  • provide the argumentservice_lb_policy on the command line with afully specified name;
  • provide the argument--location on the command line.
FLAGS
--async
Return immediately, without waiting for the operation in progress to complete.
--auto-capacity-drain
If specified, an unhealthy MIG/NEG will be removed from Global load balancingand traffic routing for the service. A MIG/NEG is considered to be unhealthy ifless than 25% of the instance/endpoints in the MIG/NEG are healthy.autoCapacityDrain will never drain more than 50% of the configured MIGs/NEGs ofa Backend Service.
--description=DESCRIPTION
The description for the service LB policy.
--failover-health-threshold=FAILOVER_HEALTH_THRESHOLD
The percentage threshold that a load balancer will begin to send traffic tofailover backends. If the percentage of endpoints in a MIG/NEG is smaller thanthis value, traffic would be sent to failover backends if possible. This fieldshould be set to a value between 1 and 99. The default value is 50 for Proxylessservice mesh, and 70 for others.
--isolation-config-granularity=ISOLATION_CONFIG_GRANULARITY; default="unspecified"
The granularity of the isolation.ISOLATION_CONFIG_GRANULARITY must be one of:
region
Traffic for this service will be isolated at the nearest cloud region.
unspecified
No isolation is configured for the backend service. Traffic can overflow basedon the load balancing algorithm.
--isolation-config-mode=ISOLATION_CONFIG_MODE; default="unspecified"
The granularity of the isolation.ISOLATION_CONFIG_MODEmust be one of:
nearest
Traffic will be sent to the nearest location.
strict
Traffic will fail if no serving backends are available in the same region as theload balancer.
unspecified
No isolation mode is configured for the backend service.
--load-balancing-algorithm=LOAD_BALANCING_ALGORITHM; default="waterfall-by-region"
The global load balancing algorithm to be used.LOAD_BALANCING_ALGORITHM must be one of:
spray-to-region
Spread the traffic from each client to all the MIGs/NEGs in a region.
spray-to-world
Balance traffic across all backends across the world proportionally based oncapacity.
waterfall-by-region
Direct traffic to the nearest region with endpoints and capacity before spillingover to other regions.
waterfall-by-zone
Attempt to keep traffic in a single zone closest to the client, before spillingover to other zones.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

API REFERENCE
This command uses thenetworkservices/v1 API. The fulldocumentation for this API can be found at:https://cloud.google.com/networking
NOTES
These variants are also available:
gcloudalphanetwork-servicesservice-lb-policiescreate
gcloudbetanetwork-servicesservice-lb-policiescreate

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-15 UTC.