gcloud container node-pools create NAME [--accelerator=[type=TYPE,[count=COUNT,gpu-driver-version=GPU_DRIVER_VERSION,gpu-partition-size=GPU_PARTITION_SIZE,gpu-sharing-strategy=GPU_SHARING_STRATEGY,max-shared-clients-per-gpu=MAX_SHARED_CLIENTS_PER_GPU],…]] [--accelerator-network-profile=ACCELERATOR_NETWORK_PROFILE] [--add-maintenance-exclusion-until-end-of-support] [--additional-node-network=[network=NETWORK_NAME,subnetwork=SUBNETWORK_NAME[,stack-type=STACK_TYPE],…]] [--additional-pod-network=[subnetwork=SUBNETWORK_NAME,pod-ipv4-range=SECONDARY_RANGE_NAME,[max-pods-per-node=NUM_PODS],…]] [--async] [--autoscaled-rollout-policy=[wait-for-drain-duration=WAIT-FOR-DRAIN-DURATION]] [--boot-disk-kms-key=BOOT_DISK_KMS_KEY] [--boot-disk-provisioned-iops=BOOT_DISK_PROVISIONED_IOPS] [--boot-disk-provisioned-throughput=BOOT_DISK_PROVISIONED_THROUGHPUT] [--cluster=CLUSTER] [--confidential-node-type=CONFIDENTIAL_NODE_TYPE] [--consolidation-delay=CONSOLIDATION_DELAY] [--containerd-config-from-file=PATH_TO_FILE] [--data-cache-count=DATA_CACHE_COUNT] [--disk-size=DISK_SIZE] [--disk-type=DISK_TYPE] [--enable-autoprovisioning] [--enable-autorepair] [--no-enable-autoupgrade] [--enable-blue-green-upgrade] [--enable-confidential-nodes] [--enable-confidential-storage] [--enable-gvnic] [--enable-image-streaming] [--enable-insecure-kubelet-readonly-port] [--enable-kernel-module-signature-enforcement] [--enable-nested-virtualization] [--enable-private-nodes] [--enable-queued-provisioning] [--enable-surge-upgrade] [--flex-start] [--image=IMAGE] [--image-project=IMAGE_PROJECT] [--image-type=IMAGE_TYPE] [--labels=[KEY=VALUE,…]] [--logging-variant=LOGGING_VARIANT] [--machine-type=MACHINE_TYPE, -m MACHINE_TYPE] [--max-pods-per-node=MAX_PODS_PER_NODE] [--max-run-duration=MAX_RUN_DURATION] [--max-surge-upgrade=MAX_SURGE_UPGRADE; default=1] [--max-unavailable-upgrade=MAX_UNAVAILABLE_UPGRADE] [--metadata=KEY=VALUE,[KEY=VALUE,…]] [--metadata-from-file=KEY=LOCAL_FILE_PATH,[…]] [--min-cpu-platform=PLATFORM] [--network-performance-configs=[PROPERTY=VALUE,…]] [--node-architecture-taint-behavior=NODE_ARCHITECTURE_TAINT_BEHAVIOR] [--node-group=NODE_GROUP] [--node-labels=[NODE_LABEL,…]] [--node-locations=ZONE,[ZONE,…]] [--node-pool-soak-duration=NODE_POOL_SOAK_DURATION] [--node-taints=[NODE_TAINT,…]] [--node-version=NODE_VERSION] [--num-nodes=NUM_NODES] [--opportunistic-maintenance=[node-idle-time=NODE_IDLE_TIME,window=WINDOW,min-nodes=MIN_NODES,…]] [--performance-monitoring-unit=PERFORMANCE_MONITORING_UNIT] [--placement-policy=PLACEMENT_POLICY] [--placement-type=PLACEMENT_TYPE] [--preemptible] [--resource-manager-tags=[KEY=VALUE,…]] [--sandbox=[type=TYPE]] [--secondary-boot-disk=[disk-image=DISK_IMAGE,[mode=MODE],…]] [--shielded-integrity-monitoring] [--shielded-secure-boot] [--sole-tenant-min-node-cpus=SOLE_TENANT_MIN_NODE_CPUS] [--sole-tenant-node-affinity-file=SOLE_TENANT_NODE_AFFINITY_FILE] [--spot] [--standard-rollout-policy=[batch-node-count=BATCH_NODE_COUNT,batch-percent=BATCH_NODE_PERCENTAGE,batch-soak-duration=BATCH_SOAK_DURATION,…]] [--storage-pools=STORAGE_POOL,[…]] [--subnetwork=SUBNETWORK] [--system-config-from-file=PATH_TO_FILE] [--tags=TAG,[TAG,…]] [--threads-per-core=THREADS_PER_CORE] [--tpu-topology=TPU_TOPOLOGY] [--windows-os-version=WINDOWS_OS_VERSION] [--workload-metadata=WORKLOAD_METADATA] [--create-pod-ipv4-range=[KEY=VALUE,…] | --pod-ipv4-range=NAME] [--enable-autoscaling --location-policy=LOCATION_POLICY --max-nodes=MAX_NODES --min-nodes=MIN_NODES --total-max-nodes=TOTAL_MAX_NODES --total-min-nodes=TOTAL_MIN_NODES] [--enable-best-effort-provision --min-provision-nodes=MIN_PROVISION_NODES] [--ephemeral-storage-local-ssd[=[count=COUNT]] | --local-nvme-ssd-block[=[count=COUNT]] | --local-ssd-count=LOCAL_SSD_COUNT] [--location=LOCATION | --region=REGION | --zone=ZONE, -z ZONE] [--node-drain-grace-period-seconds=NODE_DRAIN_GRACE_PERIOD_SECONDS --node-drain-pdb-timeout-seconds=NODE_DRAIN_PDB_TIMEOUT_SECONDS --respect-pdb-during-node-pool-deletion] [--reservation=RESERVATION --reservation-affinity=RESERVATION_AFFINITY] [--scopes=[SCOPE,…]; default="gke-default" --service-account=SERVICE_ACCOUNT] [GCLOUD_WIDE_FLAG …]
gcloud container node-pools create facilitates the creation of a
node pool in a Google Kubernetes Engine cluster. A variety of options exists to
customize the node configuration and the number of nodes created.
gcloud container node-pools create node-pool-1 --cluster=sample-clusterThe new node pool will show up in the cluster after all the nodes have been provisioned.
To create a node pool with 5 nodes, run:
gcloud container node-pools create node-pool-1 --cluster=sample-cluster --num-nodes=5NAME--accelerator=[type=TYPE,[count=COUNT,gpu-driver-version=GPU_DRIVER_VERSION,gpu-partition-size=GPU_PARTITION_SIZE,gpu-sharing-strategy=GPU_SHARING_STRATEGY,max-shared-clients-per-gpu=MAX_SHARED_CLIENTS_PER_GPU],…]typegcloud compute accelerator-types
list to learn about all available accelerator types.
countgpu-driver-version`default`: Install the default driver version for this GKE version. For GKE version 1.30.1-gke.1156000 and later, this is the default option.
`latest`: Install the latest driver version available for this GKE version. Can only be used for nodes that use Container-Optimized OS.
`disabled`: Skip automatic driver installation. You must manually install a driver after you create the cluster. For GKE version 1.30.1-gke.1156000 and earlier, this is the default option. To manually install the GPU driver, refer to https://cloud.google.com/kubernetes-engine/docs/how-to/gpus#installing_drivers.
gpu-partition-sizegpu-sharing-strategygpu-sharing-strategy.
--accelerator-network-profile=ACCELERATOR_NETWORK_PROFILEauto value is supported. A compatible
Accelerator machine type needs to be specified with the
--machine-type flag. An Accelerator Network Profile will be created
if it does not exist.
Node pool maintenance exclusions
--add-maintenance-exclusion-until-end-of-support--additional-node-network=[network=NETWORK_NAME,subnetwork=SUBNETWORK_NAME[,stack-type=STACK_TYPE],…]networksubnetworkstack-type--additional-pod-network=[subnetwork=SUBNETWORK_NAME,pod-ipv4-range=SECONDARY_RANGE_NAME,[max-pods-per-node=NUM_PODS],…]subnetworkpod-ipv4-rangemax-pods-per-node--async--autoscaled-rollout-policy=[wait-for-drain-duration=WAIT-FOR-DRAIN-DURATION]wait-for-drain-durationExamples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --enable-blue-green-upgrade --autoscaled-rollout-policy=""gcloud container node-pools create node-pool-1 --cluster=example-cluster --enable-blue-green-upgrade --autoscaled-rollout-policy=wait-for-drain-duration=7200s--boot-disk-kms-key=BOOT_DISK_KMS_KEY--boot-disk-provisioned-iops=BOOT_DISK_PROVISIONED_IOPS--boot-disk-provisioned-throughput=BOOT_DISK_PROVISIONED_THROUGHPUT--cluster=CLUSTERcontainer/cluster property value for this command invocation.
--confidential-node-type=CONFIDENTIAL_NODE_TYPECONFIDENTIAL_NODE_TYPE must be one of: sev,
sev_snp, tdx, disabled.
--consolidation-delay=CONSOLIDATION_DELAYgcloud container node-pools create node-pool-1 --cluster=example-cluster --consolidation-delay=3600s--containerd-config-from-file=PATH_TO_FILEFor detailed information on the configuration usage, please refer to https://cloud.google.com/kubernetes-engine/docs/how-to/customize-containerd-configuration.
Note: Updating the containerd configuration of an existing cluster or node pool requires recreation of the existing nodes, which might cause disruptions in running workloads.
Use a full or relative path to a local file containing the value of containerd_config.--data-cache-count=DATA_CACHE_COUNT--disk-size=DISK_SIZE--disk-type=DISK_TYPEDISK_TYPE must be one of: pd-standard,
pd-ssd, pd-balanced, hyperdisk-balanced,
hyperdisk-extreme, hyperdisk-throughput.
--enable-autoprovisioning--enable-autorepairgcloud container node-pools create node-pool-1 --cluster=example-cluster --enable-autorepairNode autorepair is enabled by default for node pools using COS, COS_CONTAINERD, UBUNTU or UBUNTU_CONTAINERD as a base image, use --no-enable-autorepair to disable.
See https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair for more info.--enable-autoupgradegcloud container node-pools create node-pool-1 --cluster=example-cluster --enable-autoupgradeSee https://cloud.google.com/kubernetes-engine/docs/node-auto-upgrades for more info.
Enabled by default, use--no-enable-autoupgrade to disable.
--enable-blue-green-upgrade--enable-confidential-nodes--enable-confidential-storage--enable-gvnic--enable-image-streaming--no-enable-image-streaming.
--enable-insecure-kubelet-readonly-port--no-enable-insecure-kubelet-readonly-port.
--enable-kernel-module-signature-enforcement--no-enable-kernel-module-signature-enforcement to disable.
Examples:
gcloud container node-pools create node-pool-1 --enable-kernel-module-signature-enforcement--enable-nested-virtualizationfalse. Can only be enabled on UBUNTU_CONTAINERD base image or
COS_CONTAINERD base image with version 1.28.4-gke.1083000 and above.
--enable-private-nodes--enable-queued-provisioninggcloud container node-pools create node-pool-1 --cluster=example-cluster --enable-queued-provisioning
… and other required parameters, for more details see:
https://cloud.google.com/kubernetes-engine/docs/how-to/provisioningrequest--enable-surge-upgrade--flex-startgcloud container node-pools create node-pool-1 --cluster=example-cluster --flex-start
and other required parameters, for more details see:
https://cloud.google.com/kubernetes-engine/docs/how-to/provisioningrequest--image=IMAGE--image-project=IMAGE_PROJECT--image-type=IMAGE_TYPEImage Type specifies the base OS that the nodes in the node pool will run on. If an image type is specified, that will be assigned to the node pool and all future upgrades will use the specified image type. If it is not specified the server will pick the default image type.
The default image type and the list of valid image types are available using the following command.
gcloud container get-server-config--labels=[KEY=VALUE,…]Examples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --labels=label1=value1,label2=value2--logging-variant=LOGGING_VARIANTMAX_THROUGHPUT,
DEFAULT. LOGGING_VARIANT must be one of:
DEFAULTMAX_THROUGHPUT--machine-type=MACHINE_TYPE, -m MACHINE_TYPEgcloud compute machine-types listYou can also specify custom machine types by providing a string with the format "custom-CPUS-RAM" where "CPUS" is the number of virtual CPUs and "RAM" is the amount of RAM in MiB.
For example, to create a node pool using custom machines with 2 vCPUs and 12 GB of RAM:
gcloud container node-pools create high-mem-pool --machine-type=custom-2-12288--max-pods-per-node=MAX_PODS_PER_NODEThis flag sets the maximum number of pods that can be run at the same time on a node. This will override the value given with --default-max-pods-per-node flag set at the cluster level.
Must be used in conjunction with '--enable-ip-alias'.--max-run-duration=MAX_RUN_DURATIONgcloud container node-pools create node-pool-1 --cluster=example-cluster --max-run-duration=3600s--max-surge-upgrade=MAX_SURGE_UPGRADE; default=1Specifies the number of extra (surge) nodes to be created during this node pool's upgrades. For example, running the following command will result in creating an extra node each time the node pool is upgraded:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --max-surge-upgrade=1 --max-unavailable-upgrade=0--max-unavailable-upgrade=MAX_UNAVAILABLE_UPGRADESpecifies the number of nodes that can be unavailable at the same time during this node pool's upgrades. For example, running the following command will result in having 3 nodes being upgraded in parallel (1 + 2), but keeping always at least 3 (5 - 2) available each time the node pool is upgraded:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --num-nodes=5 --max-surge-upgrade=1 --max-unavailable-upgrade=2--metadata=KEY=VALUE,[KEY=VALUE,…]Each metadata entry is a key/value pair separated by an equals sign. Metadata keys must be unique and less than 128 bytes in length. Values must be less than or equal to 32,768 bytes in length. The total size of all keys and values must be less than 512 KB. Multiple arguments can be passed to this flag. For example:
--metadata
key-1=value-1,key-2=value-2,key-3=value-3
Additionally, the following keys are reserved for use by Kubernetes Engine:
cluster-location
cluster-name
cluster-uid
configure-sh
enable-os-login
gci-update-strategy
gci-ensure-gke-docker
instance-template
kube-env
startup-script
user-data
Google Kubernetes Engine sets the following keys by default:
serial-port-logging-enable
--metadata-from-file=KEY=LOCAL_FILE_PATH,[…]--metadata except that the value
for the entry will be read from a local file.
--min-cpu-platform=PLATFORMExamples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --min-cpu-platform=PLATFORMTo list available CPU platforms in given zone, run:
gcloud beta compute zones describe ZONE --format="value(availableCpuPlatforms)"--network-performance-configs=[PROPERTY=VALUE,…]total-egress-bandwidth-tier--node-architecture-taint-behavior=NODE_ARCHITECTURE_TAINT_BEHAVIORSupported values: * unspecified: Default behavior, currently the same as `arm`. * arm: kubernetes.io/arch=arm:NoSchedule taint will be added for ARM nodes. * none: No architecture taint will be applied.
gcloud container node-pools create node-pool-1 --cluster=example-cluster --node-architecture-taint-behavior=noneTo read more about node-taints, see https://cloud.google.com/kubernetes-engine/docs/node-taints.
NODE_ARCHITECTURE_TAINT_BEHAVIOR must be one of:
unspecified, arm, none.
--node-group=NODE_GROUPTo see available sole tenant node-groups, run:
gcloud compute sole-tenancy node-groups listTo create a sole tenant node group, run:
gcloud compute sole-tenancy node-groups create [GROUP_NAME] --location [ZONE] --node-template [TEMPLATE_NAME] --target-size [TARGET_SIZE]--node-labels=[NODE_LABEL,…]Examples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --node-labels=label1=value1,label2=value2
Updating the node pool's --node-labels flag applies the labels to the Kubernetes
Node objects for existing nodes in-place; it does not re-create or replace
nodes. New nodes, including ones created by resizing or re-creating nodes, will
have these labels on the Kubernetes API Node object. The labels can be used in
the nodeSelector field. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
for examples.
--node-locations=ZONE,[ZONE,…]Multiple locations can be specified, separated by commas. For example:
gcloud container node-pools create node-pool-1 --cluster=sample-cluster --node-locations=us-central1-a,us-central1-b--node-pool-soak-duration=NODE_POOL_SOAK_DURATIONgcloud container node-pools create example-cluster --node-pool-soak-duration=600s--node-taints=[NODE_TAINT,…]Examples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --node-taints=key1=val1:NoSchedule,key2=val2:PreferNoSchedule--node-version=NODE_VERSIONThe default Kubernetes version is available using the following command.
gcloud container get-server-config--num-nodes=NUM_NODES--tpu-topology is specified for multi-host TPU
machine types the number of nodes will be defaulted to (product of
topology)/(# of chips per VM).
--opportunistic-maintenance=[node-idle-time=NODE_IDLE_TIME,window=WINDOW,min-nodes=MIN_NODES,…]node-idle-time: Time to be spent waiting for node to be idle before starting maintenance, ending with 's'. Example: "3.5s"
window: The window of time that opportunistic maintenance can run, ending with 's'. Example: A setting of 14 days (1209600s) implies that opportunistic maintenance can only be ran in the 2 weeks leading up to the scheduled maintenance date. Setting 28 days(2419200s) allows opportunistic maintenance to run at any time in the scheduled maintenance window.
min-nodes: Minimum number of nodes in the node pool to be available during the opportunistic triggered maintenance.
gcloud container node-pools create example-cluster --opportunistic-maintenance=node-idle-time=600s,window=600s,min-nodes=2--performance-monitoring-unit=PERFORMANCE_MONITORING_UNITarchitectural, standard and enhanced.
PERFORMANCE_MONITORING_UNIT must be one of:
architecturalenhancedstandard--placement-policy=PLACEMENT_POLICYgcloud container node-pools create node-pool-1 --cluster=example-cluster --placement-policy my-placement--placement-type=PLACEMENT_TYPE
UNSPECIFIED - No requirements on the placement of nodes. This is
the default option.
COMPACT - GKE will attempt to place the nodes in a close proximity
to each other. This helps to reduce the communication latency between the nodes,
but imposes additional limitations on the node pool size.
gcloud container node-pools create node-pool-1 --cluster=example-cluster --placement-type=COMPACTPLACEMENT_TYPE must be one of: UNSPECIFIED,
COMPACT.
--preemptiblegcloud container node-pools create node-pool-1 --cluster=example-cluster --preemptible--resource-manager-tags=[KEY=VALUE,…]Examples:
gcloud container node-pools create example-node-pool --resource-manager-tags=tagKeys/1234=tagValues/2345gcloud container node-pools create example-node-pool --resource-manager-tags=my-project/key1=value1gcloud container node-pools create example-node-pool --resource-manager-tags=12345/key1=value1,23456/key2=value2gcloud container node-pools create example-node-pool --resource-manager-tags=
--sandbox=[type=TYPE]Examples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --sandbox="type=gvisor"--secondary-boot-disk=[disk-image=DISK_IMAGE,[mode=MODE],…]disk-imageprojects/my-project/global/images/my-disk-image).
modeCONTAINER_IMAGE_CACHE: The disk is used to cache container images.
This is the default if not specified.
DATA: The disk is used to preload arbitrary data, accessible via
hostPath volume mounts.
--shielded-integrity-monitoring--shielded-secure-boot--sole-tenant-min-node-cpus=SOLE_TENANT_MIN_NODE_CPUS--sole-tenant-node-affinity-file=SOLE_TENANT_NODE_AFFINITY_FILEkeyoperatorIN: Requires
Compute Engine to seek for matched nodes. NOT_IN: Requires Compute
Engine to avoid certain nodes.
values--spotgcloud container node-pools create node-pool-1 --cluster=example-cluster --spot--standard-rollout-policy=[batch-node-count=BATCH_NODE_COUNT,batch-percent=BATCH_NODE_PERCENTAGE,batch-soak-duration=BATCH_SOAK_DURATION,…]Batch sizes are specified by one of, batch-node-count or batch-percent. The duration between batches is specified by batch-soak-duration.
gcloud container node-pools create example-cluster --standard-rollout-policy=batch-node-count=3,batch-soak-duration=60sgcloud container node-pools create example-cluster --standard-rollout-policy=batch-percent=0.3,batch-soak-duration=60s--storage-pools=STORAGE_POOL,[…]--subnetwork=SUBNETWORK--system-config-from-file=PATH_TO_FILEExamples:
kubeletConfig: cpuManagerPolicy: static memoryManager: policy: Static topologyManager: policy: BestEffort scope: pod crashLoopBackOff: maxContainerRestartPeriod: '300s' linuxConfig: accurateTimeConfig: enablePtpKvmTimeSync: true sysctl: net.core.somaxconn: '2048' net.ipv4.tcp_rmem: '4096 87380 6291456' hugepageConfig: hugepage_size2m: '1024' hugepage_size1g: '2' swapConfig: enabled: true bootDiskProfile: swapSizeGib: 8 cgroupMode: 'CGROUP_MODE_V2' nodeKernelModuleLoading: policy: 'ENFORCE_SIGNED_MODULES' nodeVfioConfig: dmaEntryLimit: 65536 diskIoScheduler: nodeSystemIoScheduler: 'bfq' nodeAttachedDiskIoScheduler: 'mq-deadline'
List of supported kubelet configs in 'kubeletConfig'.
List of supported keys in memoryManager in 'kubeletConfig'.
KEY VALUE cpuManagerPolicy either 'static' or 'none' cpuCFSQuota true or false (enabled by default) cpuCFSQuotaPeriod interval (e.g., '100ms'. The value must be between 1ms and 1 second, inclusive.) memoryManager specify memory manager policy topologyManager specify topology manager policy and scope podPidsLimit integer (The value must be greater than or equal to 1024 and less than 4194304.) containerLogMaxSize positive number plus unit suffix (e.g., '100Mi', '0.2Gi'. The value must be between 10Mi and 500Mi, inclusive.) containerLogMaxFiles integer (The value must be between [2, 10].) imageGcLowThresholdPercent integer (The value must be between [10, 85], and lower than imageGcHighThresholdPercent.) imageGcHighThresholdPercent integer (The value must be between [10, 85], and greater than imageGcLowThresholdPercent.) imageMinimumGcAge interval (e.g., '100s', '1m'. The value must be less than '2m'.) imageMaximumGcAge interval (e.g., '100s', '1m'. The value must be greater than imageMinimumGcAge.) evictionSoft specify eviction soft thresholds evictionSoftGracePeriod specify eviction soft grace period evictionMinimumReclaim specify eviction minimum reclaim thresholds evictionMaxPodGracePeriodSeconds integer (Max grace period for pod termination during eviction, in seconds. The value must be between [0, 300].) shutdownGracePeriodSeconds integer (Grace period for pods terminating on node shutdown, in seconds. Allowed values: 0, 30, 120.) shutdownGracePeriodCriticalPodsSeconds integer (Grace period for critical pods terminating on node shutdown, in seconds. The value must be between [0, 120] and less than shutdownGracePeriodSeconds.) allowedUnsafeSysctls list of sysctls (Allowlisted groups: 'kernel.shm*', 'kernel.msg*', 'kernel.sem', 'fs.mqueue.*', and 'net.*', and sysctls under the groups.) singleProcessOomKill true or false maxParallelImagePulls integer (The value must be between [2, 5].) crashLoopBackOff specify crashloopbackoff thresholds
List of supported keys in topologyManager in 'kubeletConfig'.
KEY VALUE policy either 'Static' or 'None'
List of supported keys in evictionSoft in 'kubeletConfig'.
KEY VALUE policy either 'none' or 'best-effort' or 'single-numa-node' or 'restricted' scope either 'pod' or 'container'
List of supported keys in evictionSoftGracePeriod in 'kubeletConfig'.
KEY VALUE memoryAvailable quantity (e.g., '100Mi', '1Gi'. Represents the amount of memory available before soft eviction. The value must be at least 100Mi and less than 50% of the node's memory.) nodefsAvailable percentage (e.g., '20%'. Represents the nodefs available before soft eviction. The value must be between 10% and 50%, inclusive.) nodefsInodesFree percentage (e.g., '20%'. Represents the nodefs inodes free before soft eviction. The value must be between 5% and 50%, inclusive.) imagefsAvailable percentage (e.g., '20%'. Represents the imagefs available before soft eviction. The value must be between 15% and 50%, inclusive.) imagefsInodesFree percentage (e.g., '20%'. Represents the imagefs inodes free before soft eviction. The value must be between 5% and 50%, inclusive.) pidAvailable percentage (e.g., '20%'. Represents the pid available before soft eviction. The value must be between 10% and 50%, inclusive.)
List of supported keys in evictionMinimumReclaim in 'kubeletConfig'.
KEY VALUE memoryAvailable duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.) nodefsAvailable duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.) nodefsInodesFree duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.) imagefsAvailable duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.) imagefsInodesFree duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.) pidAvailable duration (e.g., '30s', '1m'. The grace period for soft eviction for this resource. The value must be positive and no more than '5m'.)
List of supported keys in crashLoopBackOff in 'kubeletConfig'.
KEY VALUE memoryAvailable percentage (e.g., '5%'. Represents the minimum reclaim threshold for memory available. The value must be positive and no more than 10%.) nodefsAvailable percentage (e.g., '5%'. Represents the minimum reclaim threshold for nodefs available. The value must be positive and no more than 10%.) nodefsInodesFree percentage (e.g., '5%'. Represents the minimum reclaim threshold for nodefs inodes free. The value must be positive and no more than 10%.) imagefsAvailable percentage (e.g., '5%'. Represents the minimum reclaim threshold for imagefs available. The value must be positive and no more than 10%.) imagefsInodesFree percentage (e.g., '5%'. Represents the minimum reclaim threshold for imagefs inodes free. The value must be positive and no more than 10%.) pidAvailable percentage (e.g., '5%'. Represents the minimum reclaim threshold for pid available. The value must be positive and no more than 10%.)
List of supported sysctls in 'linuxConfig'.
KEY VALUE maxContainerRestartPeriod duration (e.g., '30s', '1m'. The maximum duration the backoff delay can accrue to for container restarts. The value must be between [1s, 300s].)
List of supported keys in 'accurateTimeConfig' under 'linuxConfig'.
KEY VALUE net.core.netdev_max_backlog Any positive integer, less than 2147483647 net.core.rmem_default Must be between [2304, 2147483647] net.core.rmem_max Must be between [2304, 2147483647] net.core.wmem_default Must be between [4608, 2147483647] net.core.wmem_max Must be between [4608, 2147483647] net.core.optmem_max Any positive integer, less than 2147483647 net.core.somaxconn Must be between [128, 2147483647] net.ipv4.tcp_rmem Any positive integer tuple net.ipv4.tcp_wmem Any positive integer tuple net.ipv4.tcp_tw_reuse Must be {0, 1, 2} net.ipv4.tcp_mtu_probing Must be {0, 1, 2} net.ipv4.tcp_max_orphans Must be between [16384, 262144] net.ipv4.tcp_max_tw_buckets Must be between [4096, 2147483647] net.ipv4.tcp_syn_retries Must be between [1, 127] net.ipv4.tcp_ecn Must be {0, 1, 2} net.ipv4.tcp_congestion_control Supported values for COS: 'reno', 'cubic', 'bbr', 'lp', 'htcp'. Supported values for Ubuntu: 'reno', 'cubic', 'bbr', 'lp', 'htcp', 'vegas', 'dctcp', 'bic', 'cdg', 'highspeed', 'hybla', 'illinois', 'nv', 'scalable', 'veno', 'westwood', 'yeah'. net.ipv4.neigh.default.gc_thresh1 Must be between [0, 262144] net.ipv4.neigh.default.gc_thresh2 Must be between [512, 524288] net.ipv4.neigh.default.gc_thresh3 Must be between [1024, 1048576] net.netfilter.nf_conntrack_max Must be between [65536, 4194304] net.netfilter.nf_conntrack_buckets Must be between [65536, 524288]. Recommend setting: nf_conntrack_max = nf_conntrack_buckets * 4 net.netfilter.nf_conntrack_tcp_timeout_close_wait Must be between [60, 3600] net.netfilter.nf_conntrack_tcp_timeout_time_wait Must be between [1, 600] net.netfilter.nf_conntrack_tcp_timeout_established Must be between [600, 86400] net.netfilter.nf_conntrack_acct Must be {0, 1} kernel.keys.maxkeys Must be between [200, 1048576] kernel.keys.maxbytes Must be between [20000, 2097152] kernel.shmmni Must be between [4096, 32768] kernel.shmmax Must be between [0, 18446744073692774399] kernel.shmall Must be between [0, 18446744073692774399] kernel.perf_event_paranoid Must be {-1, 0, 1, 2, 3} kernel.sched_rt_runtime_us Must be [-1, 1000000] kernel.softlockup_panic Must be {0, 1} kernel.yama.ptrace_scope Must be {0, 1, 2, 3} kernel.kptr_restrict Must be {0, 1, 2} kernel.dmesg_restrict Must be {0, 1} kernel.sysrq Must be [0, 511] fs.aio-max-nr Must be between [65536, 4194304] fs.file-max Must be between [104857, 67108864] fs.inotify.max_user_instances Must be between [8192, 1048576] fs.inotify.max_user_watches Must be between [8192, 1048576] fs.nr_open Must be between [1048576, 2147483584] vm.dirty_background_ratio Must be between [1, 100] vm.dirty_background_bytes Must be between [0, 68719476736] vm.dirty_expire_centisecs Must be between [0, 6000] vm.dirty_ratio Must be between [1, 100] vm.dirty_bytes Must be between [0, 68719476736] vm.dirty_writeback_centisecs Must be between [0, 1000] vm.max_map_count Must be between [65536, 2147483647] vm.overcommit_memory Must be one of {0, 1, 2}. Not supported on machines with less than 15 GB memory. vm.overcommit_ratio Must be between [0, 100] vm.vfs_cache_pressure Must be between [0, 100] vm.swappiness Must be between [0, 200] vm.watermark_scale_factor Must be between [10, 3000] vm.min_free_kbytes Must be between [67584, 1048576]
List of supported hugepage size in 'hugepageConfig'.
KEY VALUE enablePtpKvmTimeSync boolean
List of supported keys in 'swapConfig' under 'linuxConfig'.
KEY VALUE hugepage_size2m Number of 2M huge pages, any positive integer hugepage_size1g Number of 1G huge pages, any positive integer
List of supported keys in 'encryptionConfig' under 'swapConfig'.
KEY VALUE enabled boolean encryptionConfig specify encryption settings for the swap space bootDiskProfile specify swap on the node's boot disk ephemeralLocalSsdProfile specify swap on the local SSD shared with pod ephemeral storage dedicatedLocalSsdProfile specify swap on a new, separate local NVMe SSD exclusively for swap
List of supported keys in 'bootDiskProfile' under 'swapConfig'.
KEY VALUE disabled boolean
List of supported keys in 'ephemeralLocalSsdProfile' under 'swapConfig'.
KEY VALUE swapSizeGib integer swapSizePercent integer
List of supported keys in 'dedicatedLocalSsdProfile' under 'swapConfig'.
KEY VALUE swapSizeGib integer swapSizePercent integer
List of supported keys in 'nodeKernelModuleLoading'.
KEY VALUE diskCount integer
List of supported keys in 'nodeVfioConfig' under 'linuxConfig'.
KEY VALUE policy ENFORCE_SIGNED_MODULES, DO_NOT_ENFORCE_SIGNED_MODULES, POLICY_UNSPECIFIED
List of supported keys in 'diskIoScheduler' under 'linuxConfig'.
KEY VALUE dmaEntryLimit integer between [65535, 4194304]
The upper limit for total allocated hugepage size differs based upon machine size.
KEY VALUE nodeSystemIoScheduler string. Supported values: 'mq-deadline', 'bfq', 'kyber', 'none'. nodeAttachedDiskIoScheduler string. Supported values: 'mq-deadline', 'bfq', 'kyber', 'none'.
1G hugepages are only available in following machine familes: c3, m2, c2d, c3d, h3, m3, a2, a3, g2.
Supported values for 'cgroupMode' under 'linuxConfig'.
CGROUP_MODE_V1: Use cgroupv1 on the node pool.
CGROUP_MODE_V2: Use cgroupv2 on the node pool.
CGROUP_MODE_UNSPECIFIED: Use the default GKE cgroup configuration.
Supported values for 'transparentHugepageEnabled' under 'linuxConfig' which controls transparent hugepage support for anonymous memory.
TRANSPARENT_HUGEPAGE_ENABLED_ALWAYS: Transparent hugepage is
enabled system wide.
TRANSPARENT_HUGEPAGE_ENABLED_MADVISE: Transparent hugepage is
enabled inside MADV_HUGEPAGE regions. This is the default kernel configuration.
TRANSPARENT_HUGEPAGE_ENABLED_NEVER: Transparent hugepage is
disabled.
TRANSPARENT_HUGEPAGE_ENABLED_UNSPECIFIED: Default value. GKE will
not modify the kernel configuration.
Supported values for 'transparentHugepageDefrag' under 'linuxConfig' which defines the transparent hugepage defrag configuration on the node.
TRANSPARENT_HUGEPAGE_DEFRAG_ALWAYS: It means that an application
requesting THP will stall on allocation failure and directly reclaim pages and
compact memory in an effort to allocate a THP immediately.
TRANSPARENT_HUGEPAGE_DEFRAG_DEFER: It means that an application
will wake kswapd in the background to reclaim pages and wake kcompactd to
compact memory so that THP is available in the near future. It is the
responsibility of khugepaged to then install the THP pages later.
TRANSPARENT_HUGEPAGE_DEFRAG_DEFER_WITH_MADVISE: It means that an
application will enter direct reclaim and compaction like always, but only for
regions that have used madvise(MADV_HUGEPAGE); all other regions will wake
kswapd in the background to reclaim pages and wake kcompactd to compact memory
so that THP is available in the near future.
TRANSPARENT_HUGEPAGE_DEFRAG_MADVISE: It means that an application
will enter direct reclaim and compaction like always, but only for regions that
have used madvise(MADV_HUGEPAGE); all other regions will wake kswapd in the
background to reclaim pages and wake kcompactd to compact memory so that THP is
available in the near future.
TRANSPARENT_HUGEPAGE_DEFRAG_NEVER: It means that an application
will never enter direct reclaim or compaction.
TRANSPARENT_HUGEPAGE_DEFRAG_UNSPECIFIED: Default value. GKE will
not modify the kernel configuration.
Supported values for 'policy' under 'nodeKernelModuleLoading'.
POLICY_UNSPECIFIED: Default behavior. GKE selects the image based
on node type. For CPU and TPU nodes, the image will not allow loading external
kernel modules. For GPU nodes, the image will allow loading any module, whether
it is signed or not.
ENFORCE_SIGNED_MODULES: Enforced signature verification: Node pools
will use a Container-Optimized OS image configured to allow loading of
Google-signed external kernel modules. Loadpin is enabled but
configured to exclude modules, and kernel module signature checking is enforced.
DO_NOT_ENFORCE_SIGNED_MODULES: Do not enforce kernel module
signature enforcement. Mirrors existing DEFAULT behavior.
Note, updating the system configuration of an existing node pool requires recreation of the nodes which which might cause a disruption.
Use a full or relative path to a local file containing the value of system_config.--tags=TAG,[TAG,…]gcloud container node-pools create node-pool-1 --cluster=example-cluster --tags=tag1,tag2--threads-per-core=THREADS_PER_CORE--tpu-topology=TPU_TOPOLOGYgcloud container node-pools create node-pool-1 --cluster=example-cluster --tpu-topology--windows-os-version=WINDOWS_OS_VERSIONWINDOWS_OS_VERSION must be one of:
ltsc2019, ltsc2022.
--workload-metadata=WORKLOAD_METADATAWORKLOAD_METADATA must be one of:
GCE_METADATAGKE_METADATA--create-pod-ipv4-range=[KEY=VALUE,…]name and
range keys.
specifies the name of the secondary
range to be created.
name
specifies the IP range for the new
secondary range. This can either be a netmask size (e.g. "/20") or a CIDR range
(e.g. "10.0.0.0/20"). If a netmask size is specified, the IP is automatically
taken from the free space in the cluster's network.
range
Must be used in VPC native clusters. Can not be used in conjunction with the
--pod-ipv4-range option.
Examples:
Create a new pod range with a default name and size.
gcloud container node-pools create --create-pod-ipv4-range ""
Create a new pod range named with
netmask of size my-range.
21
gcloud container node-pools create --create-pod-ipv4-range name=my-range,range=/21
Create a new pod range with a default name with the primary range of
.
10.100.0.0/16
gcloud container node-pools create --create-pod-ipv4-range range=10.100.0.0/16
Create a new pod range with the name
with a default range.
my-range
gcloud container node-pools create --create-pod-ipv4-range name=my-range--pod-ipv4-range option.
--pod-ipv4-range=NAME
Must be used in VPC native clusters. Cannot be used with
--create-ipv4-pod-range.
Examples:
Specify a pod range called other-range
gcloud container node-pools create --pod-ipv4-range other-range--enable-autoscaling--location-policy=LOCATION_POLICYBALANCED - Is a best effort policy that aims to balance the sizes
of available zones.
ANY - Instructs the cluster autoscaler to prioritize utilization of
unused reservations, and reduces preemption risk for Spot VMs.
LOCATION_POLICY must be one of: BALANCED,
ANY.
--max-nodes=MAX_NODES--min-nodes=MIN_NODES--total-max-nodes=TOTAL_MAX_NODES--total-min-nodes=TOTAL_MIN_NODES--enable-best-effort-provision--min-provision-nodes=MIN_PROVISION_NODES--ephemeral-storage-local-ssd[=[count=COUNT]]Examples:
gcloud container node-pools create node-pool-1 --cluster=example cluster --ephemeral-storage-local-ssd count=2'count' specifies the number of local SSDs to use to back ephemeral storage. Local SDDs use NVMe interfaces. For first- and second-generation machine types, a nonzero count field is required for local ssd to be configured. For third-generation machine types, the count field is optional because the count is inferred from the machine type.
See https://cloud.google.com/compute/docs/disks/local-ssd for more information.--local-nvme-ssd-block[=[count=COUNT]]Examples:
gcloud container node-pools create node-pool-1 --cluster=example cluster --local-nvme-ssd-block count=2'count' must be between 1-8 New nodes, including ones created by resize or recreate, will have these local SSDs.
For first- and second-generation machine types, a nonzero count field is required for local ssd to be configured. For third-generation machine types, the count field is optional because the count is inferred from the machine type.
See https://cloud.google.com/compute/docs/disks/local-ssd for more information.--local-ssd-count=LOCAL_SSD_COUNT--location=LOCATION--region=REGION--zone=ZONE, -z ZONE--node-drain-grace-period-seconds=NODE_DRAIN_GRACE_PERIOD_SECONDS--node-drain-pdb-timeout-seconds=NODE_DRAIN_PDB_TIMEOUT_SECONDS--respect-pdb-during-node-pool-deletion--reservation=RESERVATION--reservation-affinity=specific.
--reservation-affinity=RESERVATION_AFFINITYRESERVATION_AFFINITY must be one of: any,
none, specific,
any-reservation-then-fail.
--scopes=[SCOPE,…]; default="gke-default"Examples:
gcloud container node-pools create node-pool-1 --cluster=example-cluster --scopes=https://www.googleapis.com/auth/devstorage.read_onlygcloud container node-pools create node-pool-1 --cluster=example-cluster --scopes=bigquery,storage-rw,compute-roMultiple scopes can be specified, separated by commas. Various scopes are automatically added based on feature usage. Such scopes are not added if an equivalent scope already exists.
monitoring-write: always added to ensure metrics can be written
logging-write: added if Cloud Logging is enabled
(--enable-cloud-logging/--logging)
monitoring: added if Cloud Monitoring is enabled
(--enable-cloud-monitoring/--monitoring)
gke-default: added for Autopilot clusters that use the default
service account
cloud-platform: added for Autopilot clusters that use any other
service account
Default
scopes are assigned to all instances. Available aliases are:
DEPRECATION WARNING: https://www.googleapis.com/auth/sqlservice account scope and
Alias URI bigquery https://www.googleapis.com/auth/bigquery cloud-platform https://www.googleapis.com/auth/cloud-platform cloud-source-repos https://www.googleapis.com/auth/source.full_control cloud-source-repos-ro https://www.googleapis.com/auth/source.read_only compute-ro https://www.googleapis.com/auth/compute.readonly compute-rw https://www.googleapis.com/auth/compute datastore https://www.googleapis.com/auth/datastore default https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/logging.write https://www.googleapis.com/auth/monitoring.write https://www.googleapis.com/auth/pubsub https://www.googleapis.com/auth/service.management.readonly https://www.googleapis.com/auth/servicecontrol https://www.googleapis.com/auth/trace.append gke-default https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/logging.write https://www.googleapis.com/auth/monitoring https://www.googleapis.com/auth/service.management.readonly https://www.googleapis.com/auth/servicecontrol https://www.googleapis.com/auth/trace.append logging-write https://www.googleapis.com/auth/logging.write monitoring https://www.googleapis.com/auth/monitoring monitoring-read https://www.googleapis.com/auth/monitoring.read monitoring-write https://www.googleapis.com/auth/monitoring.write pubsub https://www.googleapis.com/auth/pubsub service-control https://www.googleapis.com/auth/servicecontrol service-management https://www.googleapis.com/auth/service.management.readonly sql (deprecated) https://www.googleapis.com/auth/sqlservice sql-admin https://www.googleapis.com/auth/sqlservice.admin storage-full https://www.googleapis.com/auth/devstorage.full_control storage-ro https://www.googleapis.com/auth/devstorage.read_only storage-rw https://www.googleapis.com/auth/devstorage.read_write taskqueue https://www.googleapis.com/auth/taskqueue trace https://www.googleapis.com/auth/trace.append userinfo-email https://www.googleapis.com/auth/userinfo.email
sql alias do not provide SQL instance management
capabilities and have been deprecated. Please, use https://www.googleapis.com/auth/sqlservice.admin
or sql-admin to manage your Google SQL Service instances.
--service-account=SERVICE_ACCOUNT--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha container node-pools creategcloud beta container node-pools create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-14 UTC.