Creates a node pool for a cluster.
Scopes
You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: container1 --scope <scope> projects locations-clusters-node-pools-create ...
Required Scalar Argument
- <parent> (string)
- The parent (project, location, cluster name) where the node pool will be created. Specified in the format
projects/*/locations/*/clusters/*.
- The parent (project, location, cluster name) where the node pool will be created. Specified in the format
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
CreateNodePoolRequest:
cluster-id: string
node-pool:
autoscaling:
autoprovisioned: boolean
enabled: boolean
max-node-count: integer
min-node-count: integer
config:
advanced-machine-features:
threads-per-core: string
boot-disk-kms-key: string
disk-size-gb: integer
disk-type: string
gcfs-config:
enabled: boolean
gvnic:
enabled: boolean
image-type: string
kubelet-config:
cpu-cfs-quota: boolean
cpu-cfs-quota-period: string
cpu-manager-policy: string
labels: { string: string }
linux-node-config:
sysctls: { string: string }
local-ssd-count: integer
machine-type: string
metadata: { string: string }
min-cpu-platform: string
node-group: string
oauth-scopes: [string]
preemptible: boolean
reservation-affinity:
consume-reservation-type: string
key: string
values: [string]
sandbox-config:
type: string
service-account: string
shielded-instance-config:
enable-integrity-monitoring: boolean
enable-secure-boot: boolean
spot: boolean
tags: [string]
workload-metadata-config:
mode: string
initial-node-count: integer
instance-group-urls: [string]
locations: [string]
management:
auto-repair: boolean
auto-upgrade: boolean
upgrade-options:
auto-upgrade-start-time: string
description: string
max-pods-constraint:
max-pods-per-node: string
name: string
network-config:
create-pod-range: boolean
pod-ipv4-cidr-block: string
pod-range: string
pod-ipv4-cidr-size: integer
self-link: string
status: string
status-message: string
upgrade-settings:
max-surge: integer
max-unavailable: integer
version: string
parent: string
project-id: string
zone: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r . cluster-id=justo- Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field.
node-pool.autoscaling autoprovisioned=true- Can this node pool be deleted automatically.
enabled=false- Is autoscaling enabled for this node pool.
max-node-count=58- Maximum number of nodes for one location in the NodePool. Must be >= min_node_count. There has to be enough quota to scale up the cluster.
-
min-node-count=88- Minimum number of nodes for one location in the NodePool. Must be >= 1 and <= max_node_count.
-
..config.advanced-machine-features threads-per-core=lorem- The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.
-
.. boot-disk-kms-key=sanctus- 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
disk-size-gb=10- 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.
disk-type=rebum.- 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'
-
gcfs-config enabled=true- Whether to use GCFS.
-
..gvnic enabled=true- Whether gVNIC features are enabled in the node pool.
-
.. image-type=dolore- The image type to use for this node. Note that for a given image type, the latest version of it will be used.
kubelet-config cpu-cfs-quota=false- Enable CPU CFS quota enforcement for containers that specify CPU limits. This option is enabled by default which makes kubelet use CFS quota (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) to enforce container CPU limits. Otherwise, CPU limits will not be enforced at all. Disable this option to mitigate CPU throttling problems while still having your pods to be in Guaranteed QoS class by specifying the CPU limits. The default value is 'true' if unspecified.
cpu-cfs-quota-period=ut- Set the CPU CFS quota period value 'cpu.cfs_period_us'. The string must be a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value must be a positive duration.
-
cpu-manager-policy=at- Control the CPU management policy on the node. See https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ The following values are allowed. * "none": the default, which represents the existing scheduling behavior. * "static": allows pods with certain resource characteristics to be granted increased CPU affinity and exclusivity on the node. The default value is 'none' if unspecified.
-
.. labels=key=sit- 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/
- the value will be associated with the given
key
-
linux-node-config sysctls=key=vero- The Linux kernel parameters to be applied to the nodes and all pods running on the nodes. The following parameters are supported. net.core.netdev_max_backlog net.core.rmem_max net.core.wmem_default net.core.wmem_max net.core.optmem_max net.core.somaxconn net.ipv4.tcp_rmem net.ipv4.tcp_wmem net.ipv4.tcp_tw_reuse
- the value will be associated with the given
key
-
.. local-ssd-count=81- 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.
machine-type=sadipscing- The name of a Google Compute Engine machine type If unspecified, the default machine type is
e2-medium.
- The name of a Google Compute Engine machine type If unspecified, the default machine type is
metadata=key=ut- 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. - the value will be associated with the given
key
- The metadata key/value pairs assigned to instances in the cluster. Keys must conform to the regexp
min-cpu-platform=rebum.- 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"orminCpuPlatform: "Intel Sandy Bridge". For more information, read how to specify min CPU platform
- 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
node-group=duo- 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.
oauth-scopes=kasd- 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/computeis required for mounting persistent storage on your nodes. *https://www.googleapis.com/auth/devstorage.read_onlyis 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. - Each invocation of this argument appends the given value to the 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: *
preemptible=false- 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.
reservation-affinity consume-reservation-type=tempor- Corresponds to the type of reservation consumption.
key=sea- Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "googleapis.com/reservation-name" as the key and specify the name of your reservation as its value.
-
values=et- Corresponds to the label value(s) of reservation resource(s).
- Each invocation of this argument appends the given value to the array.
-
..sandbox-config type=lorem- Type of the sandbox to use for the node.
-
.. service-account=magna- 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.
shielded-instance-config enable-integrity-monitoring=true- Defines whether the instance has integrity monitoring enabled. Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created.
-
enable-secure-boot=true- Defines whether the instance has Secure Boot enabled. Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails.
-
.. spot=false- Spot flag for enabling Spot VM, which is a rebrand of the existing preemptible flag.
tags=clita- 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.
- Each invocation of this argument appends the given value to the array.
-
workload-metadata-config mode=stet- Mode is the configuration for how to expose metadata to workloads running on the node pool.
-
... initial-node-count=19- The initial node count for the pool. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota.
instance-group-urls=ut- [Output only] The resource URLs of the managed instance groups associated with this node pool.
- Each invocation of this argument appends the given value to the array.
locations=sit- The list of Google Compute Engine zones in which the NodePool's nodes should be located. If this value is unspecified during node pool creation, the Cluster.Locations value will be used, instead. Warning: changing node pool locations will result in nodes being added and/or removed.
- Each invocation of this argument appends the given value to the array.
management auto-repair=false- A flag that specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered.
auto-upgrade=true- A flag that specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes.
upgrade-options auto-upgrade-start-time=clita- [Output only] This field is set when upgrades are about to commence with the approximate start time for the upgrades, in RFC3339 text format.
-
description=dolor- [Output only] This field is set when upgrades are about to commence with the description of the upgrade.
-
...max-pods-constraint max-pods-per-node=aliquyam- Constraint enforced on the max num of pods per node.
-
.. name=magna- The name of the node pool.
network-config create-pod-range=true- Input only. Whether to create a new range for pod IPs in this node pool. Defaults are provided for
pod_rangeandpod_ipv4_cidr_blockif they are not specified. If neithercreate_pod_rangeorpod_rangeare specified, the cluster-level default (ip_allocation_policy.cluster_ipv4_cidr_block) is used. Only applicable ifip_allocation_policy.use_ip_aliasesis true. This field cannot be changed after the node pool has been created.
- Input only. Whether to create a new range for pod IPs in this node pool. Defaults are provided for
pod-ipv4-cidr-block=nonumy- The IP address range for pod IPs in this node pool. Only applicable if
create_pod_rangeis true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g./14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g.10.96.0.0/14) to pick a specific range to use. Only applicable ifip_allocation_policy.use_ip_aliasesis true. This field cannot be changed after the node pool has been created.
- The IP address range for pod IPs in this node pool. Only applicable if
-
pod-range=et- The ID of the secondary range for pod IPs. If
create_pod_rangeis true, this ID is used for the new range. Ifcreate_pod_rangeis false, uses an existing secondary range with this ID. Only applicable ifip_allocation_policy.use_ip_aliasesis true. This field cannot be changed after the node pool has been created.
- The ID of the secondary range for pod IPs. If
-
.. pod-ipv4-cidr-size=93- [Output only] The pod CIDR block size per node in this node pool.
self-link=accusam- [Output only] Server-defined URL for the resource.
status=tempor- [Output only] The status of the nodes in this pool instance.
status-message=sed- [Output only] Deprecated. Use conditions instead. Additional information about the current status of this node pool instance, if available.
upgrade-settings max-surge=94- The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process.
-
max-unavailable=92- The maximum number of nodes that can be simultaneously unavailable during the upgrade process. A node is considered available if its status is Ready.
-
.. version=dolor- The version of the Kubernetes of this node.
-
.. parent=diam- The parent (project, location, cluster name) where the node pool will be created. Specified in the format
projects/*/locations/*/clusters/*.
- The parent (project, location, cluster name) where the node pool will be created. Specified in the format
project-id=at- Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.
zone=erat- Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.character. Fields can be nested such as in-r f.s.o. - The cursor position is set relative to the top-level structure if it starts with
., e.g.-r .s.s - You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar. - You can move the cursor one level up by using
... Each additional.moves it up one additional level. E.g....would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").