-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option in azure_rm_aks to set tags for agent_pool_profiles #1713
Comments
@Ezopek Thank you for submitting the problem, but I can manage the AKS resource in your way, and the resource was created successfully. But from your error, is your error because the policy does not allow your subscription to manage this resource? Thank you! |
@Fred-sun AKS resource itself is created, but with failed agent(s)_pool. The error I posted is targeted on deployment of VMSS (VirtualMachineScaleSets) for the agent_pool - my company doesn't allow creating that resource since it doesn't have required custom tags. So yea, as a workaround I could just handle this specific error and create needed agent_pools later with To speak more plainly - I would like the VirtualMachineScaleSets created by |
@Ezopek Currently the SDK does not support defining tags in this way, so it is not possible to do so for the time being. Thank you! |
@Fred-sun I can see in SDK documentation for azure-mgmt-containerservice > ManagedClustersOperations > begin_create_or_update > ManagedCluster object > ManagedClusterAgentPoolProfile object used in list for Also, this is possible via Terraform azurerm provider (https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#default_node_pool) same as with REST API (https://learn.microsoft.com/en-us/rest/api/aks/managed-clusters/create-or-update?view=rest-aks-2024-07-01&tabs=HTTP#managedclusteragentpoolprofile) |
Actually after some thought I might have overcomplicate this issue a little. - name: Create AKS
azure_rm_aks:
name: "{{ aks_name }}"
location: "{{ location }}"
resource_group: "{{ resource_group }}"
# [...]
agent_pool_profiles:
- name: master
mode: System
vm_size: Standard_B2s
type: VirtualMachineScaleSets
# [...]
tags: # <-- this right now is not possible in ansible azure_rm_aks, yet it is via REST API, Terraform azurerm provider or Python Azure SDK
some: custom
tags: aks
tags:
some: custom
tags: aks Sorry for all the confusion with "inheriting" stuff... At first I thought simply of copying tags from main |
@Fred-sun can you look at it once again and verify 'hold' label - there are available features for agent-pools tags in Azure Python SDK - #1713 (comment) |
@Ezopek You mean to add tags to the parameter 'agent_pool_profiles', right? |
SUMMARY
Add option for agent_pools vmss to inherits tags from main azure_rm_aks object.
ISSUE TYPE
COMPONENT NAME
azure_rm_aks
ADDITIONAL INFORMATION
Hi, my company requires that every object created in Azure should have specific tags when we deploy it. And right now, when I try create AKS using azure_rm_aks it ultimately fails with ResourceOperationFailure -> RequestDisallowedByPolicy and message requesting adding required tags on resource
aks-master-69745823-vmss
.Other objects created by AKS (like new Resource Group or Load Balancer) do inherit those tags, but for some reason, azure_rm_aks tries to create agent_pools VMSS without providing them.
vars/main.yml
:task/main.yml
:With configuration like that I get following error:
The text was updated successfully, but these errors were encountered: