Unclear error when specifying "az aks nodepool add" with --node-count 0
See original GitHub issueDescribe the bug Azure CLI does not provide a clear error when setting “–node-count 0” To Reproduce
Create a normal AKS cluster
az group create -n tmf-clus-auto -l southcentralus
az aks create -g tmf-clus-auto -n tmf-clus-auto --node-count 2
Add a Nodepool with 0 nodes:
az aks nodepool add -g tmf-clus-auto --cluster-name tmf-clus-auto --name gpunodepool --node-count 0 --node-vm-size Standard_NC6
usage: az aks nodepool add [-h] [--verbose] [--debug] [--output {json,jsonc,table,tsv,yaml,none}] [--query JMESPATH] [--subscription _SUBSCRIPTION]
--resource-group RESOURCE_GROUP_NAME --cluster-name CLUSTER_NAME --name NODEPOOL_NAME [--kubernetes-version KUBERNETES_VERSION]
[--zones {1,2,3} [{1,2,3} ...]] [--node-vm-size NODE_VM_SIZE] [--node-osdisk-size NODE_OSDISK_SIZE] [--node-count NODE_COUNT]
[--vnet-subnet-id VNET_SUBNET_ID] [--max-pods MAX_PODS] [--os-type OS_TYPE] [--min-count MIN_COUNT] [--max-count MAX_COUNT]
[--enable-cluster-autoscaler] [--node-taints NODE_TAINTS] [--no-wait]
az aks nodepool add: error: division by zero
Expected behavior It should either provide a useful error message (e.g. “Node Count must be a positive integer”), or proceed to create the AKS node pool with 0 nodes in it. There is nothing in the documentation which says it cannot be of node-count 0
Environment summary Running on OSX. Reproduced issue on Azure Shell
…/tmp/spark az --version
azure-cli 2.0.80 *
command-modules-nspkg 2.0.3
core 2.0.80 *
nspkg 3.0.4
telemetry 1.0.4
Extensions:
k8sconfiguration 0.1.4
connectedk8s 0.1.1
azure-cli-iot-ext 0.7.1
aro 0.1.0 (dev) /Users/thfalgou/git/Azure/ARO-RP/python/az/aro
Python location '/usr/local/Cellar/azure-cli/2.0.80/libexec/bin/python'
Extensions directory '/Users/thfalgou/.azure/cliextensions'
Development extension sources:
/Users/thfalgou/git/Azure/ARO-RP/python
Python (Darwin) 3.8.1 (default, Dec 27 2019, 18:06:00)
[Clang 11.0.0 (clang-1100.0.33.16)]
Legal docs and information: aka.ms/AzureCliLegal
You have 2 updates available. Consider updating your CLI installation. Instructions can be found at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
Please let us know how we are doing: https://aka.ms/clihats
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
OverconstrainedZonalAllocation...
OverconstrainedZonalAllocationRequest error when adding a Nodepool in AKS cluster. I have this error when i try to add a new nodepool to my...
Read more >Add nodepool to an existing AKS cluster via ARM template
Yes, it is possible to add an extra Node Pool to the existing AKS cluster. Manage node pools using a Resource Manager template....
Read more >Building an AKS baseline architecture - Part 1 - Cluster creation
Azure Kubernetes Service (AKS) is a managed Kubernetes cluster offering by Microsoft. ... "$SYSTEM_NODE_NAME" ]; then az aks nodepool add -g ...
Read more >Set up and Manage an Azure Kubernetes Service (AKS) Cluster
To create a nodepool with a taint in AKS, use the –node-taints flag to specify the type, tag, and effect: az aks nodepool...
Read more >Deploy TiDB on Azure AKS - PingCAP Docs
You can set --node-count as required. Create a TiFlash node pool with nodeType being Standard_E8s_v4 or higher: az aks nodepool add --name tiflash ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Acknowledging this is an improvement on our backlog to fix to support size 0 user pools in CLI. This should be picked up soon. cc @marwanad @xizhamsft
@lastcoolnameleft - You are correct that there are no constraints applied to the
node-countvalue being passed in via CLI.@yungezz - specifying a node-count of 0 leads to an error when validating the value of
max-pods. Looks like a validation with error message should be added to preventnode-count=0here: https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/acs/_params.py#L157