CloudBuildWorkerPool


Property Value
Google Cloud Service Name Cloud Build
Google Cloud Service Documentation /cloud-build/docs/
Google Cloud REST Resource Name v1.projects.workerpools
Google Cloud REST Resource Documentation /cloud-build/docs/reference/rest/v1/projects.locations.workerPools
Config Connector Resource Short Names cloudbuildworkerpool
Config Connector Service Name cloudbuild.googleapis.com
Config Connector Resource Fully Qualified Name cloudbuildworkerpools.cloudbuild.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Spec

Schema

displayName: string
location: string
privatePoolV1Config:
  networkConfig:
    egressOption: string
    peeredNetworkIPRange: string
    peeredNetworkRef:
      external: string
      name: string
      namespace: string
  workerConfig:
    diskSizeGb: integer
    machineType: string
projectRef:
  external: string
  kind: string
  name: string
  namespace: string
resourceID: string
Fields

displayName

Optional

string

A user-specified, human-readable name for the `WorkerPool`. If provided, this value must be 1-63 characters.

location

Required*

string

privatePoolV1Config

Required*

object

Legacy Private Pool configuration.

privatePoolV1Config.networkConfig

Optional

object

Network configuration for the pool.

privatePoolV1Config.networkConfig.egressOption

Optional

string

Option to configure network egress for the workers.

privatePoolV1Config.networkConfig.peeredNetworkIPRange

Optional

string

Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. `/16` would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of `/24` will be used.

privatePoolV1Config.networkConfig.peeredNetworkRef

Optional

object

Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to `WorkerPool.project_id` on the service producer network.

privatePoolV1Config.networkConfig.peeredNetworkRef.external

Optional

string

A reference to an externally managed Compute Network resource. Should be in the format `projects/{{projectID}}/global/networks/{{network}}`.

privatePoolV1Config.networkConfig.peeredNetworkRef.name

Optional

string

The `name` field of a `ComputeNetwork` resource.

privatePoolV1Config.networkConfig.peeredNetworkRef.namespace

Optional

string

The `namespace` field of a `ComputeNetwork` resource.

privatePoolV1Config.workerConfig

Required*

object

Machine configuration for the workers in the pool.

privatePoolV1Config.workerConfig.diskSizeGb

Optional

integer

Size of the disk attached to the worker, in GB. See [Worker pool config file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). Specify a value of up to 2000. If `0` is specified, Cloud Build will use a standard disk size.

privatePoolV1Config.workerConfig.machineType

Optional

string

Machine type of a worker, such as `e2-medium`. See [Worker pool config file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). If left blank, Cloud Build will use a sensible default.

projectRef

Required*

object

The Project that this resource belongs to.

projectRef.external

Optional

string

The `projectID` field of a project, when not managed by Config Connector.

projectRef.kind

Optional

string

The kind of the Project resource; optional but must be `Project` if provided.

projectRef.name

Optional

string

The `name` field of a `Project` resource.

projectRef.namespace

Optional

string

The `namespace` field of a `Project` resource.

resourceID

Optional

string

The GCP resource identifier. If not given, the metadata.name will be used.

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
externalRef: string
observedGeneration: integer
observedState:
  createTime: string
  etag: string
  networkConfig:
    egressOption: string
    peeredNetwork: string
    peeredNetworkIPRange: string
  updateTime: string
  workerConfig:
    diskSizeGb: integer
    machineType: string
Fields
conditions

list (object)

Conditions represent the latest available observations of the object's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

externalRef

string

A unique Config Connector specifier for the resource in GCP.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

observedState

object

ObservedState is the state of the resource as most recently observed in GCP.

observedState.createTime

string

The creation timestamp of the workerpool.

observedState.etag

string

The Checksum computed by the server, using weak indicator.

observedState.networkConfig

object

Network configuration for the pool.

observedState.networkConfig.egressOption

string

Option to configure network egress for the workers.

observedState.networkConfig.peeredNetwork

string

Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to `WorkerPool.project_id` on the service producer network.

observedState.networkConfig.peeredNetworkIPRange

string

Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. `/16` would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of `/24` will be used.

observedState.updateTime

string

The last update timestamp of the workerpool.

observedState.workerConfig

object

Machine configuration for the workers in the pool.

observedState.workerConfig.diskSizeGb

integer

Size of the disk attached to the worker, in GB. See [Worker pool config file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). Specify a value of up to 2000. If `0` is specified, Cloud Build will use a standard disk size.

observedState.workerConfig.machineType

string

Machine type of a worker, such as `e2-medium`. See [Worker pool config file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). If left blank, Cloud Build will use a sensible default.

Sample YAML(s)

Workerpool With Default Network

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: cloudbuild.cnrm.cloud.google.com/v1beta1
kind: CloudBuildWorkerPool
metadata:
  name: cloudbuildworkerpool-sample-default-network
spec:
  projectRef:
    # Replace ${PROJECT_ID?} with your project ID
    external: "projects/${PROJECT_ID?}"
  location: us-central1
  displayName: A sample cloud build private pool with VSA Service Control
  privatePoolV1Config:
    workerConfig:
      machineType: e2-medium
      diskSizeGb: 100

Workerpool With Peered Network

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: cloudbuild.cnrm.cloud.google.com/v1beta1
kind: CloudBuildWorkerPool
metadata:
  name: cloudbuildworkerpool-sample-peered-network
spec:
  projectRef:
    # Replace ${PROJECT_ID?} with your project ID
    external: projects/${PROJECT_ID?}
  location: us-central1
  displayName: A sample cloud build private pool with custom peered network
  privatePoolV1Config:
    workerConfig:
      machineType: e2-medium
      diskSizeGb: 100
    networkConfig:
      peeredNetworkRef:
        name: cloudbuildworkerpool-dep-peered-network
      egressOption: NO_PUBLIC_EGRESS
      peeredNetworkIPRange: /29
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: cloudbuildworkerpool-dep-peered-network
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
spec:
  location: global
  purpose: VPC_PEERING
  addressType: INTERNAL
  prefixLength: 24
  networkRef:
    name: cloudbuildworkerpool-dep-peered-network
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: cloudbuildworkerpool-dep-peered-network
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
spec:
  autoCreateSubnetworks: false
---
apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
kind: ServiceNetworkingConnection
metadata:
  name: cloudbuildworkerpool-dep-peered-network
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
spec:
  networkRef:
    name: cloudbuildworkerpool-dep-peered-network
  service: servicenetworking.googleapis.com
  reservedPeeringRanges:
    - name: cloudbuildworkerpool-dep-peered-network