- INFORMATION
-
gcloud beta run services proxyis supported in universe domainuniverse; however, some of the values used in the help text may not be available. Command examples may not work as-is and may requires changes before execution. - NAME
-
- gcloud beta run services proxy - proxy a service to localhost authenticating as the active account or with the specified token
- SYNOPSIS
-
-
gcloud beta run services proxy(SERVICE:--namespace=NAMESPACE) [--endpoint-mode=ENDPOINT_MODE] [--port=PORT] [--region=REGION] [--tag=TAG] [--token=TOKEN] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(BETA)Proxy a service to localhost authenticating as the active account or with the specified token. - EXAMPLES
-
To proxy the service 'my-service' at localhost port 8080:
gcloud beta run services proxy my-service --port=8080To proxy the existing traffic tag 'my-tag' on the service 'my-service:
gcloud beta run services proxy my-service --tag=my-tag - POSITIONAL ARGUMENTS
-
-
Service resource - Service to proxy locally. The arguments in this group can be
used to specify the attributes of this resource.
This must be specified.
SERVICE-
ID of the service or fully qualified identifier for the service.
To set the
serviceattribute:-
provide the argument
SERVICEon the command line.
This positional argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--namespace=NAMESPACE-
Specific to Cloud Run for Anthos: Kubernetes namespace for the service.
To set the
namespaceattribute:-
provide the argument
SERVICEon the command line with a fully specified name; -
provide the argument
--namespaceon the command line; -
set the property
run/namespace; - For Cloud Run on Kubernetes Engine, defaults to "default". Otherwise, defaults to project ID.;
-
provide the argument
projecton the command line; -
set the property
core/project.
-
provide the argument
-
Service resource - Service to proxy locally. The arguments in this group can be
used to specify the attributes of this resource.
- FLAGS
-
--endpoint-mode=ENDPOINT_MODE-
Specifies endpoint mode for a given command. Regional endpoints provide enhanced
data residency and reliability by ensuring your request is handled entirely
within the specified Google Cloud region. This differs from global endpoints,
which may process parts of the request outside the target region. Overrides the
default
regional/endpoint_modeproperty value for this command invocation.ENDPOINT_MODEmust be one of:global- (Default) Use global rather than regional endpoints.
regional- Only use regional endpoints. An error will be raised if a regional endpoint is not available for a given command.
regional-preferred- Use regional endpoints when available, otherwise use global endpoints. Recommended for most users.
--port=PORT- Local port number to expose the proxied service. If not specified, it will be set to 8080.
--region=REGION- Region in which the resource can be found. Alternatively, set the property [run/region].
--tag=TAG- Traffic tag of the service to expose via the proxy. If not specified, the default service URL will be proxied which may serve different revisions based on traffic-splits. Custom tags can be used to proxy specific revisions. Please see https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#tags.
--token=TOKEN- The specific identity token to add to all requests of the proxied service. If not specified, the identity token of the currently active authenticated account will be used (e.g. gcloud auth print-identity-token).
- 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 helpfor details. - REGIONAL ENDPOINTS
-
This command supports regional endpoints. To use regional endpoints for this
command, use the
--endpoint-mode=regional-preferredflag. To use regional endpoints by default, run$ gcloud config set regional/endpoint_mode regional-preferred. - NOTES
-
This command is currently in beta and might change without notice. These
variants are also available:
gcloud run services proxygcloud alpha run services proxy
gcloud beta run services proxy
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 2026-04-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-04-07 UTC."],[],[]]