# Google Cloud Container V1 Client - Class NodePool (2.10.0)

2.10.0 (latest) 2.9.0 2.8.1 2.7.0 2.6.1 2.5.0 2.4.0 2.3.4 2.2.1 2.1.0 2.0.0 1.33.0 1.32.0 1.31.0 1.30.3 1.24.0 1.23.0 1.22.0 1.21.1 1.20.0 1.19.0 1.18.0 1.17.1 1.16.0 1.15.0 1.14.0 1.13.1 1.12.1 1.10.3 1.9.1 Reference documentation and code samples for the Google Cloud Container V1 Client class NodePool.

NodePool contains the name and configuration for a cluster's node pool.

Node pools are a set of nodes (i.e. VM's), with a common configuration and
specification, under the control of the cluster master. They may have a set
of Kubernetes labels applied to them, which may be used to reference them
during pod scheduling. They may also be resized up or down, to accommodate
the workload.

Generated from protobuf message `google.container.v1.NodePool`

## Namespace

Google \\ Cloud \\ Container \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The name of the node pool. |
| `↳ config` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeConfig` The node configuration of the pool. |
| `↳ initial_node_count` | `int` The initial node count for the pool. You must ensure that your Compute Engine [resource quota](https://cloud.google.com/compute/quotas) is sufficient for this number of instances. You must also have available firewall and routes quota. |
| `↳ locations` | `string[]` The list of Google Compute Engine [zones](https://cloud.google.com/compute/docs/zones#available) in which the NodePool's nodes should be located. If this value is unspecified during node pool creation, the [Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations) value will be used, instead. Warning: changing node pool locations will result in nodes being added and/or removed. |
| `↳ network_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeNetworkConfig` Networking configuration for this NodePool. If specified, it overrides the cluster-level defaults. |
| `↳ self_link` | `string` Output only. Server-defined URL for the resource. |
| `↳ version` | `string` The version of Kubernetes running on this NodePool's nodes. If unspecified, it defaults as described [here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version). |
| `↳ instance_group_urls` | `string[]` Output only. The resource URLs of the [managed instance groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances) associated with this node pool. During the node pool blue-green upgrade operation, the URLs contain both blue and green resources. |
| `↳ status` | `int` Output only. The status of the nodes in this pool instance. |
| `↳ status_message` | `string` Output only. Deprecated. Use conditions instead. Additional information about the current status of this node pool instance, if available. |
| `↳ autoscaling` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePoolAutoscaling` Autoscaler configuration for this NodePool. Autoscaler is enabled only if a valid configuration is present. |
| `↳ management` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeManagement` NodeManagement configuration for this NodePool. |
| `↳ max_pods_constraint` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.MaxPodsConstraint` The constraint on the maximum number of pods that can be run simultaneously on a node in the node pool. |
| `↳ conditions` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.StatusCondition>` Which conditions caused the current node pool state. |
| `↳ pod_ipv4_cidr_size` | `int` Output only. The pod CIDR block size per node in this node pool. |
| `↳ upgrade_settings` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpgradeSettings` Upgrade settings control disruption and speed of the upgrade. |
| `↳ placement_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.PlacementPolicy` Specifies the node placement policy. |
| `↳ update_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpdateInfo` Output only. Update info contains relevant information during a node pool update. |
| `↳ etag` | `string` This checksum is computed by the server based on the value of node pool fields, and may be sent on update requests to ensure the client has an up-to-date value before proceeding. |
| `↳ queued_provisioning` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.QueuedProvisioning` Specifies the configuration of queued provisioning. |
| `↳ best_effort_provisioning` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.BestEffortProvisioning` Enable best effort provisioning for nodes |
| `↳ node_drain_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodeDrainConfig` Specifies the node drain configuration for this node pool. |
| `↳ maintenance_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodePoolMaintenancePolicy` Optional. Specifies the maintenance policy for the node pool. |

### getName

The name of the node pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

The name of the node pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfig

The node configuration of the pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeConfig|null` |   |

### hasConfig

### clearConfig

### setConfig

The node configuration of the pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInitialNodeCount

The initial node count for the pool. You must ensure that your
Compute Engine [resource
quota](https://cloud.google.com/compute/quotas)
is sufficient for this number of instances. You must also have available
firewall and routes quota.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setInitialNodeCount

The initial node count for the pool. You must ensure that your
Compute Engine [resource
quota](https://cloud.google.com/compute/quotas)
is sufficient for this number of instances. You must also have available
firewall and routes quota.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLocations

The list of Google Compute Engine
[zones](https://cloud.google.com/compute/docs/zones#available)
in which the NodePool's nodes should be located.

If this value is unspecified during node pool creation, the
[Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations)
value will be used, instead.
Warning: changing node pool locations will result in nodes being added
and/or removed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setLocations

The list of Google Compute Engine
[zones](https://cloud.google.com/compute/docs/zones#available)
in which the NodePool's nodes should be located.

If this value is unspecified during node pool creation, the
[Cluster.Locations](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.FIELDS.locations)
value will be used, instead.
Warning: changing node pool locations will result in nodes being added
and/or removed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNetworkConfig

Networking configuration for this NodePool. If specified, it overrides the
cluster-level defaults.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeNetworkConfig|null` |   |

### hasNetworkConfig

### clearNetworkConfig

### setNetworkConfig

Networking configuration for this NodePool. If specified, it overrides the
cluster-level defaults.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeNetworkConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSelfLink

Output only. Server-defined URL for the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSelfLink

Output only. Server-defined URL for the resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVersion

The version of Kubernetes running on this NodePool's nodes. If unspecified,
it defaults as described
[here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setVersion

The version of Kubernetes running on this NodePool's nodes. If unspecified,
it defaults as described
[here](https://cloud.google.com/kubernetes-engine/versioning#specifying_node_version).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInstanceGroupUrls

Output only. The resource URLs of the [managed instance
groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances)
associated with this node pool.

During the node pool blue-green upgrade operation, the URLs contain both
blue and green resources.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setInstanceGroupUrls

Output only. The resource URLs of the [managed instance
groups](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances)
associated with this node pool.

During the node pool blue-green upgrade operation, the URLs contain both
blue and green resources.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatus

Output only. The status of the nodes in this pool instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Status](https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.Status). |

### setStatus

Output only. The status of the nodes in this pool instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Status](https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.Status). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatusMessage

Output only. Deprecated. Use conditions instead.

Additional information about the current status of this
node pool instance, if available.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setStatusMessage

Output only. Deprecated. Use conditions instead.

Additional information about the current status of this
node pool instance, if available.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAutoscaling

Autoscaler configuration for this NodePool. Autoscaler is enabled
only if a valid configuration is present.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePoolAutoscaling|null` |   |

### hasAutoscaling

### clearAutoscaling

### setAutoscaling

Autoscaler configuration for this NodePool. Autoscaler is enabled
only if a valid configuration is present.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePoolAutoscaling` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getManagement

NodeManagement configuration for this NodePool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeManagement|null` |   |

### hasManagement

### clearManagement

### setManagement

NodeManagement configuration for this NodePool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodeManagement` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMaxPodsConstraint

The constraint on the maximum number of pods that can be run
simultaneously on a node in the node pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.MaxPodsConstraint|null` |   |

### hasMaxPodsConstraint

### clearMaxPodsConstraint

### setMaxPodsConstraint

The constraint on the maximum number of pods that can be run
simultaneously on a node in the node pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.MaxPodsConstraint` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConditions

Which conditions caused the current node pool state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.StatusCondition>` |   |

### setConditions

Which conditions caused the current node pool state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.StatusCondition>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPodIpv4CidrSize

Output only. The pod CIDR block size per node in this node pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setPodIpv4CidrSize

Output only. The pod CIDR block size per node in this node pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpgradeSettings

Upgrade settings control disruption and speed of the upgrade.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpgradeSettings|null` |   |

### hasUpgradeSettings

### clearUpgradeSettings

### setUpgradeSettings

Upgrade settings control disruption and speed of the upgrade.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpgradeSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPlacementPolicy

Specifies the node placement policy.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.PlacementPolicy|null` |   |

### hasPlacementPolicy

### clearPlacementPolicy

### setPlacementPolicy

Specifies the node placement policy.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.PlacementPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateInfo

Output only. Update info contains relevant information during a node
pool update.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpdateInfo|null` |   |

### hasUpdateInfo

### clearUpdateInfo

### setUpdateInfo

Output only. Update info contains relevant information during a node
pool update.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.UpdateInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEtag

This checksum is computed by the server based on the value of node pool
fields, and may be sent on update requests to ensure the client has an
up-to-date value before proceeding.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setEtag

This checksum is computed by the server based on the value of node pool
fields, and may be sent on update requests to ensure the client has an
up-to-date value before proceeding.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQueuedProvisioning

Specifies the configuration of queued provisioning.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.QueuedProvisioning|null` |   |

### hasQueuedProvisioning

### clearQueuedProvisioning

### setQueuedProvisioning

Specifies the configuration of queued provisioning.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.QueuedProvisioning` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBestEffortProvisioning

Enable best effort provisioning for nodes

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.BestEffortProvisioning|null` |   |

### hasBestEffortProvisioning

### clearBestEffortProvisioning

### setBestEffortProvisioning

Enable best effort provisioning for nodes

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.BestEffortProvisioning` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNodeDrainConfig

Specifies the node drain configuration for this node pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodeDrainConfig|null` |   |

### hasNodeDrainConfig

### clearNodeDrainConfig

### setNodeDrainConfig

Specifies the node drain configuration for this node pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodeDrainConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMaintenancePolicy

Optional. Specifies the maintenance policy for the node pool.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodePoolMaintenancePolicy|null` |   |

### hasMaintenancePolicy

### clearMaintenancePolicy

### setMaintenancePolicy

Optional. Specifies the maintenance policy for the node pool.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-container/latest/V1.NodePool.NodePoolMaintenancePolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |