Skip to content

Commit 340c91e

Browse files
authored
Merge pull request #96471 from zr-msft/aks-node-tag
[AKS] added tagging for node pools
2 parents cc3ee72 + ed7b5c6 commit 340c91e

File tree

1 file changed

+73
-14
lines changed

1 file changed

+73
-14
lines changed

articles/aks/use-multiple-node-pools.md

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mlearned
66

77
ms.service: container-service
88
ms.topic: article
9-
ms.date: 01/22/2020
9+
ms.date: 02/14/2020
1010
ms.author: mlearned
1111
---
1212

@@ -449,6 +449,61 @@ Events:
449449

450450
Only pods that have this taint applied can be scheduled on nodes in *gpunodepool*. Any other pod would be scheduled in the *nodepool1* node pool. If you create additional node pools, you can use additional taints and tolerations to limit what pods can be scheduled on those node resources.
451451

452+
## Specify a tag for a node pool
453+
454+
You can apply an Azure tag to node pools in your AKS cluster. Tags applied to a node pool are applied to each node within the node pool and are persisted through upgrades. Tags are also applied to new nodes added to a node pool during scale out operations. Adding a tag can help with tasks such as policy tracking or cost estimation.
455+
456+
> [!IMPORTANT]
457+
> To use node pool tags, you need the *aks-preview* CLI extension version 0.4.29 or higher. Install the *aks-preview* Azure CLI extension using the [az extension add][az-extension-add] command, then check for any available updates using the [az extension update][az-extension-update] command:
458+
>
459+
> ```azurecli-interactive
460+
> # Install the aks-preview extension
461+
> az extension add --name aks-preview
462+
>
463+
> # Update the extension to make sure you have the latest version installed
464+
> az extension update --name aks-preview
465+
> ```
466+
467+
Create a node pool using the [az aks node pool add][az-aks-nodepool-add]. Specify the name *tagnodepool* and use the `--tag` parameter to specify *dept=IT* and *costcenter=9999* for tags.
468+
469+
```azurecli-interactive
470+
az aks nodepool add \
471+
--resource-group myResourceGroup \
472+
--cluster-name myAKSCluster \
473+
--name tagnodepool \
474+
--node-count 1 \
475+
--tags dept=IT costcenter=9999 \
476+
--no-wait
477+
```
478+
479+
> [!NOTE]
480+
> You can also use the `--tags` parameter when using [az aks nodepool update][az-aks-nodepool-update] command as well as during cluster creation. During cluster creation, the `--tags` parameter applies the tag to the initial node pool created with the cluster. All tag names must adhere to the limitations in [Use tags to organize your Azure resources][tag-limitation]. Updating a node pool with the `--tags` parameter updates any existing tag values and appends any new tags. For example, if your node pool had *dept=IT* and *costcenter=9999* for tags and you updated it with *team=dev* and *costcenter=111* for tags, you nodepool would have *dept=IT*, *costcenter=111*, and *team=dev* for tags.
481+
482+
The following example output from the [az aks nodepool list][az-aks-nodepool-list] command shows that *taggednodepool* is *Creating* nodes with the specified *tag*:
483+
484+
```console
485+
$ az aks nodepool list -g myResourceGroup --cluster-name myAKSCluster
486+
487+
[
488+
{
489+
...
490+
"count": 1,
491+
...
492+
"name": "tagnodepool",
493+
"orchestratorVersion": "1.15.7",
494+
...
495+
"provisioningState": "Creating",
496+
...
497+
"tags": {
498+
"dept": "IT",
499+
"costcenter": "9999"
500+
},
501+
...
502+
},
503+
...
504+
]
505+
```
506+
452507
## Manage node pools using a Resource Manager template
453508

454509
When you use an Azure Resource Manager template to create and managed resources, you can typically update the settings in your template and redeploy to update the resource. With node pools in AKS, the initial node pool profile can't be updated once the AKS cluster has been created. This behavior means that you can't update an existing Resource Manager template, make a change to the node pools, and redeploy. Instead, you must create a separate Resource Manager template that updates only the node pools for an existing AKS cluster.
@@ -599,21 +654,25 @@ To create and use Windows Server container node pools, see [Create a Windows Ser
599654
[kubectl-describe]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#describe
600655

601656
<!-- INTERNAL LINKS -->
602-
[quotas-skus-regions]: quotas-skus-regions.md
657+
[aks-windows]: windows-container-cli.md
603658
[az-aks-get-credentials]: /cli/azure/aks#az-aks-get-credentials
604-
[az-group-create]: /cli/azure/group#az-group-create
605659
[az-aks-create]: /cli/azure/aks#az-aks-create
606-
[az-aks-nodepool-add]: /cli/azure/ext/aks-preview/aks/nodepool#ext-aks-preview-az-aks-nodepool-add
607-
[az-aks-nodepool-list]: /cli/azure/ext/aks-preview/aks/nodepool#ext-aks-preview-az-aks-nodepool-list
608-
[az-aks-nodepool-upgrade]: /cli/azure/ext/aks-preview/aks/nodepool#ext-aks-preview-az-aks-nodepool-upgrade
609-
[az-aks-nodepool-scale]: /cli/azure/ext/aks-preview/aks/nodepool#ext-aks-preview-az-aks-nodepool-scale
610-
[az-aks-nodepool-delete]: /cli/azure/ext/aks-preview/aks/nodepool#ext-aks-preview-az-aks-nodepool-delete
611-
[vm-sizes]: ../virtual-machines/linux/sizes.md
612-
[taints-tolerations]: operator-best-practices-advanced-scheduler.md#provide-dedicated-nodes-using-taints-and-tolerations
613-
[gpu-cluster]: gpu-cluster.md
660+
[az-aks-nodepool-add]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-add
661+
[az-aks-nodepool-list]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-list
662+
[az-aks-nodepool-update]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-update
663+
[az-aks-nodepool-upgrade]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-upgrade
664+
[az-aks-nodepool-scale]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-scale
665+
[az-aks-nodepool-delete]: /cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-delete
666+
[az-extension-add]: /cli/azure/extension#az-extension-add
667+
[az-extension-update]: /cli/azure/extension#az-extension-update
668+
[az-group-create]: /cli/azure/group#az-group-create
614669
[az-group-delete]: /cli/azure/group#az-group-delete
670+
[az-group-deployment-create]: /cli/azure/group/deployment#az-group-deployment-create
671+
[gpu-cluster]: gpu-cluster.md
615672
[install-azure-cli]: /cli/azure/install-azure-cli
616-
[supported-versions]: supported-kubernetes-versions.md
617673
[operator-best-practices-advanced-scheduler]: operator-best-practices-advanced-scheduler.md
618-
[aks-windows]: windows-container-cli.md
619-
[az-group-deployment-create]: /cli/azure/group/deployment#az-group-deployment-create
674+
[quotas-skus-regions]: quotas-skus-regions.md
675+
[supported-versions]: supported-kubernetes-versions.md
676+
[tag-limitation]: ../azure-resource-manager/resource-group-using-tags.md
677+
[taints-tolerations]: operator-best-practices-advanced-scheduler.md#provide-dedicated-nodes-using-taints-and-tolerations
678+
[vm-sizes]: ../virtual-machines/linux/sizes.md

0 commit comments

Comments
 (0)