Skip to content

Conversation

@scaliby
Copy link
Member

@scaliby scaliby commented Aug 18, 2025

Fixes / Features

As node-pool create user-provided arguments are not appended as latest to the underlaying command execution, it is impossible to override the ones that appended by the code later. For gcloud command execution order matters and even if argument is duplicated, the later one wins. By moving custom_nodepool_arguments at the very end, we are allowing users to override all pre-generated arguments.

For instance, to override a default nodepool version argument used by XPK, we can supply an argument:
--custom-nodepool-arguments="--node-version=1.33.3-gke.1255000"
This will render command:

gcloud beta container node-pools create xpk-test-v6e-1x1-3-np-0 
  // arguments
  --node-version=1.33.3-gke.1136000 // the default one that XPK is using
  --node-version=1.33.3-gke.1255000 // the one from override

This will result with nodepool created with 1.33.3-gke.1255000 version, as gcloud picks the value from last argument of any given name.

Testing / Documentation

Tested with command:
python3 xpk.py cluster create --cluster=xpk-test-v6e-1x1-3 --project=tpu-staging-env-one-vm --tpu-type=v6e-1x1 --zone=us-central1-b --num-nodes=1 --enable-autoprovisioning --on-demand --custom-nodepool-arguments="--node-version=1.33.3-gke.1255000"

  • [y] Tests pass
  • [y] Appropriate changes to documentation are included in the PR

@scaliby scaliby changed the title fix: reorder custom_nodepool_arguments for node-pool create command Reorder custom_nodepool_arguments for node-pool create command Aug 18, 2025
if args.enable_workload_identity or args.enable_gcsfuse_csi_driver:
command += ' --workload-metadata=GKE_METADATA'

command += args.custom_nodepool_arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

While this looks like an acceptable change, I'm curious to know how this would make a difference to the overriding behavior of gcloud arguments. Is there a bug / example you could share to aid the PR description?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoshaniN added more verbose description

@scaliby scaliby merged commit d8a2158 into develop Aug 19, 2025
38 of 41 checks passed
@scaliby scaliby deleted the konradkaim/reorder-custom-nodepool-arguments branch August 19, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants