mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-08 10:35:03 +00:00
gcloud: Wed Feb 7 10:26:58 UTC 2024
This commit is contained in:
parent
40bc27506b
commit
3efce28165
109 changed files with 4100 additions and 399 deletions
|
|
@ -2,31 +2,33 @@ NAME
|
|||
gcloud run deploy - create or update a Cloud Run service
|
||||
|
||||
SYNOPSIS
|
||||
gcloud run deploy [[SERVICE] --namespace=NAMESPACE] [--args=[ARG,...]]
|
||||
[--async] [--command=[COMMAND,...]] [--concurrency=CONCURRENCY]
|
||||
[--cpu=CPU] [--ingress=INGRESS; default="all"]
|
||||
[--max-instances=MAX_INSTANCES] [--memory=MEMORY]
|
||||
gcloud run deploy [[SERVICE] --namespace=NAMESPACE] [--async]
|
||||
[--concurrency=CONCURRENCY] [--container=CONTAINER]
|
||||
[--ingress=INGRESS; default="all"] [--max-instances=MAX_INSTANCES]
|
||||
[--min-instances=MIN_INSTANCES]
|
||||
[--platform=PLATFORM; default="managed"] [--port=PORT]
|
||||
[--platform=PLATFORM; default="managed"]
|
||||
[--service-account=SERVICE_ACCOUNT] [--tag=TAG] [--timeout=TIMEOUT]
|
||||
[--no-traffic] [--[no-]use-http2]
|
||||
[--clear-env-vars | --env-vars-file=FILE_PATH
|
||||
| --set-env-vars=[KEY=VALUE,...]
|
||||
| --remove-env-vars=[KEY,...] --update-env-vars=[KEY=VALUE,...]]
|
||||
[--no-traffic]
|
||||
[--args=[ARG,...] --command=[COMMAND,...] --cpu=CPU
|
||||
--depends-on=[CONTAINER,...]
|
||||
--memory=MEMORY --port=PORT --[no-]use-http2 --clear-env-vars
|
||||
| --env-vars-file=FILE_PATH | --set-env-vars=[KEY=VALUE,...]
|
||||
| --remove-env-vars=[KEY,...]
|
||||
--update-env-vars=[KEY=VALUE,...] --clear-secrets
|
||||
| --set-secrets=[KEY=VALUE,...] | --remove-secrets=[KEY,...]
|
||||
--update-secrets=[KEY=VALUE,...] --image=IMAGE | --source=SOURCE]
|
||||
[--clear-labels | --remove-labels=[KEY,...] --labels=[KEY=VALUE,...]
|
||||
| --update-labels=[KEY=VALUE,...]]
|
||||
[--clear-secrets | --set-secrets=[KEY=VALUE,...]
|
||||
| --remove-secrets=[KEY,...] --update-secrets=[KEY=VALUE,...]]
|
||||
[--connectivity=CONNECTIVITY --clear-config-maps
|
||||
| --set-config-maps=[KEY=VALUE,...] | --remove-config-maps=[KEY,...]
|
||||
--update-config-maps=[KEY=VALUE,...]]
|
||||
[--image=IMAGE | --source=SOURCE]
|
||||
[--[no-]allow-unauthenticated --breakglass=JUSTIFICATION
|
||||
--clear-vpc-connector --[no-]cpu-boost --[no-]cpu-throttling
|
||||
--description=DESCRIPTION
|
||||
--execution-environment=EXECUTION_ENVIRONMENT
|
||||
--revision-suffix=REVISION_SUFFIX --[no-]session-affinity
|
||||
--vpc-connector=VPC_CONNECTOR --vpc-egress=VPC_EGRESS
|
||||
--remove-containers=[CONTAINER,...] --revision-suffix=REVISION_SUFFIX
|
||||
--[no-]session-affinity --vpc-connector=VPC_CONNECTOR
|
||||
--vpc-egress=VPC_EGRESS
|
||||
--add-cloudsql-instances=[CLOUDSQL-INSTANCES,...]
|
||||
| --clear-cloudsql-instances
|
||||
| --remove-cloudsql-instances=[CLOUDSQL-INSTANCES,...]
|
||||
|
|
@ -91,35 +93,18 @@ POSITIONAL ARGUMENTS
|
|||
▸ set the property core/project.
|
||||
|
||||
FLAGS
|
||||
--args=[ARG,...]
|
||||
Comma-separated arguments passed to the command run by the container
|
||||
image. If not specified and no '--command' is provided, the container
|
||||
image's default Cmd is used. Otherwise, if not specified, no arguments
|
||||
are passed. To reset this field to its default, pass an empty string.
|
||||
|
||||
--async
|
||||
Return immediately, without waiting for the operation in progress to
|
||||
complete.
|
||||
|
||||
--command=[COMMAND,...]
|
||||
Entrypoint for the container image. If not specified, the container
|
||||
image's default Entrypoint is run. To reset this field to its default,
|
||||
pass an empty string.
|
||||
|
||||
--concurrency=CONCURRENCY
|
||||
Set the maximum number of concurrent requests allowed per container
|
||||
instance. Leave concurrency unspecified or provide the special value
|
||||
'default' to receive the server default value.
|
||||
|
||||
--cpu=CPU
|
||||
Set a CPU limit in Kubernetes cpu units.
|
||||
|
||||
Cloud Run (fully managed) supports values 1, 2 and 4. For Cloud Run
|
||||
(fully managed), 4 cpus also requires a minimum 2Gi --memory value.
|
||||
Examples 2, 2.0, 2000m
|
||||
|
||||
Cloud Run for Anthos and Knative-compatible Kubernetes clusters support
|
||||
fractional values. Examples .5, 500m, 2
|
||||
--container=CONTAINER
|
||||
Specifies a container by name. Flags following --container will apply
|
||||
to the specified container.
|
||||
|
||||
--ingress=INGRESS; default="all"
|
||||
Set the ingress traffic sources allowed to call the service. For Cloud
|
||||
|
|
@ -149,9 +134,6 @@ FLAGS
|
|||
The maximum number of container instances of the Service to run. Use
|
||||
'default' to unset the limit and use the platform default.
|
||||
|
||||
--memory=MEMORY
|
||||
Set a memory limit. Ex: 1024Mi, 4Gi.
|
||||
|
||||
--min-instances=MIN_INSTANCES
|
||||
The minimum number of container instances for this Revision of the
|
||||
Service to run or 'default' to remove any minimum.
|
||||
|
|
@ -173,13 +155,6 @@ FLAGS
|
|||
--kubeconfig and --context flags to specify a kubeconfig file and
|
||||
the context for connecting.
|
||||
|
||||
--port=PORT
|
||||
Container port to receive requests at. Also sets the $PORT environment
|
||||
variable. Must be a number between 1 and 65535, inclusive. To unset
|
||||
this field, pass the special value "default". If updating an existing
|
||||
service with a TCP startup probe pointing to the previous container
|
||||
port, this will also update the probe port.
|
||||
|
||||
--service-account=SERVICE_ACCOUNT
|
||||
Service account associated with the revision of the service. The
|
||||
service account represents the identity of the running revision, and
|
||||
|
|
@ -210,35 +185,126 @@ FLAGS
|
|||
revision by default, run the gcloud run services update-traffic command
|
||||
with --to-latest.
|
||||
|
||||
--[no-]use-http2
|
||||
Whether to use HTTP/2 for connections to the service. Use --use-http2
|
||||
to enable and --no-use-http2 to disable.
|
||||
Container Flags
|
||||
|
||||
At most one of these can be specified:
|
||||
The following flags apply to a single container. If the --container flag is specified these flags may only be
|
||||
specified after a --container flag. Otherwise they will apply to the primary ingress container.
|
||||
|
||||
--clear-env-vars
|
||||
Remove all environment variables.
|
||||
--args=[ARG,...]
|
||||
Comma-separated arguments passed to the command run by the
|
||||
container image. If not specified and no '--command' is provided,
|
||||
the container image's default Cmd is used. Otherwise, if not
|
||||
specified, no arguments are passed. To reset this field to its
|
||||
default, pass an empty string.
|
||||
|
||||
--env-vars-file=FILE_PATH
|
||||
Path to a local YAML file with definitions for all environment
|
||||
variables. All existing environment variables will be removed before
|
||||
the new environment variables are added. Example YAML content:
|
||||
--command=[COMMAND,...]
|
||||
Entrypoint for the container image. If not specified, the container
|
||||
image's default Entrypoint is run. To reset this field to its
|
||||
default, pass an empty string.
|
||||
|
||||
KEY_1: "value1"
|
||||
KEY_2: "value 2"
|
||||
--cpu=CPU
|
||||
Set a CPU limit in Kubernetes cpu units.
|
||||
|
||||
--set-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables. All existing
|
||||
environment variables will be removed first.
|
||||
Cloud Run (fully managed) supports values 1, 2 and 4. For Cloud Run
|
||||
(fully managed), 4 cpus also requires a minimum 2Gi --memory value.
|
||||
Examples 2, 2.0, 2000m
|
||||
|
||||
Only --update-env-vars and --remove-env-vars can be used together. If
|
||||
both are specified, --remove-env-vars will be applied first.
|
||||
Cloud Run for Anthos and Knative-compatible Kubernetes clusters
|
||||
support fractional values. Examples .5, 500m, 2
|
||||
|
||||
--remove-env-vars=[KEY,...]
|
||||
List of environment variables to be removed.
|
||||
--depends-on=[CONTAINER,...]
|
||||
List of container dependencies to add to the current container.
|
||||
|
||||
--update-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables.
|
||||
--memory=MEMORY
|
||||
Set a memory limit. Ex: 1024Mi, 4Gi.
|
||||
|
||||
--port=PORT
|
||||
Container port to receive requests at. Also sets the $PORT
|
||||
environment variable. Must be a number between 1 and 65535,
|
||||
inclusive. To unset this field, pass the special value "default".
|
||||
If updating an existing service with a TCP startup probe pointing
|
||||
to the previous container port, this will also update the probe
|
||||
port.
|
||||
|
||||
--[no-]use-http2
|
||||
Whether to use HTTP/2 for connections to the service. Use
|
||||
--use-http2 to enable and --no-use-http2 to disable.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--clear-env-vars
|
||||
Remove all environment variables.
|
||||
|
||||
--env-vars-file=FILE_PATH
|
||||
Path to a local YAML file with definitions for all environment
|
||||
variables. All existing environment variables will be removed
|
||||
before the new environment variables are added. Example YAML
|
||||
content:
|
||||
|
||||
KEY_1: "value1"
|
||||
KEY_2: "value 2"
|
||||
|
||||
--set-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables. All
|
||||
existing environment variables will be removed first.
|
||||
|
||||
Only --update-env-vars and --remove-env-vars can be used together.
|
||||
If both are specified, --remove-env-vars will be applied first.
|
||||
|
||||
--remove-env-vars=[KEY,...]
|
||||
List of environment variables to be removed.
|
||||
|
||||
--update-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables.
|
||||
|
||||
Specify secrets to mount or provide as environment variables. Keys
|
||||
starting with a forward slash '/' are mount paths. All other keys
|
||||
correspond to environment variables. Values should be in the form
|
||||
SECRET_NAME:SECRET_VERSION. For example:
|
||||
'--update-secrets=/secrets/api/key=mysecret:latest,ENV=othersecret:1'
|
||||
will mount a volume at '/secrets/api' containing a file 'key' with the
|
||||
latest version of secret 'mysecret'. An environment variable named ENV
|
||||
will also be created whose value is version 1 of secret 'othersecret'.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--clear-secrets
|
||||
Remove all secrets.
|
||||
|
||||
--set-secrets=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as secrets. All existing secrets
|
||||
will be removed first.
|
||||
|
||||
Only --update-secrets and --remove-secrets can be used together. If
|
||||
both are specified, --remove-secrets will be applied first.
|
||||
|
||||
--remove-secrets=[KEY,...]
|
||||
List of secrets to be removed.
|
||||
|
||||
--update-secrets=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as secrets.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--image=IMAGE
|
||||
Name of the container image to deploy (e.g.
|
||||
gcr.io/cloudrun/hello:latest).
|
||||
|
||||
--source=SOURCE
|
||||
The location of the source to build. If a Dockerfile is present
|
||||
in the source code directory, it will be built using that
|
||||
Dockerfile, otherwise it will use Google Cloud buildpacks. See
|
||||
https://cloud.google.com/run/docs/deploying-source-code for more
|
||||
details. The location can be a directory on a local disk or a
|
||||
gzipped archive file (.tar.gz) in Google Cloud Storage. If the
|
||||
source is a local directory, this command skips the files
|
||||
specified in the --ignore-file. If --ignore-file is not
|
||||
specified, use .gcloudignore file. If a .gcloudignore file is
|
||||
absent and a .gitignore file is present in the local source
|
||||
directory, gcloud will use a generated Git-compatible
|
||||
.gcloudignore file that respects your .gitignored files. The
|
||||
global .gitignore is not respected. For more information on
|
||||
.gcloudignore, see gcloud topic gcloudignore.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
|
|
@ -270,33 +336,6 @@ FLAGS
|
|||
List of label KEY=VALUE pairs to update. If a label exists, its value
|
||||
is modified. Otherwise, a new label is created.
|
||||
|
||||
Specify secrets to mount or provide as environment variables. Keys
|
||||
starting with a forward slash '/' are mount paths. All other keys
|
||||
correspond to environment variables. Values should be in the form
|
||||
SECRET_NAME:SECRET_VERSION. For example:
|
||||
'--update-secrets=/secrets/api/key=mysecret:latest,ENV=othersecret:1' will
|
||||
mount a volume at '/secrets/api' containing a file 'key' with the latest
|
||||
version of secret 'mysecret'. An environment variable named ENV will also
|
||||
be created whose value is version 1 of secret 'othersecret'.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--clear-secrets
|
||||
Remove all secrets.
|
||||
|
||||
--set-secrets=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as secrets. All existing secrets will
|
||||
be removed first.
|
||||
|
||||
Only --update-secrets and --remove-secrets can be used together. If both
|
||||
are specified, --remove-secrets will be applied first.
|
||||
|
||||
--remove-secrets=[KEY,...]
|
||||
List of secrets to be removed.
|
||||
|
||||
--update-secrets=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as secrets.
|
||||
|
||||
Only applicable if connecting to Cloud Run for Anthos deployed on Google
|
||||
Cloud or Cloud Run for Anthos deployed on VMware. Specify --platform=gke
|
||||
or --platform=kubernetes to use:
|
||||
|
|
@ -347,27 +386,6 @@ FLAGS
|
|||
--update-config-maps=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as config-maps.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--image=IMAGE
|
||||
Name of the container image to deploy (e.g.
|
||||
gcr.io/cloudrun/hello:latest).
|
||||
|
||||
--source=SOURCE
|
||||
The location of the source to build. If a Dockerfile is present in
|
||||
the source code directory, it will be built using that Dockerfile,
|
||||
otherwise it will use Google Cloud buildpacks. See
|
||||
https://cloud.google.com/run/docs/deploying-source-code for more
|
||||
details. The location can be a directory on a local disk or a gzipped
|
||||
archive file (.tar.gz) in Google Cloud Storage. If the source is a
|
||||
local directory, this command skips the files specified in the
|
||||
--ignore-file. If --ignore-file is not specified, use .gcloudignore
|
||||
file. If a .gcloudignore file is absent and a .gitignore file is
|
||||
present in the local source directory, gcloud will use a generated
|
||||
Git-compatible .gcloudignore file that respects your .gitignored
|
||||
files. The global .gitignore is not respected. For more information
|
||||
on .gcloudignore, see gcloud topic gcloudignore.
|
||||
|
||||
Only applicable if connecting to Cloud Run (fully managed). Specify
|
||||
--platform=managed to use:
|
||||
|
||||
|
|
@ -410,6 +428,9 @@ FLAGS
|
|||
gen2
|
||||
Run the application in a second generation execution environment.
|
||||
|
||||
--remove-containers=[CONTAINER,...]
|
||||
List of containers to remove.
|
||||
|
||||
--revision-suffix=REVISION_SUFFIX
|
||||
Specify the suffix of the revision name. Revision names always start
|
||||
with the service name automatically. For example, specifying
|
||||
|
|
@ -546,35 +567,36 @@ FLAGS
|
|||
but can be set in other ways.
|
||||
|
||||
To set the project attribute:
|
||||
▫ provide the argument --cluster on the command line with a fully
|
||||
specified name;
|
||||
▫ set the property run/cluster with a fully specified name;
|
||||
▫ specify the cluster from a list of available clusters with a
|
||||
fully specified name;
|
||||
▫ provide the argument --project on the command line;
|
||||
▫ set the property core/project.
|
||||
▸ provide the argument --cluster on the command line with a fully
|
||||
specified name;
|
||||
▸ set the property run/cluster with a fully specified name;
|
||||
▸ specify the cluster from a list of available clusters with a fully
|
||||
specified name;
|
||||
▸ provide the argument --project on the command line;
|
||||
▸ set the property core/project.
|
||||
|
||||
--cluster=CLUSTER
|
||||
ID of the cluster or fully qualified identifier for the cluster.
|
||||
--cluster=CLUSTER
|
||||
ID of the cluster or fully qualified identifier for the
|
||||
cluster.
|
||||
|
||||
To set the cluster attribute:
|
||||
◇ provide the argument --cluster on the command line;
|
||||
◇ set the property run/cluster;
|
||||
◇ specify the cluster from a list of available clusters.
|
||||
To set the cluster attribute:
|
||||
▫ provide the argument --cluster on the command line;
|
||||
▫ set the property run/cluster;
|
||||
▫ specify the cluster from a list of available clusters.
|
||||
|
||||
--cluster-location=CLUSTER_LOCATION
|
||||
Zone in which the cluster is located. Alternatively, set the
|
||||
property [run/cluster_location].
|
||||
--cluster-location=CLUSTER_LOCATION
|
||||
Zone in which the cluster is located. Alternatively, set the
|
||||
property [run/cluster_location].
|
||||
|
||||
To set the location attribute:
|
||||
◇ provide the argument --cluster on the command line with a
|
||||
fully specified name;
|
||||
◇ set the property run/cluster with a fully specified name;
|
||||
◇ specify the cluster from a list of available clusters with a
|
||||
fully specified name;
|
||||
◇ provide the argument --cluster-location on the command line;
|
||||
◇ set the property run/cluster_location;
|
||||
◇ specify the cluster location from a list of available zones.
|
||||
To set the location attribute:
|
||||
▫ provide the argument --cluster on the command line with a
|
||||
fully specified name;
|
||||
▫ set the property run/cluster with a fully specified name;
|
||||
▫ specify the cluster from a list of available clusters with a
|
||||
fully specified name;
|
||||
▫ provide the argument --cluster-location on the command line;
|
||||
▫ set the property run/cluster_location;
|
||||
▫ specify the cluster location from a list of available zones.
|
||||
|
||||
Only applicable if connecting to Cloud Run for Anthos deployed on
|
||||
VMware. Specify --platform=kubernetes to use:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue