REST Resource: projects.locations.workerPools

Resource: WorkerPool

WorkerPool acts as a top-level container that manages a set of configurations and revision templates which implement a pull-based workload. WorkerPool exists to provide a singular abstraction which can be access controlled, reasoned about, and which encapsulates software lifecycle decisions such as rollout policy and team resource ownership.

JSON representation
{
  "name": string,
  "description": string,
  "uid": string,
  "generation": string,
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "expireTime": string,
  "creator": string,
  "lastModifier": string,
  "client": string,
  "clientVersion": string,
  "launchStage": enum (LaunchStage),
  "binaryAuthorization": {
    object (BinaryAuthorization)
  },
  "template": {
    object (WorkerPoolRevisionTemplate)
  },
  "instanceSplits": [
    {
      object (InstanceSplit)
    }
  ],
  "scaling": {
    object (WorkerPoolScaling)
  },
  "observedGeneration": string,
  "terminalCondition": {
    object (Condition)
  },
  "conditions": [
    {
      object (Condition)
    }
  ],
  "latestReadyRevision": string,
  "latestCreatedRevision": string,
  "instanceSplitStatuses": [
    {
      object (InstanceSplitStatus)
    }
  ],
  "customAudiences": [
    string
  ],
  "satisfiesPzs": boolean,
  "reconciling": boolean,
  "etag": string
}
Fields
name

string

The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, this field is ignored, and instead composed from CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id.

Format: projects/{project}/locations/{location}/workerPools/{worker_id}

description

string

User-provided description of the WorkerPool. This field currently has a 512-character limit.

uid

string

Output only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

generation

string (int64 format)

Output only. A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.

labels

map (key: string, value: string)

Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 WorkerPool.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected in new resources. All system annotations in v1 now have a corresponding field in v2 WorkerPool.

This field follows Kubernetes annotations' namespacing, limits, and rules.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

createTime

string (Timestamp format)

Output only. The creation time.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The last-modified time.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

deleteTime

string (Timestamp format)

Output only. The deletion time. It is only populated as a response to a Delete request.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

expireTime

string (Timestamp format)

Output only. For a deleted resource, the time after which it will be permamently deleted.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

creator

string

Output only. Email address of the authenticated creator.

lastModifier

string

Output only. Email address of the last authenticated modifier.

client

string

Arbitrary identifier for the API client.

clientVersion

string

Arbitrary version identifier for the API client.

launchStage

enum (LaunchStage)

Optional. The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features.

For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.

binaryAuthorization

object (BinaryAuthorization)

Optional. Settings for the Binary Authorization feature.

template

object (WorkerPoolRevisionTemplate)

Required. The template used to create revisions for this WorkerPool.

instanceSplits[]

object (InstanceSplit)

Optional. Specifies how to distribute instances over a collection of Revisions belonging to the WorkerPool. If instance split is empty or not provided, defaults to 100% instances assigned to the latest Ready Revision.

scaling

object (WorkerPoolScaling)

Optional. Specifies worker-pool-level scaling settings

observedGeneration

string (int64 format)

Output only. The generation of this WorkerPool currently serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.

terminalCondition

object (Condition)

Output only. The Condition of this WorkerPool, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

conditions[]

object (Condition)

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the WorkerPool does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

latestReadyRevision

string

Output only. Name of the latest revision that is serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run.

latestCreatedRevision

string

Output only. Name of the last created revision. See comments in reconciling for additional information on reconciliation process in Cloud Run.

instanceSplitStatuses[]

object (InstanceSplitStatus)

Output only. Detailed status information for corresponding instance splits. See comments in reconciling for additional information on reconciliation process in Cloud Run.

customAudiences[]

string

One or more custom audiences that you want this worker pool to support. Specify each custom audience as the full URL in a string. The custom audiences are encoded in the token and used to authenticate requests. For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences.

satisfiesPzs

boolean

Output only. Reserved for future use.

reconciling

boolean

Output only. Returns true if the WorkerPool is currently being acted upon by the system to bring it into the desired state.

When a new WorkerPool is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the WorkerPool to the desired serving state. This process is called reconciliation. While reconciliation is in process, observedGeneration, latest_ready_revison, trafficStatuses, and uri will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the serving state matches the WorkerPool, or there was an error, and reconciliation failed. This state can be found in terminalCondition.state.

If reconciliation succeeded, the following fields will match: traffic and trafficStatuses, observedGeneration and generation, latestReadyRevision and latestCreatedRevision.

If reconciliation failed, trafficStatuses, observedGeneration, and latestReadyRevision will have the state of the last serving revision, or empty for newly created WorkerPools. Additional information on the failure can be found in terminalCondition and conditions.

etag

string

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

WorkerPoolRevisionTemplate

WorkerPoolRevisionTemplate describes the data a worker pool revision should have when created from a template.

JSON representation
{
  "revision": string,
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "vpcAccess": {
    object (VpcAccess)
  },
  "serviceAccount": string,
  "containers": [
    {
      object (Container)
    }
  ],
  "volumes": [
    {
      object (Volume)
    }
  ],
  "encryptionKey": string,
  "serviceMesh": {
    object (ServiceMesh)
  },
  "encryptionKeyRevocationAction": enum (EncryptionKeyRevocationAction),
  "encryptionKeyShutdownDuration": string,
  "sessionAffinity": boolean,
  "nodeSelector": {
    object (NodeSelector)
  }
}
Fields
revision

string

Optional. The unique name for the revision. If this field is omitted, it will be automatically generated based on the WorkerPool name.

labels

map (key: string, value: string)

Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 WorkerPoolRevisionTemplate.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system annotations in v1 now have a corresponding field in v2 WorkerPoolRevisionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

vpcAccess

object (VpcAccess)

Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

serviceAccount

string

Optional. Email address of the 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. If not provided, the revision will use the project's default service account.

containers[]

object (Container)

Holds list of the containers that defines the unit of execution for this Revision.

volumes[]

object (Volume)

Optional. A list of Volumes to make available to containers.

encryptionKey

string

A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek

serviceMesh

object (ServiceMesh)

Optional. Enables service mesh connectivity.

encryptionKeyRevocationAction

enum (EncryptionKeyRevocationAction)

Optional. The action to take if the encryption key is revoked.

encryptionKeyShutdownDuration

string (Duration format)

Optional. If encryptionKeyRevocationAction is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

sessionAffinity

boolean

Optional. Enable session affinity.

nodeSelector

object (NodeSelector)

Optional. The node selector for the revision template.

InstanceSplit

Holds a single instance split entry for the Worker. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.

JSON representation
{
  "type": enum (InstanceSplitAllocationType),
  "revision": string,
  "percent": integer
}
Fields
type

enum (InstanceSplitAllocationType)

The allocation type for this instance split.

revision

string

Revision to which to assign this portion of instances, if split allocation is by revision.

percent

integer

Specifies percent of the instance split to this Revision. This defaults to zero if unspecified.

InstanceSplitAllocationType

The type of instance split allocation.

Enums
INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED Unspecified instance allocation type.
INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST Allocates instances to the Service's latest ready Revision.
INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION Allocates instances to a Revision by name.

WorkerPoolScaling

Worker pool scaling settings.

JSON representation
{
  "scalingMode": enum (ScalingMode),
  "maxSurge": integer,
  "maxUnavailable": integer,
  "minInstanceCount": integer,
  "maxInstanceCount": integer,
  "manualInstanceCount": integer
}
Fields
scalingMode

enum (ScalingMode)

Optional. The scaling mode for the worker pool.

maxSurge

integer

Optional. A maximum percentage of instances that will be moved in each step of traffic split changes.

When set to a positive value, the server will bring up, at most, that percentage of new instances at a time before moving traffic to them. After moving traffic, the server will bring down instances of the old revision. This can reduce a spike of total active instances during changes from one revision to another but specifying how many extra instances can be brought up at a time.

maxUnavailable

integer

Optional. A maximum percentage of instances that may be unavailable during changes from one revision to another.

When set to a positive value, the server may bring down instances before bringing up new instances. This can prevent a spike of total active instances during changes from one revision by reducing the pool of instances before bringing up new ones. Some requests may be slow or fail to serve during the transition.

minInstanceCount

integer

Optional. The minimum count of instances distributed among revisions based on the specified instance split percentages.

maxInstanceCount

integer

Optional. The maximum count of instances distributed among revisions based on the specified instance split percentages.

manualInstanceCount

integer

Optional. The total number of instances in manual scaling mode.

ScalingMode

The scaling mode for the worker pool. If not provided, it defaults to AUTOMATIC.

Enums
SCALING_MODE_UNSPECIFIED Unspecified.
AUTOMATIC Automatically scale between min and max instances.
MANUAL Scale to exactly min instances and ignore the max instances.

InstanceSplitStatus

Represents the observed state of a single InstanceSplit entry.

JSON representation
{
  "type": enum (InstanceSplitAllocationType),
  "revision": string,
  "percent": integer
}
Fields
type

enum (InstanceSplitAllocationType)

The allocation type for this instance split.

revision

string

Revision to which this instance split is assigned.

percent

integer

Specifies percent of the instance split to this Revision.

Methods

create

Creates a new WorkerPool in a given project and location.

delete

Deletes a WorkerPool.

get

Gets information about a WorkerPool.

getIamPolicy

Gets the IAM Access Control policy currently in effect for the given Cloud Run WorkerPool.

list

Lists WorkerPools.

patch

Updates a WorkerPool.

setIamPolicy

Sets the IAM Access control policy for the specified WorkerPool.

testIamPermissions

Returns permissions that a caller has on the specified Project.