# Google Cloud Dataproc V1 Client - Class GkeNodeConfig (3.14.0)

3.14.0 (latest) 3.13.4 3.12.0 3.11.0 3.10.1 3.9.0 3.8.1 3.7.1 3.6.1 3.5.1 3.4.0 3.3.0 3.2.2 2.12.0 2.11.0 2.10.0 2.9.1 2.8.2 2.7.0 2.6.1 2.5.0 2.3.0 2.2.3 2.1.0 2.0.0 Reference documentation and code samples for the Google Cloud Dataproc V1 Client class GkeNodeConfig.

Parameters that describe cluster nodes.

Generated from protobuf message `google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig`

## Namespace

Google \\ Cloud \\ Dataproc \\ V1 \\ GkeNodePoolConfig

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ machine_type` | `string` Optional. The name of a Compute Engine [machine type](https://cloud.google.com/compute/docs/machine-types). |
| `↳ local_ssd_count` | `int` Optional. The number of local SSD disks to attach to the node, which is limited by the maximum number of disks allowable per zone (see [Adding Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)). |
| `↳ preemptible` | `bool` Optional. Whether the nodes are created as legacy [preemptible VM instances](https://cloud.google.com/compute/docs/instances/preemptible). Also see [Spot](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getSpot__) VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot preemptible nodes cannot be used in a node pool with the `CONTROLLER` [role](https://docs.cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) or in the DEFAULT node pool if the CONTROLLER role is not assigned (the DEFAULT node pool will assume the CONTROLLER role). |
| `↳ accelerators` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig>` Optional. A list of [hardware accelerators](https://cloud.google.com/compute/docs/gpus) to attach to each node. |
| `↳ min_cpu_platform` | `string` Optional. [Minimum CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) to be used by this instance. The instance may be scheduled on the specified or a newer CPU platform. Specify the friendly names of CPU platforms, such as "Intel Haswell"\` or Intel Sandy Bridge". |
| `↳ boot_disk_kms_key` | `string` Optional. The [Customer Managed Encryption Key (CMEK)](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek) used to encrypt the boot disk attached to each node in the node pool. Specify the key using the following format: `projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME`. |
| `↳ spot` | `bool` Optional. Whether the nodes are created as [Spot VM instances](https://cloud.google.com/compute/docs/instances/spot). Spot VMs are the latest update to legacy [preemptible VMs](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getPreemptible__). Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible nodes cannot be used in a node pool with the `CONTROLLER` [role](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) or in the DEFAULT node pool if the CONTROLLER role is not assigned (the DEFAULT node pool will assume the CONTROLLER role). |

### getMachineType

Optional. The name of a Compute Engine [machine
type](https://cloud.google.com/compute/docs/machine-types).

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

### setMachineType

Optional. The name of a Compute Engine [machine
type](https://cloud.google.com/compute/docs/machine-types).

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

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

### getLocalSsdCount

Optional. The number of local SSD disks to attach to the node, which is
limited by the maximum number of disks allowable per zone (see [Adding
Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)).

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

### setLocalSsdCount

Optional. The number of local SSD disks to attach to the node, which is
limited by the maximum number of disks allowable per zone (see [Adding
Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)).

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

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

### getPreemptible

Optional. Whether the nodes are created as legacy [preemptible VM
instances](https://cloud.google.com/compute/docs/instances/preemptible).

Also see
[Spot](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getSpot__)
VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot
preemptible nodes cannot be used in a node pool with the `CONTROLLER`
[role](https://docs.cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
DEFAULT node pool will assume the CONTROLLER role).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setPreemptible

Optional. Whether the nodes are created as legacy [preemptible VM
instances](https://cloud.google.com/compute/docs/instances/preemptible).

Also see
[Spot](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getSpot__)
VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot
preemptible nodes cannot be used in a node pool with the `CONTROLLER`
[role](https://docs.cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
DEFAULT node pool will assume the CONTROLLER role).

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

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

### getAccelerators

Optional. A list of [hardware
accelerators](https://cloud.google.com/compute/docs/gpus) to attach to
each node.

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

### setAccelerators

Optional. A list of [hardware
accelerators](https://cloud.google.com/compute/docs/gpus) to attach to
each node.

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

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

### getMinCpuPlatform

Optional. [Minimum CPU
platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
to be used by this instance. The instance may be scheduled on the
specified or a newer CPU platform. Specify the friendly names of CPU
platforms, such as "Intel Haswell"\` or Intel Sandy Bridge".

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

### setMinCpuPlatform

Optional. [Minimum CPU
platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
to be used by this instance. The instance may be scheduled on the
specified or a newer CPU platform. Specify the friendly names of CPU
platforms, such as "Intel Haswell"\` or Intel Sandy Bridge".

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

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

### getBootDiskKmsKey

Optional. The [Customer Managed Encryption Key (CMEK)](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek)
used to encrypt the boot disk attached to each node in the node pool.

Specify the key using the following format:
`projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME`.

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

### setBootDiskKmsKey

Optional. The [Customer Managed Encryption Key (CMEK)](https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek)
used to encrypt the boot disk attached to each node in the node pool.

Specify the key using the following format:
`projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME`.

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

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

### getSpot

Optional. Whether the nodes are created as [Spot VM instances](https://cloud.google.com/compute/docs/instances/spot).

Spot VMs are the latest update to legacy
[preemptible
VMs](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getPreemptible__).
Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible
nodes cannot be used in a node pool with the `CONTROLLER`
[role](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
DEFAULT node pool will assume the CONTROLLER role).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSpot

Optional. Whether the nodes are created as [Spot VM instances](https://cloud.google.com/compute/docs/instances/spot).

Spot VMs are the latest update to legacy
[preemptible
VMs](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.GkeNodePoolConfig.GkeNodeConfig#_Google_Cloud_Dataproc_V1_GkeNodePoolConfig_GkeNodeConfig__getPreemptible__).
Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible
nodes cannot be used in a node pool with the `CONTROLLER`
[role](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
DEFAULT node pool will assume the CONTROLLER role).

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

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