Skip to content

Commit 7f5add4

Browse files
authored
feat: Adding community option for Azure NetappFiles Volume size control. (#493)
* Adding community option for Azure NetappFiles Volume size control. Signed-off-by: frozentank <frozentank@gmail.com> * Updating variable name to resolve community variable naming convention change. Signed-off-by: frozentank <frozentank@gmail.com> * Moving the community configuration documentation into another section. Signed-off-by: frozentank <frozentank@gmail.com> * Removing duplicate configuration variable description. Signed-off-by: frozentank <frozentank@gmail.com> * Removing community_enable_spot_nodes configuration field from documentation. Signed-off-by: frozentank <frozentank@gmail.com> --------- Signed-off-by: frozentank <frozentank@gmail.com>
1 parent 1b0fb0a commit 7f5add4

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

docs/community/community_config_vars.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Community-contributed configuration variables are listed in the tables below. Th
88
## Table of Contents
99

1010
* [Spot Nodes](#spot_nodes)
11+
* [Netapp Volume Size](#netapp_volume_size)
1112

1213
<a name="spot_nodes"></a>
1314
## Spot Nodes
@@ -27,3 +28,13 @@ To enable a Spot node pool in your AKS cluster using this module, configure the
2728
| community_eviction_policy | (Optional) The Eviction Policy which should be used for Virtual Machines within the Virtual Machine Scale Set powering this Node Pool. Possible values are Deallocate and Delete. Changing this forces a new resource to be created. | string | `Delete` | 10.3.0 | |
2829
| community_spot_max_price | (Optional) The maximum price you're willing to pay in USD per Virtual Machine. Valid values are -1 (the current on-demand price for a Virtual Machine) or a positive value with up to five decimal places. Changing this forces a new resource to be created. | string | `-1` | 10.3.0 | |
2930

31+
<a name="netapp_volume_size"></a>
32+
## Netapp Volume Size
33+
34+
Netapp Volume Size control allows you to create a Netapp Volume smaller than the Netapp Pool. This will allow other tools outside of this Terraform to create Netapp Volumes within the pool.
35+
36+
To control the Netapp Volume size use the below community-maintained variable listed below. This will allow you to control the size of the Netapp Volume in GBs. This value must be smaller than the Netapp Pool size. There is no validation for this during the planning phase of Terraform. If this is misconfigured, the Terraform Apply will fail when attempting to deploy the volume.
37+
38+
| Name | Description | Type | Default | Release Added | Notes |
39+
| :--- | ---: | ---: | ---: | ---: | ---: |
40+
| community_netapp_volume_size | Size of the netapp volume | number | 0 | 10.3.0 | Zero will disable, must be smaller than the Netapp Pool. The value is given in GB |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ module "netapp" {
264264
tags = var.tags
265265
allowed_clients = concat(module.vnet.subnets["aks"].address_prefixes, module.vnet.subnets["misc"].address_prefixes)
266266
depends_on = [module.vnet]
267+
268+
community_netapp_volume_size = var.community_netapp_volume_size
267269
}
268270

269271
data "external" "git_hash" {

modules/azurerm_netapp/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "azurerm_netapp_volume" "anf" {
3333
subnet_id = var.subnet_id
3434
network_features = var.network_features
3535
protocols = var.protocols
36-
storage_quota_in_gb = var.size_in_tb * 1024
36+
storage_quota_in_gb = var.community_netapp_volume_size == 0 ? var.size_in_tb * 1024 : var.community_netapp_volume_size
3737
tags = var.tags
3838

3939
export_policy_rule {

modules/azurerm_netapp/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,11 @@ variable "tags" {
5959
description = "Map of tags to be placed on the Resources"
6060
type = map(any)
6161
}
62+
63+
# Community Contribution
64+
# Netapp Volume Size control
65+
variable "community_netapp_volume_size" {
66+
description = "Community Contributed field. Will manually set the value of the Netapp Volume smaller than the Netapp Pool. This value is in GB."
67+
type = number
68+
default = 0
69+
}

variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,3 +835,11 @@ variable "node_resource_group_name" {
835835
type = string
836836
default = ""
837837
}
838+
839+
# Community Contribution
840+
# Netapp Volume Size control
841+
variable "community_netapp_volume_size" {
842+
description = "Community Contributed field. Will manually set the value of the Netapp Volume smaller than the Netapp Pool. This value is in GB."
843+
type = number
844+
default = 0
845+
}

0 commit comments

Comments
 (0)