Skip to content

[feat] add utilities on worker pool creation etc#1183

Open
liyu-ma wants to merge 12 commits into
v2from
maliyu/aks-node-pool-helpers
Open

[feat] add utilities on worker pool creation etc#1183
liyu-ma wants to merge 12 commits into
v2from
maliyu/aks-node-pool-helpers

Conversation

@liyu-ma
Copy link
Copy Markdown
Contributor

@liyu-ma liyu-ma commented May 18, 2026

  • Update CreateNodePool to allow --no-wait
  • Add PlanNodePools function to decide pool config based on max node per pool
  • Add WaitForAllWorkerNodesReady to wait for pools + nodes to be ready
  • Updated existing pipelines with usage of CreateNodePool

liyu-ma added 2 commits May 18, 2026 23:11
- CreateNodePools splits a {sku: nodes} map into pools capped at
  MAX_NODES_PER_POOL (800), each created with --no-wait so all pools
  provision in parallel.
- WaitForAllWorkerNodesReady polls every requested pool's
  provisioningState (reusing waitForNodePoolScript) and then waits for
  the matching number of worker nodes to be Ready via kubectl.
- DeleteResourceGroup gains a configurable condition (default
  always()) so callers can override cleanup behavior.
- RecordBenchmarkStart emits a step that captures the current UTC
  time as the BENCHMARK_START pipeline variable.
- Add a PoolEntry schema (name, sku, count) so node-pool plans are
  strongly typed instead of carried as parallel [any] arrays.
- Rename the internal poolPlan helper to the public PlanNodePools,
  returning [PoolEntry] and caching the SKU iteration order so the
  per-SKU/per-pool comprehensions can't drift out of sync.
- CreateNodePools and WaitForAllWorkerNodesReady now both take
  [PoolEntry], so a single PlanNodePools(skuToNodes) call drives both
  steps and the pool names/counts are guaranteed to agree.
liyu-ma added 3 commits May 19, 2026 17:22
Rename the PoolEntry schema to NodePool for clarity. Restructure
WaitForAllWorkerNodesReady to iterate pool-by-pool: for each pool it
waits for provisioningState=Succeeded and then reports how many nodes
in that pool are still not Ready, instead of aggregating Ready counts
across all pools with a regex.
Build the optional --node-taints, --labels and --no-wait flags into a
list, drop empties, and join them onto a single line in the script so
unset flags no longer leave blank backslash-continued lines.
Replace the module-level MAX_NODES_PER_POOL constant with a
maxNodesPerPool parameter on PlanNodePools, defaulting to 800. Lets
callers tune pool sizing without forking the helper.
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
Comment thread kcl/lib/steps/common/record_benchmark_start.k Outdated
Generalize the helper so callers pass the pipeline-variable name to
populate. Also rename the file to record_current_time.k to match.
Comment thread kcl/lib/steps/azure/create_node_pool.k
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
Comment thread kcl/lib/steps/azure/create_node_pool.k Outdated
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
liyu-ma added 2 commits May 20, 2026 11:54
Cover single-SKU under/at/over max, multi-SKU global pool naming,
zero-count and empty-map filtering, and custom maxNodesPerPool with
exact division. Runs via 'kcl test ./lib/steps/azure'.
Comment thread kcl/example_pipeline/pipeline.k Outdated
Comment thread kcl/lib/steps/azure/plan_node_pools_test.k Outdated
Comment thread kcl/lib/steps/azure/plan_node_pools_test.k
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
Comment thread kcl/lib/steps/azure/wait_for_node_pool_succeeded.k Outdated
Copy link
Copy Markdown
Collaborator

@xinWeiWei24 xinWeiWei24 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants