Reference documentation and code samples for the Google Cloud Container V1 Client class NodeConfig.
Parameters that describe the nodes in a cluster.
GKE Autopilot clusters do not
recognize parameters in NodeConfig
. Use AutoprovisioningNodePoolDefaults
instead.
Generated from protobuf message google.container.v1.NodeConfig
Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ machine_type
string
The name of a Google Compute Engine machine type
If unspecified, the default machine type is e2-medium
.
↳ disk_size_gb
int
Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.
↳ oauth_scopes
array
The set of Google API scopes to be made available on all of the node VMs under the "default" service account. The following scopes are recommended, but not required, and by default are not included: * https://www.googleapis.com/auth/compute
is required for mounting persistent storage on your nodes. * https://www.googleapis.com/auth/devstorage.read_only
is required for communicating with gcr.io(the Google Container Registry
). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added.
↳ service_account
string
The Google Cloud Platform Service Account to be used by the node VMs. Specify the email address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used.
↳ metadata
array|Google\Protobuf\Internal\MapField
The metadata key/value pairs assigned to instances in the cluster. Keys must conform to the regexp [a-zA-Z0-9-_]+
and be less than 128 bytes in length. These are reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the reserved keys: - "cluster-location" - "cluster-name" - "cluster-uid" - "configure-sh" - "containerd-configure-sh" - "enable-os-login" - "gci-ensure-gke-docker" - "gci-metrics-enabled" - "gci-update-strategy" - "instance-template" - "kube-env" - "startup-script" - "user-data" - "disable-address-manager" - "windows-startup-script-ps1" - "common-psm1" - "k8s-node-setup-psm1" - "install-ssh-psm1" - "user-profile-psm1" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB.
↳ image_type
string
The image type to use for this node. Note that for a given image type, the latest version of it will be used.
↳ labels
array|Google\Protobuf\Internal\MapField
The map of Kubernetes labels (key/value pairs) to be applied to each node. These will added in addition to any default label(s) that Kubernetes may apply to the node. In case of conflict in label keys, the applied set may differ depending on the Kubernetes version -- it's best to assume the behavior is undefined and conflicts should be avoided. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
↳ local_ssd_count
int
The number of local SSD disks to be attached to the node. The limit for this value is dependent upon the maximum number of disks available on a machine per zone. See: https://cloud.google.com/compute/docs/disks/local-ssd for more information.
↳ tags
array
The list of instance tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during cluster or node pool creation. Each tag within the list must comply with RFC1035.
↳ preemptible
bool
Whether the nodes are created as preemptible VM instances. See: https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances.
↳ accelerators
array< Google\Cloud\Container\V1\AcceleratorConfig
>
A list of hardware accelerators to be attached to each node. See https://cloud.google.com/compute/docs/gpus for more information about support for GPUs.
↳ disk_type
string
Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') If unspecified, the default disk type is 'pd-standard'
↳ min_cpu_platform
string
Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell"
or minCpuPlatform: "Intel Sandy Bridge"
. For more information, read how to specify min CPU platform
↳ workload_metadata_config
↳ taints
array< Google\Cloud\Container\V1\NodeTaint
>
List of kubernetes taints to be applied to each node. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
↳ sandbox_config
↳ node_group
string
Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes .
↳ reservation_affinity
Google\Cloud\Container\V1\ReservationAffinity
The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this node pool.
↳ shielded_instance_config
↳ linux_node_config
↳ kubelet_config
↳ boot_disk_kms_key
string
The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption
↳ gcfs_config
↳ advanced_machine_features
↳ gvnic
↳ spot
bool
Spot flag for enabling Spot VM, which is a rebrand of the existing preemptible flag.
↳ confidential_nodes
Google\Cloud\Container\V1\ConfidentialNodes
Confidential nodes config. All the nodes in the node pool will be Confidential VM once enabled.
↳ fast_socket
↳ resource_labels
array|Google\Protobuf\Internal\MapField
The resource labels for the node pool to use to annotate any related Google Compute Engine resources.
↳ logging_config
getMachineType
The name of a Google Compute Engine machine
type
If unspecified, the default machine type is e2-medium
.
Generated from protobuf field string machine_type = 1;
string
setMachineType
The name of a Google Compute Engine machine
type
If unspecified, the default machine type is e2-medium
.
Generated from protobuf field string machine_type = 1;
var
string
$this
getDiskSizeGb
Size of the disk attached to each node, specified in GB.
The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.
Generated from protobuf field int32 disk_size_gb = 2;
int
setDiskSizeGb
Size of the disk attached to each node, specified in GB.
The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.
Generated from protobuf field int32 disk_size_gb = 2;
var
int
$this
getOauthScopes
The set of Google API scopes to be made available on all of the node VMs under the "default" service account.
The following scopes are recommended, but not required, and by default are not included:
-
https://www.googleapis.com/auth/compute
is required for mounting persistent storage on your nodes. -
https://www.googleapis.com/auth/devstorage.read_only
is required for communicating with gcr.io(the Google Container Registry ). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added.
Generated from protobuf field repeated string oauth_scopes = 3;
Google\Protobuf\Internal\RepeatedField
setOauthScopes
The set of Google API scopes to be made available on all of the node VMs under the "default" service account.
The following scopes are recommended, but not required, and by default are not included:
-
https://www.googleapis.com/auth/compute
is required for mounting persistent storage on your nodes. -
https://www.googleapis.com/auth/devstorage.read_only
is required for communicating with gcr.io(the Google Container Registry ). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added.
Generated from protobuf field repeated string oauth_scopes = 3;
var
string[]
$this
getServiceAccount
The Google Cloud Platform Service Account to be used by the node VMs.
Specify the email address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used.
Generated from protobuf field string service_account = 9;
string
setServiceAccount
The Google Cloud Platform Service Account to be used by the node VMs.
Specify the email address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used.
Generated from protobuf field string service_account = 9;
var
string
$this
getMetadata
The metadata key/value pairs assigned to instances in the cluster.
Keys must conform to the regexp [a-zA-Z0-9-_]+
and be less than 128 bytes
in length. These are reflected as part of a URL in the metadata server.
Additionally, to avoid ambiguity, keys must not conflict with any other
metadata keys for the project or be one of the reserved keys:
- "cluster-location"
- "cluster-name"
- "cluster-uid"
- "configure-sh"
- "containerd-configure-sh"
- "enable-os-login"
- "gci-ensure-gke-docker"
- "gci-metrics-enabled"
- "gci-update-strategy"
- "instance-template"
- "kube-env"
- "startup-script"
- "user-data"
- "disable-address-manager"
- "windows-startup-script-ps1"
- "common-psm1"
- "k8s-node-setup-psm1"
- "install-ssh-psm1"
- "user-profile-psm1" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB.
Generated from protobuf field map<string, string> metadata = 4;
Google\Protobuf\Internal\MapField
setMetadata
The metadata key/value pairs assigned to instances in the cluster.
Keys must conform to the regexp [a-zA-Z0-9-_]+
and be less than 128 bytes
in length. These are reflected as part of a URL in the metadata server.
Additionally, to avoid ambiguity, keys must not conflict with any other
metadata keys for the project or be one of the reserved keys:
- "cluster-location"
- "cluster-name"
- "cluster-uid"
- "configure-sh"
- "containerd-configure-sh"
- "enable-os-login"
- "gci-ensure-gke-docker"
- "gci-metrics-enabled"
- "gci-update-strategy"
- "instance-template"
- "kube-env"
- "startup-script"
- "user-data"
- "disable-address-manager"
- "windows-startup-script-ps1"
- "common-psm1"
- "k8s-node-setup-psm1"
- "install-ssh-psm1"
- "user-profile-psm1" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB.
Generated from protobuf field map<string, string> metadata = 4;
var
array|Google\Protobuf\Internal\MapField
$this
getImageType
The image type to use for this node. Note that for a given image type, the latest version of it will be used.
Generated from protobuf field string image_type = 5;
string
setImageType
The image type to use for this node. Note that for a given image type, the latest version of it will be used.
Generated from protobuf field string image_type = 5;
var
string
$this
getLabels
The map of Kubernetes labels (key/value pairs) to be applied to each node.
These will added in addition to any default label(s) that Kubernetes may apply to the node. In case of conflict in label keys, the applied set may differ depending on the Kubernetes version -- it's best to assume the behavior is undefined and conflicts should be avoided. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
Generated from protobuf field map<string, string> labels = 6;
Google\Protobuf\Internal\MapField
setLabels
The map of Kubernetes labels (key/value pairs) to be applied to each node.
These will added in addition to any default label(s) that Kubernetes may apply to the node. In case of conflict in label keys, the applied set may differ depending on the Kubernetes version -- it's best to assume the behavior is undefined and conflicts should be avoided. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
Generated from protobuf field map<string, string> labels = 6;
var
array|Google\Protobuf\Internal\MapField
$this
getLocalSsdCount
The number of local SSD disks to be attached to the node.
The limit for this value is dependent upon the maximum number of disks available on a machine per zone. See: https://cloud.google.com/compute/docs/disks/local-ssd for more information.
Generated from protobuf field int32 local_ssd_count = 7;
int
setLocalSsdCount
The number of local SSD disks to be attached to the node.
The limit for this value is dependent upon the maximum number of disks available on a machine per zone. See: https://cloud.google.com/compute/docs/disks/local-ssd for more information.
Generated from protobuf field int32 local_ssd_count = 7;
var
int
$this
getTags
The list of instance tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during cluster or node pool creation. Each tag within the list must comply with RFC1035.
Generated from protobuf field repeated string tags = 8;
Google\Protobuf\Internal\RepeatedField
setTags
The list of instance tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during cluster or node pool creation. Each tag within the list must comply with RFC1035.
Generated from protobuf field repeated string tags = 8;
var
string[]
$this
getPreemptible
Whether the nodes are created as preemptible VM instances. See: https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances.
Generated from protobuf field bool preemptible = 10;
bool
setPreemptible
Whether the nodes are created as preemptible VM instances. See: https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances.
Generated from protobuf field bool preemptible = 10;
var
bool
$this
getAccelerators
A list of hardware accelerators to be attached to each node.
See https://cloud.google.com/compute/docs/gpus for more information about support for GPUs.
Generated from protobuf field repeated .google.container.v1.AcceleratorConfig accelerators = 11;
Google\Protobuf\Internal\RepeatedField
setAccelerators
A list of hardware accelerators to be attached to each node.
See https://cloud.google.com/compute/docs/gpus for more information about support for GPUs.
Generated from protobuf field repeated .google.container.v1.AcceleratorConfig accelerators = 11;
$this
getDiskType
Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') If unspecified, the default disk type is 'pd-standard'
Generated from protobuf field string disk_type = 12;
string
setDiskType
Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') If unspecified, the default disk type is 'pd-standard'
Generated from protobuf field string disk_type = 12;
var
string
$this
getMinCpuPlatform
Minimum CPU platform to be used by this instance. The instance may be
scheduled on the specified or newer CPU platform. Applicable values are the
friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell"
or minCpuPlatform: "Intel Sandy Bridge"
. For more
information, read how to specify min CPU
platform
Generated from protobuf field string min_cpu_platform = 13;
string
setMinCpuPlatform
Minimum CPU platform to be used by this instance. The instance may be
scheduled on the specified or newer CPU platform. Applicable values are the
friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell"
or minCpuPlatform: "Intel Sandy Bridge"
. For more
information, read how to specify min CPU
platform
Generated from protobuf field string min_cpu_platform = 13;
var
string
$this
getWorkloadMetadataConfig
The workload metadata configuration for this node.
Generated from protobuf field .google.container.v1.WorkloadMetadataConfig workload_metadata_config = 14;
hasWorkloadMetadataConfig
clearWorkloadMetadataConfig
setWorkloadMetadataConfig
The workload metadata configuration for this node.
Generated from protobuf field .google.container.v1.WorkloadMetadataConfig workload_metadata_config = 14;
$this
getTaints
List of kubernetes taints to be applied to each node.
For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
Generated from protobuf field repeated .google.container.v1.NodeTaint taints = 15;
Google\Protobuf\Internal\RepeatedField
setTaints
List of kubernetes taints to be applied to each node.
For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
Generated from protobuf field repeated .google.container.v1.NodeTaint taints = 15;
$this
getSandboxConfig
Sandbox configuration for this node.
Generated from protobuf field .google.container.v1.SandboxConfig sandbox_config = 17;
hasSandboxConfig
clearSandboxConfig
setSandboxConfig
Sandbox configuration for this node.
Generated from protobuf field .google.container.v1.SandboxConfig sandbox_config = 17;
$this
getNodeGroup
Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes .
Generated from protobuf field string node_group = 18;
string
setNodeGroup
Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes .
Generated from protobuf field string node_group = 18;
var
string
$this
getReservationAffinity
The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this node pool.
Generated from protobuf field .google.container.v1.ReservationAffinity reservation_affinity = 19;
hasReservationAffinity
clearReservationAffinity
setReservationAffinity
The optional reservation affinity. Setting this field will apply the specified Zonal Compute Reservation to this node pool.
Generated from protobuf field .google.container.v1.ReservationAffinity reservation_affinity = 19;
$this
getShieldedInstanceConfig
Shielded Instance options.
Generated from protobuf field .google.container.v1.ShieldedInstanceConfig shielded_instance_config = 20;
hasShieldedInstanceConfig
clearShieldedInstanceConfig
setShieldedInstanceConfig
Shielded Instance options.
Generated from protobuf field .google.container.v1.ShieldedInstanceConfig shielded_instance_config = 20;
$this
getLinuxNodeConfig
Parameters that can be configured on Linux nodes.
Generated from protobuf field .google.container.v1.LinuxNodeConfig linux_node_config = 21;
hasLinuxNodeConfig
clearLinuxNodeConfig
setLinuxNodeConfig
Parameters that can be configured on Linux nodes.
Generated from protobuf field .google.container.v1.LinuxNodeConfig linux_node_config = 21;
$this
getKubeletConfig
Node kubelet configs.
Generated from protobuf field .google.container.v1.NodeKubeletConfig kubelet_config = 22;
hasKubeletConfig
clearKubeletConfig
setKubeletConfig
Node kubelet configs.
Generated from protobuf field .google.container.v1.NodeKubeletConfig kubelet_config = 22;
$this
getBootDiskKmsKey
The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption
Generated from protobuf field string boot_disk_kms_key = 23;
string
setBootDiskKmsKey
The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption
Generated from protobuf field string boot_disk_kms_key = 23;
var
string
$this
getGcfsConfig
Google Container File System (image streaming) configs.
Generated from protobuf field .google.container.v1.GcfsConfig gcfs_config = 25;
hasGcfsConfig
clearGcfsConfig
setGcfsConfig
Google Container File System (image streaming) configs.
Generated from protobuf field .google.container.v1.GcfsConfig gcfs_config = 25;
$this
getAdvancedMachineFeatures
Advanced features for the Compute Engine VM.
Generated from protobuf field .google.container.v1.AdvancedMachineFeatures advanced_machine_features = 26;
hasAdvancedMachineFeatures
clearAdvancedMachineFeatures
setAdvancedMachineFeatures
Advanced features for the Compute Engine VM.
Generated from protobuf field .google.container.v1.AdvancedMachineFeatures advanced_machine_features = 26;
$this
getGvnic
Enable or disable gvnic in the node pool.
Generated from protobuf field .google.container.v1.VirtualNIC gvnic = 29;
hasGvnic
clearGvnic
setGvnic
Enable or disable gvnic in the node pool.
Generated from protobuf field .google.container.v1.VirtualNIC gvnic = 29;
$this
getSpot
Spot flag for enabling Spot VM, which is a rebrand of the existing preemptible flag.
Generated from protobuf field bool spot = 32;
bool
setSpot
Spot flag for enabling Spot VM, which is a rebrand of the existing preemptible flag.
Generated from protobuf field bool spot = 32;
var
bool
$this
getConfidentialNodes
Confidential nodes config.
All the nodes in the node pool will be Confidential VM once enabled.
Generated from protobuf field .google.container.v1.ConfidentialNodes confidential_nodes = 35;
hasConfidentialNodes
clearConfidentialNodes
setConfidentialNodes
Confidential nodes config.
All the nodes in the node pool will be Confidential VM once enabled.
Generated from protobuf field .google.container.v1.ConfidentialNodes confidential_nodes = 35;
$this
getFastSocket
Enable or disable NCCL fast socket for the node pool.
Generated from protobuf field optional .google.container.v1.FastSocket fast_socket = 36;
hasFastSocket
clearFastSocket
setFastSocket
Enable or disable NCCL fast socket for the node pool.
Generated from protobuf field optional .google.container.v1.FastSocket fast_socket = 36;
$this
getResourceLabels
The resource labels for the node pool to use to annotate any related Google Compute Engine resources.
Generated from protobuf field map<string, string> resource_labels = 37;
Google\Protobuf\Internal\MapField
setResourceLabels
The resource labels for the node pool to use to annotate any related Google Compute Engine resources.
Generated from protobuf field map<string, string> resource_labels = 37;
var
array|Google\Protobuf\Internal\MapField
$this
getLoggingConfig
Logging configuration.
Generated from protobuf field .google.container.v1.NodePoolLoggingConfig logging_config = 38;
hasLoggingConfig
clearLoggingConfig
setLoggingConfig
Logging configuration.
Generated from protobuf field .google.container.v1.NodePoolLoggingConfig logging_config = 38;
$this