From 11c20cfc49d93b87bd464c125bc4b1f135adea28 Mon Sep 17 00:00:00 2001 From: Vedant Pareek Date: Fri, 6 Oct 2023 12:35:20 +0530 Subject: [PATCH 1/2] enabling blob storage in AKS by default --- aks.tf | 10 +++++++++- variables.tf | 55 ++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/aks.tf b/aks.tf index d816d6b..11ad243 100644 --- a/aks.tf +++ b/aks.tf @@ -13,7 +13,7 @@ resource "azurerm_role_assignment" "network_contributor_cluster" { module "aks" { source = "Azure/aks/azurerm" - version = "7.2.0" + version = "7.4.0" resource_group_name = var.resource_group_name cluster_name = var.name location = var.location @@ -53,6 +53,14 @@ module "aks" { identity_type = "UserAssigned" kubernetes_version = var.kubernetes_version + # storage + storage_profile_blob_driver_enabled = var.enable_blob_driver + storage_profile_disk_driver_enabled = var.enable_disk_driver + storage_profile_disk_driver_version = var.disk_driver_version + storage_profile_file_driver_enabled = var.enable_file_driver + storage_profile_snapshot_controller_enabled = var.enable_snapshot_controller + storage_profile_enabled = var.enable_storage_profile + # network configuration network_plugin = var.network_plugin vnet_subnet_id = var.subnet_id diff --git a/variables.tf b/variables.tf index 9a22dbc..4650928 100644 --- a/variables.tf +++ b/variables.tf @@ -7,19 +7,19 @@ variable "name" { type = string } variable "kubernetes_version" { - description = "version of the kubernetes engine" + description = "Version of the kubernetes engine" default = "1.26" type = string } variable "oidc_issuer_enabled" { - description = "enable OIDC for the cluster" + description = "Enable OIDC for the cluster" default = true type = bool } variable "disk_size" { - description = "disk size of the initial node pool in GB" + description = "Disk size of the initial node pool in GB" default = "100" type = string } @@ -37,16 +37,51 @@ variable "intial_node_pool_spot_instance_type" { } variable "workload_identity_enabled" { - description = "enable workload identity in the cluster" + description = "Enable workload identity in the cluster" default = true type = bool } variable "control_plane" { - description = "whether the cluster is control plane" + description = "Whether the cluster is control plane" type = bool } + +variable "enable_storage_profile" { + description = "Enable storage profile for the cluster. If disabled `enable_blob_driver`, `enable_file_driver`, `enable_disk_driver` and `enable_snapshot_controller` will have no impact" + type = bool + default = true +} + +variable "enable_blob_driver" { + description = "Enable blob storage provider" + type = bool + default = true +} + +variable "enable_file_driver" { + description = "Enable file storage provider" + type = bool + default = true +} + +variable "enable_disk_driver" { + description = "Enable disk storage provider" + type = bool + default = true +} + +variable "disk_driver_version" { + description = "Version of disk driver. Supported values `v1` and `v2`" + type = string + default = "v1" +} +variable "enable_snapshot_controller" { + description = "Enable snapshot controller" + type = bool + default = true +} ################################################################################ # Network ################################################################################ @@ -57,24 +92,24 @@ variable "vnet_id" { } variable "subnet_id" { - description = "Subnet Id for the cluster." + description = "Subnet Id for the cluster" type = string } variable "network_plugin" { - description = "network plugin to use for cluster" + description = "Network plugin to use for cluster" type = string default = "kubenet" } variable "pod_cidr" { - description = "CIDR of the pod" + description = "CIDR of the pod in cluster" default = "10.244.0.0/16" type = string } variable "service_cidr" { - description = "service CIDR" + description = "CIDR of the services in cluster" default = "10.255.0.0/16" type = string } @@ -86,7 +121,7 @@ variable "dns_ip" { } variable "allowed_ip_ranges" { - description = "allowed IP ranges to connect to the cluster" + description = "Allowed IP ranges to connect to the cluster" default = ["0.0.0.0/0"] type = list(string) } From 93a0091e1953bdc4b073bfbd424c326c0a10f373 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Oct 2023 07:08:18 +0000 Subject: [PATCH 2/2] terraform-docs: automated action --- README.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8aa4be4..96238df 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Truefoundry Azure Cluster Module | Name | Source | Version | |------|--------|---------| -| [aks](#module\_aks) | Azure/aks/azurerm | 7.2.0 | +| [aks](#module\_aks) | Azure/aks/azurerm | 7.4.0 | ## Resources @@ -32,25 +32,31 @@ Truefoundry Azure Cluster Module | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | allowed IP ranges to connect to the cluster | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [control\_plane](#input\_control\_plane) | whether the cluster is control plane | `bool` | n/a | yes | -| [disk\_size](#input\_disk\_size) | disk size of the initial node pool in GB | `string` | `"100"` | no | +| [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | Allowed IP ranges to connect to the cluster | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [control\_plane](#input\_control\_plane) | Whether the cluster is control plane | `bool` | n/a | yes | +| [disk\_driver\_version](#input\_disk\_driver\_version) | Version of disk driver. Supported values `v1` and `v2` | `string` | `"v1"` | no | +| [disk\_size](#input\_disk\_size) | Disk size of the initial node pool in GB | `string` | `"100"` | no | | [dns\_ip](#input\_dns\_ip) | IP from service CIDR used for internal DNS | `string` | `"10.255.0.10"` | no | +| [enable\_blob\_driver](#input\_enable\_blob\_driver) | Enable blob storage provider | `bool` | `true` | no | +| [enable\_disk\_driver](#input\_enable\_disk\_driver) | Enable disk storage provider | `bool` | `true` | no | +| [enable\_file\_driver](#input\_enable\_file\_driver) | Enable file storage provider | `bool` | `true` | no | +| [enable\_snapshot\_controller](#input\_enable\_snapshot\_controller) | Enable snapshot controller | `bool` | `true` | no | +| [enable\_storage\_profile](#input\_enable\_storage\_profile) | Enable storage profile for the cluster. If disabled `enable_blob_driver`, `enable_file_driver`, `enable_disk_driver` and `enable_snapshot_controller` will have no impact | `bool` | `true` | no | | [intial\_node\_pool\_instance\_type](#input\_intial\_node\_pool\_instance\_type) | Instance size of the initial node pool | `string` | `"Standard_D2s_v5"` | no | | [intial\_node\_pool\_spot\_instance\_type](#input\_intial\_node\_pool\_spot\_instance\_type) | Instance size of the initial node pool | `string` | `"Standard_D4s_v5"` | no | -| [kubernetes\_version](#input\_kubernetes\_version) | version of the kubernetes engine | `string` | `"1.26"` | no | +| [kubernetes\_version](#input\_kubernetes\_version) | Version of the kubernetes engine | `string` | `"1.26"` | no | | [location](#input\_location) | Location of the resource group | `string` | n/a | yes | | [name](#input\_name) | Name of the cluster | `string` | n/a | yes | -| [network\_plugin](#input\_network\_plugin) | network plugin to use for cluster | `string` | `"kubenet"` | no | -| [oidc\_issuer\_enabled](#input\_oidc\_issuer\_enabled) | enable OIDC for the cluster | `bool` | `true` | no | -| [pod\_cidr](#input\_pod\_cidr) | CIDR of the pod | `string` | `"10.244.0.0/16"` | no | +| [network\_plugin](#input\_network\_plugin) | Network plugin to use for cluster | `string` | `"kubenet"` | no | +| [oidc\_issuer\_enabled](#input\_oidc\_issuer\_enabled) | Enable OIDC for the cluster | `bool` | `true` | no | +| [pod\_cidr](#input\_pod\_cidr) | CIDR of the pod in cluster | `string` | `"10.244.0.0/16"` | no | | [private\_cluster\_enabled](#input\_private\_cluster\_enabled) | Private cluster | `bool` | `false` | no | | [resource\_group\_name](#input\_resource\_group\_name) | Name of the resource group | `string` | n/a | yes | -| [service\_cidr](#input\_service\_cidr) | service CIDR | `string` | `"10.255.0.0/16"` | no | -| [subnet\_id](#input\_subnet\_id) | Subnet Id for the cluster. | `string` | n/a | yes | +| [service\_cidr](#input\_service\_cidr) | CIDR of the services in cluster | `string` | `"10.255.0.0/16"` | no | +| [subnet\_id](#input\_subnet\_id) | Subnet Id for the cluster | `string` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no | | [vnet\_id](#input\_vnet\_id) | Vnet ID for the cluster | `string` | n/a | yes | -| [workload\_identity\_enabled](#input\_workload\_identity\_enabled) | enable workload identity in the cluster | `bool` | `true` | no | +| [workload\_identity\_enabled](#input\_workload\_identity\_enabled) | Enable workload identity in the cluster | `bool` | `true` | no | ## Outputs