azurerm_kubernetes_cluster_node_pool - support for the pod_ip_allocation_mode property#30827
Conversation
azurerm_kubernetes_cluster_node_pool - support for the pod_ip_allocation_mode property
|
Please also check if this property could be set in the kubernete cluster's default node pool. |
|
|
||
| data.ResourceTest(t, r, []acceptance.TestStep{ | ||
| { | ||
| Config: r.defaultNodePoolPodIPAllocationMode(data, "StaticBlock"), |
There was a problem hiding this comment.
Please add steps to test it switch from one value to another.
There was a problem hiding this comment.
Disagree here given it's a ForceNew property
There was a problem hiding this comment.
I adjusted this after the later ForceNew note. The test now covers explicit StaticBlock create/import only; switching the value would recreate the node pool, so I did not make this a switch test.
|
Thanks @hqhqhqhqhqhqhqhqhqhqhq , LGTM! |
sreallymatt
left a comment
There was a problem hiding this comment.
Hi @hqhqhqhqhqhqhqhqhqhqhq - the way this property is being introduced is a breaking change as the default is going to cause replacements on pre-existing clusters
| Optional: true, | ||
| ForceNew: true, | ||
| RequiredWith: []string{"pod_subnet_id"}, | ||
| Default: string(agentpools.PodIPAllocationModeDynamicIndividual), |
There was a problem hiding this comment.
Fixed in the latest push. Removed the Terraform-side default and made pod_ip_allocation_mode Optional+Computed for the standalone node pool, so existing configs that omit it should not plan replacement.
| data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_node_pool", "test") | ||
| r := KubernetesClusterNodePoolResource{} | ||
|
|
||
| data.ResourceTestIgnoreRecreate(t, r, []acceptance.TestStep{ |
There was a problem hiding this comment.
We generally avoid tests that force a resource recreation, could you clarify why you've included it here?
There was a problem hiding this comment.
Fixed in the latest push. The pod IP allocation tests now only create and import an explicit StaticBlock configuration, instead of switching values and forcing recreation.
|
|
||
| data.ResourceTest(t, r, []acceptance.TestStep{ | ||
| { | ||
| Config: r.defaultNodePoolPodIPAllocationMode(data, "StaticBlock"), |
There was a problem hiding this comment.
Disagree here given it's a ForceNew property
| Optional: true, | ||
| ForceNew: true, | ||
| RequiredWith: []string{"default_node_pool.0.pod_subnet_id"}, | ||
| Default: string(managedclusters.PodIPAllocationModeDynamicIndividual), |
There was a problem hiding this comment.
Fixed in the latest push. Applied the same change to the default node pool schema: no Terraform-side default, and the field is Optional+Computed.
…cation_mode` property
|
Hey @sreallymatt , any chance you could pick this back up when you get a moment? Would really help for managing large AKS clusters. Thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@hqhqhqhqhqhqhqhqhqhqhq - One or more tests failed in this PR. Please review the failures. Total: 258 Test Details
|
|
@hqhqhqhqhqhqhqhqhqhqhq - One or more tests failed in this PR. Please review the failures. Testing in Beta version enabled Total: 256 Test Details
|


Community Note
Description
azurerm_kubernetes_cluster_node_pool- support for thepod_ip_allocation_modepropertyPR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_kubernetes_cluster_node_pool- support for thepod_ip_allocation_modepropertyThis is a (please select all that apply):
Related Issue(s)
Fixes #0000
AI Assistance Disclosure
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.