HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_run_services_update-traffic.1
.TH "GCLOUD_ALPHA_RUN_SERVICES_UPDATE\-TRAFFIC" 1



.SH "NAME"
.HP
gcloud alpha run services update\-traffic \- adjust the traffic assignments for a Cloud Run service



.SH "SYNOPSIS"
.HP
\f5gcloud alpha run services update\-traffic\fR [[\fISERVICE\fR]\ \fB\-\-namespace\fR=\fINAMESPACE\fR] [\fB\-\-async\fR] [\fB\-\-breakglass\fR=\fIJUSTIFICATION\fR] [\fB\-\-region\fR=\fIREGION\fR] [\fB\-\-clear\-tags\fR\ |\ \fB\-\-set\-tags\fR=[\fITAG\fR=\fIREVISION\fR,...]\ |\ \fB\-\-remove\-tags\fR=[\fITAG\fR,...]\ \fB\-\-update\-tags\fR=[\fITAG\fR=\fIREVISION\fR,...]] [\fB\-\-to\-latest\fR\ |\ \fB\-\-to\-revisions\fR=[\fIREVISION\-NAME\fR=\fIPERCENTAGE\fR,...]\ |\ \fB\-\-to\-tags\fR=[\fITAG\fR=\fIPERCENTAGE\fR,...]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR Adjust the traffic assignments for a Cloud Run service.



.SH "EXAMPLES"

To assign 10% of traffic to revision myservice\-s5sxn and 90% of traffic to
revision myservice\-cp9kw run:

.RS 2m
$ gcloud alpha run services update\-traffic myservice \e
  \-\-to\-revisions=myservice\-s5sxn=10,myservice\-cp9kw=90
.RE

To increase the traffic to revision myservice\-s5sxn to 20% and by reducing the
traffic to revision myservice\-cp9kw to 80% run:

.RS 2m
$ gcloud alpha run services update\-traffic myservice \e
  \-\-to\-revisions=myservice\-s5sxn=20
.RE

To rollback to revision myservice\-cp9kw run:

.RS 2m
$ gcloud alpha run services update\-traffic myservice \e
  \-\-to\-revisions=myservice\-cp9kw=100
.RE

To assign 100% of traffic to the current or future LATEST revision run:

.RS 2m
$ gcloud alpha run services update\-traffic myservice \-\-to\-latest
.RE

You can also refer to the current or future LATEST revision in \-\-to\-revisions
by the string "LATEST". For example, to set 10% of traffic to always float to
the latest revision:

.RS 2m
$ gcloud alpha run services update\-traffic myservice \e
  \-\-to\-revisions=LATEST=10
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m

Service resource \- Service to update the configuration of. The arguments in
this group can be used to specify the attributes of this resource.


.RS 2m
.TP 2m
[\fISERVICE\fR]

ID of the service or fully qualified identifier for the service.

To set the \f5service\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5SERVICE\fR on the command line;
.IP "\(bu" 2m
specify the service name from an interactive prompt.
.RE
.sp

.TP 2m
\fB\-\-namespace\fR=\fINAMESPACE\fR

Specific to Cloud Run for Anthos: Kubernetes namespace for the service.

To set the \f5namespace\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5SERVICE\fR on the command line with a fully specified
name;
.IP "\(bu" 2m
specify the service name from an interactive prompt with a fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-namespace\fR on the command line;
.IP "\(bu" 2m
set the property \f5run/namespace\fR;
.IP "\(bu" 2m
For Cloud Run on Kubernetes Engine, defaults to "default". Otherwise, defaults
to project ID.;
.IP "\(bu" 2m
provide the argument \f5project\fR on the command line;
.IP "\(bu" 2m
set the property \f5core/project\fR.
.RE
.sp


.RE
.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-async\fR

Return immediately, without waiting for the operation in progress to complete.

.TP 2m
\fB\-\-breakglass\fR=\fIJUSTIFICATION\fR

Justification to bypass Binary Authorization policy constraints and allow the
operation. See
https://cloud.google.com/binary\-authorization/docs/using\-breakglass for more
information. Next update or deploy command will automatically clear existing
breakglass justification.

.TP 2m
\fB\-\-region\fR=\fIREGION\fR

Region in which the resource can be found. Alternatively, set the property
[run/region].

.TP 2m

Specify traffic tags. Traffic tags can be assigned to a revision by name or to
the latest ready revision. Assigning a tag to a revision generates a URL
prefixed with the tag that allows addressing that revision directly, regardless
of the percent traffic specified. Keys are tags. Values are revision names or
"LATEST" for the latest ready revision. For example,
\-\-set\-tags=candidate=LATEST,current=myservice\-v1 assigns the tag "candidate"
to the latest ready revision and the tag "current" to the revision with name
"myservice\-v1" and clears any existing tags. Changing tags does not affect the
traffic percentage assigned to revisions. When using a tags flag and one or more
of \-\-to\-latest and \-\-to\-revisions in the same command, the tags change
occurs first then the traffic percentage change occurs.

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-clear\-tags\fR

Remove all tags.

.TP 2m
\fB\-\-set\-tags\fR=[\fITAG\fR=\fIREVISION\fR,...]

List of key\-value pairs to set as tags. All existing tags will be removed
first.

.TP 2m

Only \-\-update\-tags and \-\-remove\-tags can be used together. If both are
specified, \-\-remove\-tags will be applied first.


.RS 2m
.TP 2m
\fB\-\-remove\-tags\fR=[\fITAG\fR,...]

List of tags to be removed.

.TP 2m
\fB\-\-update\-tags\fR=[\fITAG\fR=\fIREVISION\fR,...]

List of key\-value pairs to set as tags.

.RE
.RE
.sp
.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-to\-latest\fR

True to assign 100 percent of traffic to the 'latest' revision of this service.
Note that when a new revision is created, it will become the 'latest' and
traffic will be directed to it. Defaults to False. Synonymous with
\'\-\-to\-revisions=LATEST=100'.

.TP 2m
\fB\-\-to\-revisions\fR=[\fIREVISION\-NAME\fR=\fIPERCENTAGE\fR,...]

Comma separated list of traffic assignments in the form
REVISION\-NAME=PERCENTAGE. REVISION\-NAME must be the name for a revision for
the service as returned by 'gcloud beta run list revisions'. PERCENTAGE must be
an integer percentage between 0 and 100 inclusive. Ex
service\-nw9hs=10,service\-nw9hs=20 Up to 100 percent of traffic may be
assigned. If 100 percent of traffic is assigned, the Service traffic is updated
as specified. If under 100 percent of traffic is assigned, the Service traffic
is updated as specified for revisions with assignments and traffic is scaled up
or down down proportionally as needed for revision that are currently serving
traffic but that do not have new assignments. For example assume revision\-1 is
serving 40 percent of traffic and revision\-2 is serving 60 percent. If
revision\-1 is assigned 45 percent of traffic and no assignment is made for
revision\-2, the service is updated with revsion\-1 assigned 45 percent of
traffic and revision\-2 scaled down to 55 percent. You can use "LATEST" as a
special revision name to always put the given percentage of traffic on the
latest ready revision.

.TP 2m
\fB\-\-to\-tags\fR=[\fITAG\fR=\fIPERCENTAGE\fR,...]

Comma separated list of traffic assignments in the form TAG=PERCENTAGE. TAG must
match a traffic tag on a revision of the service. It may match a previously\-set
tag, or one assigned using the \f5\-\-set\-tags\fR or \f5\-\-update\-tags\fR
flags on this command. PERCENTAGE must be an integer percentage between 0 and
100 inclusive. Up to 100 percent of traffic may be assigned. If 100 percent of
traffic is assigned, the service traffic is updated as specified. If under 100
percent of traffic is assigned, the service traffic is updated as specified to
the given tags, and other traffic is scaled up or down proportionally. For
example, assume the revision tagged \f5next\fR is serving 40 percent of traffic
and the revision tagged \f5current\fR is serving 60 percent. If \f5next\fR is
assigned 45 percent of traffic and no assignment is made for \f5current\fR, the
service is updated with \f5next\fR assigned 45 percent of traffic and
\f5current\fR scaled down to 55 percent.


.RE
.RE
.sp

.SH "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 \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:

.RS 2m
$ gcloud run services update\-traffic
.RE

.RS 2m
$ gcloud beta run services update\-traffic
.RE