File: //snap/google-cloud-cli/396/help/man/man1/gcloud_beta_run_jobs_create.1
.TH "GCLOUD_BETA_RUN_JOBS_CREATE" 1
.SH "NAME"
.HP
gcloud beta run jobs create \- create a Cloud Run job
.SH "SYNOPSIS"
.HP
\f5gcloud beta run jobs create\fR [\fIJOB\fR] [\fB\-\-binary\-authorization\fR=\fIPOLICY\fR] [\fB\-\-breakglass\fR=\fIJUSTIFICATION\fR] [\fB\-\-container\fR=\fICONTAINER\fR] [\fB\-\-gpu\-type\fR=\fIGPU_TYPE\fR] [\fB\-\-[no\-]gpu\-zonal\-redundancy\fR] [\fB\-\-key\fR=\fIKEY\fR] [\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-max\-retries\fR=\fIMAX_RETRIES\fR] [\fB\-\-parallelism\fR=\fIPARALLELISM\fR] [\fB\-\-region\fR=\fIREGION\fR] [\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR] [\fB\-\-set\-cloudsql\-instances\fR=[\fICLOUDSQL\-INSTANCES\fR,...]] [\fB\-\-task\-timeout\fR=\fITASK_TIMEOUT\fR] [\fB\-\-tasks\fR=\fITASKS\fR;\ default=1] [\fB\-\-vpc\-connector\fR=\fIVPC_CONNECTOR\fR] [\fB\-\-vpc\-egress\fR=\fIVPC_EGRESS\fR] [\fB\-\-add\-volume\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ \fB\-\-clear\-volumes\fR\ \fB\-\-remove\-volume\fR=[\fIVOLUME\fR,...]] [\fB\-\-add\-volume\-mount\fR=[\fIvolume\fR=\fINAME\fR,\fImount\-path\fR=\fIMOUNT_PATH\fR,...]\ \fB\-\-args\fR=[\fIARG\fR,...]\ \fB\-\-clear\-volume\-mounts\fR\ \fB\-\-command\fR=[\fICOMMAND\fR,...]\ \fB\-\-cpu\fR=\fICPU\fR\ \fB\-\-depends\-on\fR=[\fICONTAINER\fR,...]\ \fB\-\-gpu\fR=\fIGPU\fR\ \fB\-\-image\fR=\fIIMAGE\fR\ \fB\-\-memory\fR=\fIMEMORY\fR\ \fB\-\-remove\-volume\-mount\fR=[\fIMOUNT_PATH\fR,...]\ \fB\-\-startup\-probe\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ \fB\-\-clear\-env\-vars\fR\ |\ \fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR\ |\ \fB\-\-set\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-remove\-env\-vars\fR=[\fIKEY\fR,...]\ \fB\-\-update\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ \fB\-\-clear\-secrets\fR\ |\ \fB\-\-set\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-remove\-secrets\fR=[\fIKEY\fR,...]\ \fB\-\-update\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-async\fR\ |\ \fB\-\-execute\-now\fR\ \fB\-\-wait\fR] [\fB\-\-network\fR=\fINETWORK\fR\ \fB\-\-network\-tags\fR=[\fITAG\fR,...]\ \fB\-\-subnet\fR=\fISUBNET\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(BETA)\fR Creates a new Cloud Run job.
.SH "EXAMPLES"
To deploy a new job \f5my\-data\-transformation\fR on Cloud Run:
.RS 2m
$ gcloud beta run jobs create my\-data\-transformation \e
\-\-image=us\-docker.pkg.dev/project/image
.RE
You may also omit the job name. Then a prompt will be displayed with a suggested
default value:
.RS 2m
$ gcloud beta run jobs create \-\-image=us\-docker.pkg.dev/project/image
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Job resource \- Job to create. This represents a Cloud resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5JOB\fR on the command line with a fully specified name;
.IP "\(em" 2m
specify the job name from an interactive prompt with a fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
.RS 2m
.TP 2m
[\fIJOB\fR]
ID of the Job or fully qualified identifier for the Job.
To set the \f5jobs\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5JOB\fR on the command line;
.IP "\(bu" 2m
specify the job name from an interactive prompt.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-binary\-authorization\fR=\fIPOLICY\fR
Binary Authorization policy to check against. This must be set to "default".
.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\-\-container\fR=\fICONTAINER\fR
Specifies a container by name. Flags following \-\-container will apply to the
specified container.
Flags that are not container\-specific must be specified before \-\-container.
.TP 2m
\fB\-\-gpu\-type\fR=\fIGPU_TYPE\fR
The GPU type to use.
.TP 2m
\fB\-\-[no\-]gpu\-zonal\-redundancy\fR
Set GPU zonal redundancy. Use \fB\-\-gpu\-zonal\-redundancy\fR to enable and
\fB\-\-no\-gpu\-zonal\-redundancy\fR to disable.
.TP 2m
\fB\-\-key\fR=\fIKEY\fR
CMEK key reference to encrypt the container with.
.TP 2m
\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of label KEY=VALUE pairs to add.
.TP 2m
\fB\-\-max\-retries\fR=\fIMAX_RETRIES\fR
Number of times a task is allowed to restart in case of failure before being
failed permanently. This applies per\-task, not per\-job. If set to 0, tasks
will only run once and never be retried on failure.
.TP 2m
\fB\-\-parallelism\fR=\fIPARALLELISM\fR
Number of tasks that may run concurrently. Must be less than or equal to the
number of tasks. Set to 0 to unset.
.TP 2m
\fB\-\-region\fR=\fIREGION\fR
Region in which the resource can be found. Alternatively, set the property
[run/region].
.TP 2m
\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR
the email address of an IAM service account associated with the revision of the
service. The service account represents the identity of the running revision,
and determines what permissions the revision has.
.TP 2m
\fB\-\-set\-cloudsql\-instances\fR=[\fICLOUDSQL\-INSTANCES\fR,...]
You can specify a name of a Cloud SQL instance if it's in the same project and
region as your Cloud Run resource; otherwise specify
<project>:<region>:<instance> for the instance.
.TP 2m
\fB\-\-task\-timeout\fR=\fITASK_TIMEOUT\fR
Set the maximum time (deadline) a job task attempt can run for. In the case of
retries, this deadline applies to each attempt of a task. If the task attempt
does not complete within this time, it will be killed. It is specified as a
duration; for example, "10m5s" is ten minutes, and five seconds. If you don't
specify a unit, seconds is assumed. For example, "10" is 10 seconds.
.TP 2m
\fB\-\-tasks\fR=\fITASKS\fR; default=1
Number of tasks that must run to completion for the execution to be considered
done.
.TP 2m
\fB\-\-vpc\-connector\fR=\fIVPC_CONNECTOR\fR
Set a VPC connector for this resource.
.TP 2m
\fB\-\-vpc\-egress\fR=\fIVPC_EGRESS\fR
Specify which of the outbound traffic to send through Direct VPC egress or the
VPC connector for this resource. This resource must have Direct VPC egress
enabled or a VPC connector to set this flag. \fIVPC_EGRESS\fR must be one of:
.RS 2m
.TP 2m
\fBall\fR
(DEPRECATED) Sends all outbound traffic through Direct VPC egress or the VPC
connector. Provides the same functionality as 'all\-traffic'. Prefer to use
\'all\-traffic' instead.
.TP 2m
\fBall\-traffic\fR
Sends all outbound traffic through Direct VPC egress or the VPC connector.
.TP 2m
\fBprivate\-ranges\-only\fR
Default option. Sends outbound traffic to private IP addresses (RFC 1918 and
Private Google Access IPs) through Direct VPC egress or the VPC connector.
Traffic to other Cloud Run services might require additional configuration. See
https://cloud.google.com/run/docs/securing/private\-networking#send_requests_to_other_services_and_services
for more information.
.RE
.sp
.TP 2m
\fB\-\-add\-volume\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Adds a volume to the Cloud Run resource. To add more than one volume, specify
this flag multiple times. Volumes must have a \f5name\fR and \f5type\fR key.
Only certain values are supported for \f5type\fR. Depending on the provided
type, other keys will be required. The following types are supported with the
specified additional keys:
\fBcloud\-storage\fR: A volume representing a Cloud Storage bucket. This volume
type is mounted using Cloud Storage FUSE. See
https://cloud.google.com/storage/docs/gcs\-fuse for the details and limitations
of this filesystem. Additional keys:
.RS 2m
.IP "\(em" 2m
bucket: (required) the name of the bucket to use as the source of this volume
.IP "\(em" 2m
readonly: (optional) A boolean. If true, this volume will be read\-only from all
mounts.
.IP "\(em" 2m
mount\-options: (optional) A list of flags to pass to GCSFuse. Flags should be
specified without leading dashes and separated by semicolons.
.RE
.sp
\fBin\-memory\fR: An ephemeral volume that stores data in the instance's memory.
With this type of volume, data is not shared between instances and all data will
be lost when the instance it is on is terminated. Additional keys:
.RS 2m
.IP "\(em" 2m
size\-limit: (optional) A quantity representing the maximum amount of memory
allocated to this volume, such as "512Mi" or "3G". Data stored in an in\-memory
volume consumes the memory allocation of the container that wrote the data. If
size\-limit is not specified, the maximum size will be half the total memory
limit of all containers.
.RE
.sp
\fBnfs\fR: Represents a volume backed by an NFS server. Additional keys:
.RS 2m
.IP "\(em" 2m
location: (required) The location of the NFS Server, in the form SERVER:/PATH
.IP "\(em" 2m
readonly: (optional) A boolean. If true, this volume will be read\-only from all
mounts.
.RE
.sp
.TP 2m
\fB\-\-clear\-volumes\fR
Remove all existing volumes from the Cloud Run resource, including volumes
mounted as secrets
.TP 2m
\fB\-\-remove\-volume\fR=[\fIVOLUME\fR,...]
Removes volumes from the Cloud Run resource.
.RE
.sp
Container Flags
.RS 2m
If the \-\-container is specified the following arguments may only be specified after a \-\-container flag.
.RE
.RS 2m
.TP 2m
\fB\-\-add\-volume\-mount\fR=[\fIvolume\fR=\fINAME\fR,\fImount\-path\fR=\fIMOUNT_PATH\fR,...]
Adds a mount to the current container. Must contain the keys \f5volume=NAME\fR
and \f5mount\-path=/PATH\fR where NAME is the name of a volume on this resource
and PATH is the path within the container's filesystem to mount this volume.
.RS 2m
.TP 2m
\fB\-\-args\fR=[\fIARG\fR,...]
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.
.TP 2m
\fB\-\-clear\-volume\-mounts\fR
Remove all existing mounts from the current container.
.TP 2m
\fB\-\-command\fR=[\fICOMMAND\fR,...]
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.
.TP 2m
\fB\-\-cpu\fR=\fICPU\fR
Set a CPU limit in Kubernetes cpu units.
Cloud Run supports values fractional values below 1, 1, 2, 4, and 8. Some CPU
values requires a minimum Memory \f5\-\-memory\fR value.
.TP 2m
\fB\-\-depends\-on\fR=[\fICONTAINER\fR,...]
List of container dependencies to add to the current container.
.TP 2m
\fB\-\-gpu\fR=\fIGPU\fR
Cloud Run supports values 0 or 1. 1 gpu also requires a minimum 4 \f5\-\-cpu\fR
value and a minimum 16Gi \f5\-\-memory\fR value.
.TP 2m
\fB\-\-image\fR=\fIIMAGE\fR
Name of the container image to deploy (e.g.
\f5us\-docker.pkg.dev/cloudrun/container/job:latest\fR).
.TP 2m
\fB\-\-memory\fR=\fIMEMORY\fR
Set a memory limit. Ex: 1024Mi, 4Gi.
.TP 2m
\fB\-\-remove\-volume\-mount\fR=[\fIMOUNT_PATH\fR,...]
Removes the volume mounted at the specified path from the current container.
.TP 2m
\fB\-\-startup\-probe\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Comma separated settings for startup probe in the form KEY=VALUE. Each key
stands for a field of the probe described in
https://cloud.google.com/run/docs/reference/rest/v1/Container#Probe. Currently
supported keys are: initialDelaySeconds, timeoutSeconds, periodSeconds,
failureThreshold, httpGet.port, httpGet.path, grpc.port, grpc.service,
tcpSocket.port.
For example, to set a probe with 10s timeout and HTTP probe requests sent to
8080 port of the container:
.RS 2m
$ \-\-startup\-probe=timeoutSeconds=10,httpGet.port=8080
.RE
To remove existing probe:
.RS 2m
$ \-\-startup\-probe=""
.RE
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-env\-vars\fR
Remove all environment variables.
.TP 2m
\fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR
Path to a local YAML or ENV file with definitions for all environment variables.
All existing environment variables will be removed before the new environment
variables are added. Example YAML content:
.RS 2m
KEY_1: "value1"
KEY_2: "value 2"
Example ENV content:
.RE
.RS 2m
KEY_1="value1"
KEY_2="value 2"
.RE
.TP 2m
\fB\-\-set\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as environment variables. All existing
environment variables will be removed first.
.TP 2m
Only \-\-update\-env\-vars and \-\-remove\-env\-vars can be used together. If
both are specified, \-\-remove\-env\-vars will be applied first.
.RS 2m
.TP 2m
\fB\-\-remove\-env\-vars\fR=[\fIKEY\fR,...]
List of environment variables to be removed.
.TP 2m
\fB\-\-update\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as environment variables.
.RE
.RE
.sp
.TP 2m
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:
.RS 2m
.TP 2m
\fB\-\-clear\-secrets\fR
Remove all secrets.
.TP 2m
\fB\-\-set\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as secrets. All existing secrets will be removed
first.
.TP 2m
Only \-\-update\-secrets and \-\-remove\-secrets can be used together. If both
are specified, \-\-remove\-secrets will be applied first.
.RS 2m
.TP 2m
\fB\-\-remove\-secrets\fR=[\fIKEY\fR,...]
List of secrets to be removed.
.TP 2m
\fB\-\-update\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as secrets.
.RE
.RE
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\-\-async cannot be used if executing the job after the update.
.RS 2m
.TP 2m
\fB\-\-execute\-now\fR
Execute the job immediately after the creation or update completes. gcloud exits
once the job has started unless the \f5\-\-wait\fR flag is set.
.TP 2m
\fB\-\-wait\fR
Wait until the execution has completed running before exiting. If not set,
gcloud exits successfully when the execution has started. Implies
\-\-execute\-now.
.RE
.RE
.sp
.TP 2m
Direct VPC egress setting flags group.
.RS 2m
.TP 2m
\fB\-\-network\fR=\fINETWORK\fR
The VPC network that the Cloud Run job will be able to send traffic to. If
\-\-subnet is also specified, subnet must be a subnetwork of the network
specified by this \-\-network flag. To clear existing VPC network settings, use
\-\-clear\-network.
.TP 2m
\fB\-\-network\-tags\fR=[\fITAG\fR,...]
Applies the given Compute Engine tags (comma separated) to the Cloud Run job. To
clear existing tags, use \-\-clear\-network\-tags.
.TP 2m
\fB\-\-subnet\fR=\fISUBNET\fR
The VPC subnetwork that the Cloud Run job will get IPs from. The subnetwork must
be \f5/26\fR or larger. If \-\-network is also specified, subnet must be a
subnetwork of the network specified by the \-\-network flag. If \-\-network is
not specified, network will be looked up from this subnetwork. To clear existing
VPC network settings, use \-\-clear\-network.
.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 beta and might change without notice. These
variants are also available:
.RS 2m
$ gcloud run jobs create
.RE
.RS 2m
$ gcloud alpha run jobs create
.RE