- JSON representation
- EnvVar
- EnvVarSource
- SecretKeySelector
- ResourceRequirements
- ContainerPort
- VolumeMount
- Probe
- HTTPGetAction
- HTTPHeader
- TCPSocketAction
- GRPCAction
A single application container. This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments can be supplied by the system to the container at runtime.
JSON representation |
---|
{ "name": string, "image": string, "command": [ string ], "args": [ string ], "env": [ { object ( |
Fields | |
---|---|
name |
Name of the container specified as a DNS_LABEL (RFC 1123). |
image |
Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed. |
command[] |
Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. |
args[] |
Arguments to the entrypoint. The docker image's CMD is used if this is not provided. |
env[] |
List of environment variables to set in the container. |
resources |
Compute Resource requirements by this container. |
ports[] |
List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible. If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on. |
volumeMounts[] |
Volume to mount into the container's filesystem. |
workingDir |
Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. |
livenessProbe |
Periodic probe of container liveness. Container will be restarted if the probe fails. |
startupProbe |
Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails. |
dependsOn[] |
Names of the containers that must start before this container. |
EnvVar
EnvVar represents an environment variable present in a Container.
JSON representation |
---|
{ "name": string, // Union field |
Fields | |
---|---|
name |
Required. Name of the environment variable. Must not exceed 32768 characters. |
Union field
|
|
value |
Literal value of the environment variable. Defaults to "", and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run. |
valueSource |
Source for the environment variable's value. |
EnvVarSource
EnvVarSource represents a source for the value of an EnvVar.
JSON representation |
---|
{
"secretKeyRef": {
object ( |
Fields | |
---|---|
secretKeyRef |
Selects a secret and a specific version from Cloud Secret Manager. |
SecretKeySelector
SecretEnvVarSource represents a source for the value of an EnvVar.
JSON representation |
---|
{ "secret": string, "version": string } |
Fields | |
---|---|
secret |
Required. The name of the secret in Cloud Secret Manager. Format: {secretName} if the secret is in the same project. projects/{project}/secrets/{secretName} if the secret is in a different project. |
version |
The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias. |
ResourceRequirements
ResourceRequirements describes the compute resource requirements.
JSON representation |
---|
{ "limits": { string: string, ... }, "cpuIdle": boolean, "startupCpuBoost": boolean } |
Fields | |
---|---|
limits |
Only Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits An object containing a list of |
cpuIdle |
Determines whether CPU is only allocated during requests (true by default). However, if ResourceRequirements is set, the caller must explicitly set this field to true to preserve the default behavior. |
startupCpuBoost |
Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency. |
ContainerPort
ContainerPort represents a network port in a single container.
JSON representation |
---|
{ "name": string, "containerPort": integer } |
Fields | |
---|---|
name |
If specified, used to specify which protocol to use. Allowed values are "http1" and "h2c". |
containerPort |
Port number the container listens on. This must be a valid TCP port number, 0 < containerPort < 65536. |
VolumeMount
VolumeMount describes a mounting of a Volume within a container.
JSON representation |
---|
{ "name": string, "mountPath": string } |
Fields | |
---|---|
name |
Required. This must match the Name of a Volume. |
mountPath |
Required. Path within the container at which the volume should be mounted. Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must otherwise be |
Probe
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
JSON representation |
---|
{ "initialDelaySeconds": integer, "timeoutSeconds": integer, "periodSeconds": integer, "failureThreshold": integer, // Union field |
Fields | |
---|---|
initialDelaySeconds |
Optional. Number of seconds after the container has started before the probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. |
timeoutSeconds |
Optional. Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 3600. Must be smaller than periodSeconds. |
periodSeconds |
Optional. How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. Must be greater or equal than timeoutSeconds. |
failureThreshold |
Optional. Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. |
Union field
|
|
httpGet |
Optional. HTTPGet specifies the http request to perform. Exactly one of httpGet, tcpSocket, or grpc must be specified. |
tcpSocket |
Optional. TCPSocket specifies an action involving a TCP port. Exactly one of httpGet, tcpSocket, or grpc must be specified. |
grpc |
Optional. GRPC specifies an action involving a gRPC port. Exactly one of httpGet, tcpSocket, or grpc must be specified. |
HTTPGetAction
HTTPGetAction describes an action based on HTTP Get requests.
JSON representation |
---|
{
"path": string,
"httpHeaders": [
{
object ( |
Fields | |
---|---|
path |
Optional. Path to access on the HTTP server. Defaults to '/'. |
httpHeaders[] |
Optional. Custom headers to set in the request. HTTP allows repeated headers. |
port |
Optional. Port number to access on the container. Must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort. |
HTTPHeader
HTTPHeader describes a custom header to be used in HTTP probes
JSON representation |
---|
{ "name": string, "value": string } |
Fields | |
---|---|
name |
Required. The header field name |
value |
Optional. The header field value |
TCPSocketAction
TCPSocketAction describes an action based on opening a socket
JSON representation |
---|
{ "port": integer } |
Fields | |
---|---|
port |
Optional. Port number to access on the container. Must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort. |
GRPCAction
GRPCAction describes an action involving a GRPC port.
JSON representation |
---|
{ "port": integer, "service": string } |
Fields | |
---|---|
port |
Optional. Port number of the gRPC service. Number must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort. |
service |
Optional. Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this is not specified, the default behavior is defined by gRPC. |